diff --git a/LANG_www/agc/active_list_refresh.php b/LANG_www/agc/active_list_refresh.php deleted file mode 100644 index 7ea0bff0..00000000 --- a/LANG_www/agc/active_list_refresh.php +++ /dev/null @@ -1,482 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1118 - Added variable filters to close security holes for login form -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -### security strip all non-alphanumeric characters out of the variables ### - $user=ereg_replace("[^0-9a-zA-Z]","",$user); - $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - $ADD=ereg_replace("[^0-9]","",$ADD); - $order=ereg_replace("[^0-9a-zA-Z]","",$order); - $format=ereg_replace("[^0-9a-zA-Z]","",$format); - $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); - $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); - $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); - $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); - $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); - $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); - $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); - $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); - $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); - $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); - $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.8'; -$build = '60619-1118'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_www/agc/astguiclient.php b/LANG_www/agc/astguiclient.php deleted file mode 100644 index c5fe5902..00000000 --- a/LANG_www/agc/astguiclient.php +++ /dev/null @@ -1,2905 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1103 - Added variable filters to close security holes for login form -# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php -# - -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["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '2.0.1'; -$build = '60829-1528'; - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $user=ereg_replace("[^0-9a-zA-Z]","",$user); - $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$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://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - } - -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 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - - - - - - - - - - - - - - - - diff --git a/LANG_www/agc/call_log_display.php b/LANG_www/agc/call_log_display.php deleted file mode 100644 index 28d3ea87..00000000 --- a/LANG_www/agc/call_log_display.php +++ /dev/null @@ -1,196 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 50503-1236 - added session_name checking for extra security -# 50610-1158 - Added NULL check on MySQL results to reduced errors -# 50711-1202 - removed HTTP authentication in favor of user/pass vars -# 60323-1550 - added option for showing different number dialed in log -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1202 - Added variable filters to close security holes for login form -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.8'; -$build = '60619-1202'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 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"; - - if ($number_dialed == 'extension') {$row[2] = substr($row[2],-10);} - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 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"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc/conf_exten_check.php b/LANG_www/agc/conf_exten_check.php deleted file mode 100644 index ae3b84b5..00000000 --- a/LANG_www/agc/conf_exten_check.php +++ /dev/null @@ -1,297 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 50706-1525 - Added date-time display for vicidial client display -# 50816-1500 - Added random update to vicidial_live_agents table for vdc users -# 51121-1353 - Altered echo statements for several small PHP speed optimizations -# 60410-1424 - Added ability to grab calls-being-placed and agent status -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1201 - Added variable filters to close security holes for login form -# 61128-2255 - Added update for manual dial vicidial_live_agents -# 70319-1542 - Added agent disabled display function -# 71122-0205 - Added vicidial_live_agent status output -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -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["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '2.0.4-12'; -$build = '71122-0205'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - $Acount=0; - $AexternalDEAD=0; - - ### see if the agent has a record in the vicidial_live_agents table - $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Acount=$row[0]; - - if ($Acount > 0) - { - $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; - } - # ### find out if external table shows agent should be disabled - # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; - # if ($DB) {echo "|$stmt|\n";} - # $rslt=mysql_query($stmt, $link); - # $row=mysql_fetch_row($rslt); - # $AexternalDEAD=$row[0]; - - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($campagentstdisp == 'YES') - { - ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Alogin=$row[0]; - $Acampaign=$row[1]; - - ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $RingCalls=$row[0]; - } - else - { - $Alogin='N'; - $RingCalls='N'; - } - } - else - { - $Alogin='N'; - $RingCalls='N'; - - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc/images/Thumbs.db b/LANG_www/agc/images/Thumbs.db deleted file mode 100644 index d6ae4c59..00000000 Binary files a/LANG_www/agc/images/Thumbs.db and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_BLINK.gif b/LANG_www/agc/images/agc_check_voicemail_BLINK.gif deleted file mode 100644 index 30703a78..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_BLINK.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_BLINK_e.gif b/LANG_www/agc/images/agc_check_voicemail_BLINK_e.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_BLINK_e.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_BLINK_es.gif b/LANG_www/agc/images/agc_check_voicemail_BLINK_es.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_BLINK_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_BLINK_ptbr.gif b/LANG_www/agc/images/agc_check_voicemail_BLINK_ptbr.gif deleted file mode 100644 index 3670af28..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_BLINK_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_OFF.gif b/LANG_www/agc/images/agc_check_voicemail_OFF.gif deleted file mode 100644 index 5b7e4c75..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_OFF_es.gif b/LANG_www/agc/images/agc_check_voicemail_OFF_es.gif deleted file mode 100644 index ec9c1d55..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_OFF_ptbr.gif b/LANG_www/agc/images/agc_check_voicemail_OFF_ptbr.gif deleted file mode 100644 index 3b1c4644..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_ON.gif b/LANG_www/agc/images/agc_check_voicemail_ON.gif deleted file mode 100644 index ad55916d..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_ON.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_ON_es.gif b/LANG_www/agc/images/agc_check_voicemail_ON_es.gif deleted file mode 100644 index 442a8084..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_ON_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_check_voicemail_ON_ptbr.gif b/LANG_www/agc/images/agc_check_voicemail_ON_ptbr.gif deleted file mode 100644 index ae53a393..00000000 Binary files a/LANG_www/agc/images/agc_check_voicemail_ON_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_OFF.gif b/LANG_www/agc/images/agc_live_call_OFF.gif deleted file mode 100644 index 3752fb5e..00000000 Binary files a/LANG_www/agc/images/agc_live_call_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_OFF_es.gif b/LANG_www/agc/images/agc_live_call_OFF_es.gif deleted file mode 100644 index 1ff376d8..00000000 Binary files a/LANG_www/agc/images/agc_live_call_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_OFF_pl.gif b/LANG_www/agc/images/agc_live_call_OFF_pl.gif deleted file mode 100644 index 3c42a377..00000000 Binary files a/LANG_www/agc/images/agc_live_call_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_OFF_ptbr.gif b/LANG_www/agc/images/agc_live_call_OFF_ptbr.gif deleted file mode 100644 index 86a71723..00000000 Binary files a/LANG_www/agc/images/agc_live_call_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_ON.gif b/LANG_www/agc/images/agc_live_call_ON.gif deleted file mode 100644 index ed8ba2dd..00000000 Binary files a/LANG_www/agc/images/agc_live_call_ON.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_ON_es.gif b/LANG_www/agc/images/agc_live_call_ON_es.gif deleted file mode 100644 index 041d398f..00000000 Binary files a/LANG_www/agc/images/agc_live_call_ON_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_ON_pl.gif b/LANG_www/agc/images/agc_live_call_ON_pl.gif deleted file mode 100644 index 330346eb..00000000 Binary files a/LANG_www/agc/images/agc_live_call_ON_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_live_call_ON_ptbr.gif b/LANG_www/agc/images/agc_live_call_ON_ptbr.gif deleted file mode 100644 index c0601666..00000000 Binary files a/LANG_www/agc/images/agc_live_call_ON_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_active_lines.gif b/LANG_www/agc/images/agc_tab_active_lines.gif deleted file mode 100644 index 9f8eaf67..00000000 Binary files a/LANG_www/agc/images/agc_tab_active_lines.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_active_lines_el.gif b/LANG_www/agc/images/agc_tab_active_lines_el.gif deleted file mode 100644 index 1bea40dc..00000000 Binary files a/LANG_www/agc/images/agc_tab_active_lines_el.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_active_lines_es.gif b/LANG_www/agc/images/agc_tab_active_lines_es.gif deleted file mode 100644 index bdefd015..00000000 Binary files a/LANG_www/agc/images/agc_tab_active_lines_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_active_lines_ptbr.gif b/LANG_www/agc/images/agc_tab_active_lines_ptbr.gif deleted file mode 100644 index 1465ea6e..00000000 Binary files a/LANG_www/agc/images/agc_tab_active_lines_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_astguiclient.gif b/LANG_www/agc/images/agc_tab_astguiclient.gif deleted file mode 100644 index 30373576..00000000 Binary files a/LANG_www/agc/images/agc_tab_astguiclient.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_astguiclient_ptbr.gif b/LANG_www/agc/images/agc_tab_astguiclient_ptbr.gif deleted file mode 100644 index 30373576..00000000 Binary files a/LANG_www/agc/images/agc_tab_astguiclient_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_conferences.gif b/LANG_www/agc/images/agc_tab_conferences.gif deleted file mode 100644 index e3c80662..00000000 Binary files a/LANG_www/agc/images/agc_tab_conferences.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_conferences_el.gif b/LANG_www/agc/images/agc_tab_conferences_el.gif deleted file mode 100644 index 91282b42..00000000 Binary files a/LANG_www/agc/images/agc_tab_conferences_el.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_conferences_es.gif b/LANG_www/agc/images/agc_tab_conferences_es.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/LANG_www/agc/images/agc_tab_conferences_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_conferences_ptbr.gif b/LANG_www/agc/images/agc_tab_conferences_ptbr.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/LANG_www/agc/images/agc_tab_conferences_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_main.gif b/LANG_www/agc/images/agc_tab_main.gif deleted file mode 100644 index 6e687e44..00000000 Binary files a/LANG_www/agc/images/agc_tab_main.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_main_el.gif b/LANG_www/agc/images/agc_tab_main_el.gif deleted file mode 100644 index 4eaf0aa3..00000000 Binary files a/LANG_www/agc/images/agc_tab_main_el.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_main_es.gif b/LANG_www/agc/images/agc_tab_main_es.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/LANG_www/agc/images/agc_tab_main_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/agc_tab_main_ptbr.gif b/LANG_www/agc/images/agc_tab_main_ptbr.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/LANG_www/agc/images/agc_tab_main_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/blank.gif b/LANG_www/agc/images/blank.gif deleted file mode 100644 index 3a469695..00000000 Binary files a/LANG_www/agc/images/blank.gif and /dev/null differ diff --git a/LANG_www/agc/images/br.gif b/LANG_www/agc/images/br.gif deleted file mode 100644 index 423b8a0c..00000000 Binary files a/LANG_www/agc/images/br.gif and /dev/null differ diff --git a/LANG_www/agc/images/de.gif b/LANG_www/agc/images/de.gif deleted file mode 100644 index 4dd34f6a..00000000 Binary files a/LANG_www/agc/images/de.gif and /dev/null differ diff --git a/LANG_www/agc/images/down.gif b/LANG_www/agc/images/down.gif deleted file mode 100644 index 32d0a007..00000000 Binary files a/LANG_www/agc/images/down.gif and /dev/null differ diff --git a/LANG_www/agc/images/el.gif b/LANG_www/agc/images/el.gif deleted file mode 100644 index 9e79d8bf..00000000 Binary files a/LANG_www/agc/images/el.gif and /dev/null differ diff --git a/LANG_www/agc/images/en.gif b/LANG_www/agc/images/en.gif deleted file mode 100644 index cb45f5f4..00000000 Binary files a/LANG_www/agc/images/en.gif and /dev/null differ diff --git a/LANG_www/agc/images/es.gif b/LANG_www/agc/images/es.gif deleted file mode 100644 index 308ea3cb..00000000 Binary files a/LANG_www/agc/images/es.gif and /dev/null differ diff --git a/LANG_www/agc/images/fr.gif b/LANG_www/agc/images/fr.gif deleted file mode 100644 index 21fb3d19..00000000 Binary files a/LANG_www/agc/images/fr.gif and /dev/null differ diff --git a/LANG_www/agc/images/it.gif b/LANG_www/agc/images/it.gif deleted file mode 100644 index 6c7b1792..00000000 Binary files a/LANG_www/agc/images/it.gif and /dev/null differ diff --git a/LANG_www/agc/images/pl.gif b/LANG_www/agc/images/pl.gif deleted file mode 100644 index cde07905..00000000 Binary files a/LANG_www/agc/images/pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/pt.gif b/LANG_www/agc/images/pt.gif deleted file mode 100644 index 646b76ac..00000000 Binary files a/LANG_www/agc/images/pt.gif and /dev/null differ diff --git a/LANG_www/agc/images/remove.gif b/LANG_www/agc/images/remove.gif deleted file mode 100644 index 89b0521c..00000000 Binary files a/LANG_www/agc/images/remove.gif and /dev/null differ diff --git a/LANG_www/agc/images/up.gif b/LANG_www/agc/images/up.gif deleted file mode 100644 index 0d55544f..00000000 Binary files a/LANG_www/agc/images/up.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber.gif deleted file mode 100644 index a5a080d6..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF.gif deleted file mode 100644 index 75bc0e8f..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_es.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_es.gif deleted file mode 100644 index 405ff336..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif deleted file mode 100644 index 0d297820..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber_es.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber_es.gif deleted file mode 100644 index ca92716e..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_dialnextnumber_ptbr.gif b/LANG_www/agc/images/vdc_LB_dialnextnumber_ptbr.gif deleted file mode 100644 index 8625b1c9..00000000 Binary files a/LANG_www/agc/images/vdc_LB_dialnextnumber_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall.gif deleted file mode 100644 index a6779255..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF.gif deleted file mode 100644 index 74b1f5a1..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_es.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_es.gif deleted file mode 100644 index 21991dd5..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif deleted file mode 100644 index 19932ad2..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall_es.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall_es.gif deleted file mode 100644 index 9acc363a..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_grabparkedcall_ptbr.gif b/LANG_www/agc/images/vdc_LB_grabparkedcall_ptbr.gif deleted file mode 100644 index e37d0fb4..00000000 Binary files a/LANG_www/agc/images/vdc_LB_grabparkedcall_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer.gif deleted file mode 100644 index b4fdfae8..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF.gif deleted file mode 100644 index e5736ae0..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_es.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_es.gif deleted file mode 100644 index 570a6e5a..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_pl.gif deleted file mode 100644 index 50407590..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif deleted file mode 100644 index 57918268..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_es.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_es.gif deleted file mode 100644 index 94d3e225..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_pl.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_pl.gif deleted file mode 100644 index e07bc496..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_hangupcustomer_ptbr.gif b/LANG_www/agc/images/vdc_LB_hangupcustomer_ptbr.gif deleted file mode 100644 index 5841050c..00000000 Binary files a/LANG_www/agc/images/vdc_LB_hangupcustomer_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall.gif b/LANG_www/agc/images/vdc_LB_parkcall.gif deleted file mode 100644 index 88fee283..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_OFF.gif b/LANG_www/agc/images/vdc_LB_parkcall_OFF.gif deleted file mode 100644 index 8ad55010..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_OFF_es.gif b/LANG_www/agc/images/vdc_LB_parkcall_OFF_es.gif deleted file mode 100644 index 110ce6b0..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_parkcall_OFF_pl.gif deleted file mode 100644 index c188f0fa..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_parkcall_OFF_ptbr.gif deleted file mode 100644 index 25a6a2f2..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_es.gif b/LANG_www/agc/images/vdc_LB_parkcall_es.gif deleted file mode 100644 index 2274a27c..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_pl.gif b/LANG_www/agc/images/vdc_LB_parkcall_pl.gif deleted file mode 100644 index fc0d97eb..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_parkcall_ptbr.gif b/LANG_www/agc/images/vdc_LB_parkcall_ptbr.gif deleted file mode 100644 index b37d8358..00000000 Binary files a/LANG_www/agc/images/vdc_LB_parkcall_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause.gif b/LANG_www/agc/images/vdc_LB_pause.gif deleted file mode 100644 index 3486a1c1..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_OFF.gif b/LANG_www/agc/images/vdc_LB_pause_OFF.gif deleted file mode 100644 index fce03041..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_OFF_es.gif b/LANG_www/agc/images/vdc_LB_pause_OFF_es.gif deleted file mode 100644 index 494d68a5..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_pause_OFF_pl.gif deleted file mode 100644 index 8619e9dd..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_pause_OFF_ptbr.gif deleted file mode 100644 index 3d8c8759..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_es.gif b/LANG_www/agc/images/vdc_LB_pause_es.gif deleted file mode 100644 index 544a3797..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_pl.gif b/LANG_www/agc/images/vdc_LB_pause_pl.gif deleted file mode 100644 index c0e2066e..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_pause_ptbr.gif b/LANG_www/agc/images/vdc_LB_pause_ptbr.gif deleted file mode 100644 index bea56d65..00000000 Binary files a/LANG_www/agc/images/vdc_LB_pause_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume.gif b/LANG_www/agc/images/vdc_LB_resume.gif deleted file mode 100644 index a7d75dd8..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_OFF.gif b/LANG_www/agc/images/vdc_LB_resume_OFF.gif deleted file mode 100644 index 0ae4cb9a..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_OFF_es.gif b/LANG_www/agc/images/vdc_LB_resume_OFF_es.gif deleted file mode 100644 index 921d5d5e..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_resume_OFF_pl.gif deleted file mode 100644 index 3cb532bc..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_resume_OFF_ptbr.gif deleted file mode 100644 index 43bb9235..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_es.gif b/LANG_www/agc/images/vdc_LB_resume_es.gif deleted file mode 100644 index 1b096144..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_pl.gif b/LANG_www/agc/images/vdc_LB_resume_pl.gif deleted file mode 100644 index ec2103e7..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_resume_ptbr.gif b/LANG_www/agc/images/vdc_LB_resume_ptbr.gif deleted file mode 100644 index 415b22d1..00000000 Binary files a/LANG_www/agc/images/vdc_LB_resume_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf.gif b/LANG_www/agc/images/vdc_LB_senddtmf.gif deleted file mode 100644 index d19888ad..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf_OFF.gif b/LANG_www/agc/images/vdc_LB_senddtmf_OFF.gif deleted file mode 100644 index 08a4b392..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf_OFF_es.gif b/LANG_www/agc/images/vdc_LB_senddtmf_OFF_es.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf_es.gif b/LANG_www/agc/images/vdc_LB_senddtmf_es.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_senddtmf_ptbr.gif b/LANG_www/agc/images/vdc_LB_senddtmf_ptbr.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/LANG_www/agc/images/vdc_LB_senddtmf_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_spacer.gif b/LANG_www/agc/images/vdc_LB_spacer.gif deleted file mode 100644 index d0a4f6ed..00000000 Binary files a/LANG_www/agc/images/vdc_LB_spacer.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording.gif b/LANG_www/agc/images/vdc_LB_startrecording.gif deleted file mode 100644 index 022103d2..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_OFF.gif b/LANG_www/agc/images/vdc_LB_startrecording_OFF.gif deleted file mode 100644 index 3ee4ca62..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_OFF_es.gif b/LANG_www/agc/images/vdc_LB_startrecording_OFF_es.gif deleted file mode 100644 index ff9a3447..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_OFF_p.gif b/LANG_www/agc/images/vdc_LB_startrecording_OFF_p.gif deleted file mode 100644 index 91098453..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_OFF_p.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_startrecording_OFF_pl.gif deleted file mode 100644 index a8d5cbc3..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_startrecording_OFF_ptbr.gif deleted file mode 100644 index 22105778..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_es.gif b/LANG_www/agc/images/vdc_LB_startrecording_es.gif deleted file mode 100644 index 26420f78..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_pl.gif b/LANG_www/agc/images/vdc_LB_startrecording_pl.gif deleted file mode 100644 index ef031de9..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_startrecording_ptbr.gif b/LANG_www/agc/images/vdc_LB_startrecording_ptbr.gif deleted file mode 100644 index 15b25990..00000000 Binary files a/LANG_www/agc/images/vdc_LB_startrecording_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording.gif b/LANG_www/agc/images/vdc_LB_stoprecording.gif deleted file mode 100644 index 6f3bfede..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_OFF.gif b/LANG_www/agc/images/vdc_LB_stoprecording_OFF.gif deleted file mode 100644 index 2e1efe4a..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_es.gif b/LANG_www/agc/images/vdc_LB_stoprecording_OFF_es.gif deleted file mode 100644 index 2806311f..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_stoprecording_OFF_pl.gif deleted file mode 100644 index 0cf042fc..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif deleted file mode 100644 index c0259410..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_es.gif b/LANG_www/agc/images/vdc_LB_stoprecording_es.gif deleted file mode 100644 index 94f9de9d..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_pl.gif b/LANG_www/agc/images/vdc_LB_stoprecording_pl.gif deleted file mode 100644 index 562822d9..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_stoprecording_ptbr.gif b/LANG_www/agc/images/vdc_LB_stoprecording_ptbr.gif deleted file mode 100644 index 8a76e860..00000000 Binary files a/LANG_www/agc/images/vdc_LB_stoprecording_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf.gif b/LANG_www/agc/images/vdc_LB_transferconf.gif deleted file mode 100644 index c5738519..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_OFF.gif b/LANG_www/agc/images/vdc_LB_transferconf_OFF.gif deleted file mode 100644 index dd0a579a..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_OFF_es.gif b/LANG_www/agc/images/vdc_LB_transferconf_OFF_es.gif deleted file mode 100644 index d0a54bf6..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_transferconf_OFF_pl.gif deleted file mode 100644 index 9e3ea08e..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_transferconf_OFF_ptbr.gif deleted file mode 100644 index ebb69344..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_es.gif b/LANG_www/agc/images/vdc_LB_transferconf_es.gif deleted file mode 100644 index 10cfa495..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_pl.gif b/LANG_www/agc/images/vdc_LB_transferconf_pl.gif deleted file mode 100644 index e30680b0..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_transferconf_ptbr.gif b/LANG_www/agc/images/vdc_LB_transferconf_ptbr.gif deleted file mode 100644 index f008e92c..00000000 Binary files a/LANG_www/agc/images/vdc_LB_transferconf_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform.gif b/LANG_www/agc/images/vdc_LB_webform.gif deleted file mode 100644 index 4d5228f3..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_OFF.gif b/LANG_www/agc/images/vdc_LB_webform_OFF.gif deleted file mode 100644 index 64316ced..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_OFF_es.gif b/LANG_www/agc/images/vdc_LB_webform_OFF_es.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_OFF_pl.gif b/LANG_www/agc/images/vdc_LB_webform_OFF_pl.gif deleted file mode 100644 index cfbd2d92..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_OFF_ptbr.gif b/LANG_www/agc/images/vdc_LB_webform_OFF_ptbr.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_es.gif b/LANG_www/agc/images/vdc_LB_webform_es.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_pl.gif b/LANG_www/agc/images/vdc_LB_webform_pl.gif deleted file mode 100644 index f2275e8f..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_LB_webform_ptbr.gif b/LANG_www/agc/images/vdc_LB_webform_ptbr.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/LANG_www/agc/images/vdc_LB_webform_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_ammessage.gif b/LANG_www/agc/images/vdc_XB_ammessage.gif deleted file mode 100644 index 484d01eb..00000000 Binary files a/LANG_www/agc/images/vdc_XB_ammessage.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_ammessage_OFF.gif b/LANG_www/agc/images/vdc_XB_ammessage_OFF.gif deleted file mode 100644 index 3aa94800..00000000 Binary files a/LANG_www/agc/images/vdc_XB_ammessage_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer.gif b/LANG_www/agc/images/vdc_XB_blindtransfer.gif deleted file mode 100644 index 77c03e0b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF.gif b/LANG_www/agc/images/vdc_XB_blindtransfer_OFF.gif deleted file mode 100644 index 7fb481ee..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_es.gif b/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_es.gif deleted file mode 100644 index 05adaac5..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif deleted file mode 100644 index 3a069c2b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer_es.gif b/LANG_www/agc/images/vdc_XB_blindtransfer_es.gif deleted file mode 100644 index fdad633a..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_blindtransfer_ptbr.gif b/LANG_www/agc/images/vdc_XB_blindtransfer_ptbr.gif deleted file mode 100644 index c31c87fc..00000000 Binary files a/LANG_www/agc/images/vdc_XB_blindtransfer_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_channel.gif b/LANG_www/agc/images/vdc_XB_channel.gif deleted file mode 100644 index 9a9ce7ba..00000000 Binary files a/LANG_www/agc/images/vdc_XB_channel.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_channel_es.gif b/LANG_www/agc/images/vdc_XB_channel_es.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/LANG_www/agc/images/vdc_XB_channel_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_channel_ptbr.gif b/LANG_www/agc/images/vdc_XB_channel_ptbr.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/LANG_www/agc/images/vdc_XB_channel_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_code.gif b/LANG_www/agc/images/vdc_XB_code.gif deleted file mode 100644 index 8fb2b8c5..00000000 Binary files a/LANG_www/agc/images/vdc_XB_code.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer.gif deleted file mode 100644 index 68697edc..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF.gif deleted file mode 100644 index 8bf2e44b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif deleted file mode 100644 index 7ef98a94..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif deleted file mode 100644 index 1ac7dbbb..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer_es.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer_es.gif deleted file mode 100644 index d71bca15..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_dialwithcustomer_ptbr.gif b/LANG_www/agc/images/vdc_XB_dialwithcustomer_ptbr.gif deleted file mode 100644 index 90ec03f8..00000000 Binary files a/LANG_www/agc/images/vdc_XB_dialwithcustomer_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines.gif deleted file mode 100644 index 4e6db07e..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF.gif deleted file mode 100644 index f1ffdc12..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_es.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_es.gif deleted file mode 100644 index 8f12accd..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif deleted file mode 100644 index 47b87225..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines_es.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines_es.gif deleted file mode 100644 index 646c8769..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupbothlines_ptbr.gif b/LANG_www/agc/images/vdc_XB_hangupbothlines_ptbr.gif deleted file mode 100644 index fa0cf2fb..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupbothlines_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline.gif b/LANG_www/agc/images/vdc_XB_hangupxferline.gif deleted file mode 100644 index d25a105a..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF.gif b/LANG_www/agc/images/vdc_XB_hangupxferline_OFF.gif deleted file mode 100644 index a8fb4a3d..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_es.gif b/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_es.gif deleted file mode 100644 index 3c717d09..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif deleted file mode 100644 index f6d9080b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline_es.gif b/LANG_www/agc/images/vdc_XB_hangupxferline_es.gif deleted file mode 100644 index 0d92a89c..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hangupxferline_ptbr.gif b/LANG_www/agc/images/vdc_XB_hangupxferline_ptbr.gif deleted file mode 100644 index c7d26417..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hangupxferline_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_header.gif b/LANG_www/agc/images/vdc_XB_header.gif deleted file mode 100644 index c813b9a3..00000000 Binary files a/LANG_www/agc/images/vdc_XB_header.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_header_es.gif b/LANG_www/agc/images/vdc_XB_header_es.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/LANG_www/agc/images/vdc_XB_header_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_header_ptbr.gif b/LANG_www/agc/images/vdc_XB_header_ptbr.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/LANG_www/agc/images/vdc_XB_header_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive.gif deleted file mode 100644 index 8382205e..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF.gif deleted file mode 100644 index 3357ed2b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif deleted file mode 100644 index 638ef859..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es.gif deleted file mode 100644 index 5c9a3122..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_pl.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_pl.gif deleted file mode 100644 index 5414a7d8..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif deleted file mode 100644 index 335e6356..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_es.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_es.gif deleted file mode 100644 index b064725c..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_pl.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_pl.gif deleted file mode 100644 index 365d8b2f..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_pl.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysactive_ptbr.gif b/LANG_www/agc/images/vdc_XB_hotkeysactive_ptbr.gif deleted file mode 100644 index a34409c2..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysactive_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_hotkeysinactive_es.gif b/LANG_www/agc/images/vdc_XB_hotkeysinactive_es.gif deleted file mode 100644 index d0bf982c..00000000 Binary files a/LANG_www/agc/images/vdc_XB_hotkeysinactive_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser.gif b/LANG_www/agc/images/vdc_XB_internalcloser.gif deleted file mode 100644 index a1adca76..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser_OFF.gif b/LANG_www/agc/images/vdc_XB_internalcloser_OFF.gif deleted file mode 100644 index 9d3489fa..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser_OFF_es.gif b/LANG_www/agc/images/vdc_XB_internalcloser_OFF_es.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser_es.gif b/LANG_www/agc/images/vdc_XB_internalcloser_es.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_internalcloser_ptbr.gif b/LANG_www/agc/images/vdc_XB_internalcloser_ptbr.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/LANG_www/agc/images/vdc_XB_internalcloser_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall.gif b/LANG_www/agc/images/vdc_XB_leave3waycall.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF.gif b/LANG_www/agc/images/vdc_XB_leave3waycall_OFF.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_es.gif b/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_es.gif deleted file mode 100644 index 9c41a291..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall_es.gif b/LANG_www/agc/images/vdc_XB_leave3waycall_es.gif deleted file mode 100644 index 9aa29708..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_leave3waycall_ptbr.gif b/LANG_www/agc/images/vdc_XB_leave3waycall_ptbr.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/LANG_www/agc/images/vdc_XB_leave3waycall_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser.gif b/LANG_www/agc/images/vdc_XB_localcloser.gif deleted file mode 100644 index 0e10a2ad..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser_OFF.gif b/LANG_www/agc/images/vdc_XB_localcloser_OFF.gif deleted file mode 100644 index ed11b7ac..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser_OFF_es.gif b/LANG_www/agc/images/vdc_XB_localcloser_OFF_es.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_localcloser_OFF_ptbr.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser_es.gif b/LANG_www/agc/images/vdc_XB_localcloser_es.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_localcloser_ptbr.gif b/LANG_www/agc/images/vdc_XB_localcloser_ptbr.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/LANG_www/agc/images/vdc_XB_localcloser_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_number.gif b/LANG_www/agc/images/vdc_XB_number.gif deleted file mode 100644 index 33f30330..00000000 Binary files a/LANG_www/agc/images/vdc_XB_number.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_number_es.gif b/LANG_www/agc/images/vdc_XB_number_es.gif deleted file mode 100644 index 6d672acc..00000000 Binary files a/LANG_www/agc/images/vdc_XB_number_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_number_ptbr.gif b/LANG_www/agc/images/vdc_XB_number_ptbr.gif deleted file mode 100644 index 22e82a58..00000000 Binary files a/LANG_www/agc/images/vdc_XB_number_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial.gif deleted file mode 100644 index 195b1a90..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF.gif deleted file mode 100644 index 7c275732..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif deleted file mode 100644 index ef710c9c..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif deleted file mode 100644 index 72dee5c0..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial_es.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial_es.gif deleted file mode 100644 index accda01c..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_parkcustomerdial_ptbr.gif b/LANG_www/agc/images/vdc_XB_parkcustomerdial_ptbr.gif deleted file mode 100644 index 0101ea9e..00000000 Binary files a/LANG_www/agc/images/vdc_XB_parkcustomerdial_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_seconds.gif b/LANG_www/agc/images/vdc_XB_seconds.gif deleted file mode 100644 index 92fc7f2b..00000000 Binary files a/LANG_www/agc/images/vdc_XB_seconds.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_seconds_es.gif b/LANG_www/agc/images/vdc_XB_seconds_es.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/LANG_www/agc/images/vdc_XB_seconds_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_XB_seconds_ptbr.gif b/LANG_www/agc/images/vdc_XB_seconds_ptbr.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/LANG_www/agc/images/vdc_XB_seconds_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_tab_script.gif b/LANG_www/agc/images/vdc_tab_script.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/LANG_www/agc/images/vdc_tab_script.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_tab_script_es.gif b/LANG_www/agc/images/vdc_tab_script_es.gif deleted file mode 100644 index ba4320d4..00000000 Binary files a/LANG_www/agc/images/vdc_tab_script_es.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_tab_script_ptbr.gif b/LANG_www/agc/images/vdc_tab_script_ptbr.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/LANG_www/agc/images/vdc_tab_script_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_tab_vicidial.gif b/LANG_www/agc/images/vdc_tab_vicidial.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/LANG_www/agc/images/vdc_tab_vicidial.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_tab_vicidial_ptbr.gif b/LANG_www/agc/images/vdc_tab_vicidial_ptbr.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/LANG_www/agc/images/vdc_tab_vicidial_ptbr.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_MUTE.gif b/LANG_www/agc/images/vdc_volume_MUTE.gif deleted file mode 100644 index 1008b7e3..00000000 Binary files a/LANG_www/agc/images/vdc_volume_MUTE.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_UNMUTE.gif b/LANG_www/agc/images/vdc_volume_UNMUTE.gif deleted file mode 100644 index b3937d13..00000000 Binary files a/LANG_www/agc/images/vdc_volume_UNMUTE.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_down.gif b/LANG_www/agc/images/vdc_volume_down.gif deleted file mode 100644 index d1745c65..00000000 Binary files a/LANG_www/agc/images/vdc_volume_down.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_down_off.gif b/LANG_www/agc/images/vdc_volume_down_off.gif deleted file mode 100644 index 9bd1b04f..00000000 Binary files a/LANG_www/agc/images/vdc_volume_down_off.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_up.gif b/LANG_www/agc/images/vdc_volume_up.gif deleted file mode 100644 index 8aa17f19..00000000 Binary files a/LANG_www/agc/images/vdc_volume_up.gif and /dev/null differ diff --git a/LANG_www/agc/images/vdc_volume_up_off.gif b/LANG_www/agc/images/vdc_volume_up_off.gif deleted file mode 100644 index 2e78579a..00000000 Binary files a/LANG_www/agc/images/vdc_volume_up_off.gif and /dev/null differ diff --git a/LANG_www/agc/inbound_popup.php b/LANG_www/agc/inbound_popup.php deleted file mode 100644 index c92583de..00000000 --- a/LANG_www/agc/inbound_popup.php +++ /dev/null @@ -1,351 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1205 - Added variable filters to close security holes for login form -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -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["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.6'; -$build = '60619-1205'; -$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;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc/live_exten_check.php b/LANG_www/agc/live_exten_check.php deleted file mode 100644 index 3dadf572..00000000 --- a/LANG_www/agc/live_exten_check.php +++ /dev/null @@ -1,278 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1203 - Added variable filters to close security holes for login form -# 60825-1029 - Fixed translation variable issue ChannelA -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '2.0.1'; -$build = '60825-1029'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChanneLA[$loop_count] = "$row[0]"; - $ChanneLB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChanneLA[$counter] ~"; - echo "ChannelB: $ChanneLB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChanneLA[$counter] ~"; - echo "ChannelB: $ChanneLB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChanneLA[$counter] ~"; - echo "ChannelB: $ChanneLB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChanneLA[$counter] ~"; - echo "ChannelB: $ChanneLB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChanneLA[$counter] ~"; - echo "ChannelB: $ChanneLB[$counter] ~"; - echo "ChannelBtrunk: $ChanneLA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc/manager_send.php b/LANG_www/agc/manager_send.php deleted file mode 100644 index 94eff7b6..00000000 --- a/LANG_www/agc/manager_send.php +++ /dev/null @@ -1,1142 +0,0 @@ - LICENSE: GPLv2 -# -# 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 -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - -# CHANGELOG: -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1158 - Added variable filters to close security holes for login form -# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers -# 61004-1526 - Added parsing of volume control command and lookup or number -# 61130-1617 - Added lead_id to MonitorConf for recording_log -# 61201-1115 - Added user to MonitorConf for recording_log -# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70226-1251 - Added Mute/UnMute to conference volume control -# 70320-1502 - Added option to allow retry of leave-3way-call and debug logging -# 70322-1636 - Added sipsak display ability -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -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["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} -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["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -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"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$secondS = ereg_replace("[^0-9]","",$secondS); - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '2.0.29'; -$build = '70320-1502'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateVDRelogin") -{ - if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) ) - { - $CIDdate = date("ymdHis"); - $DS='-'; - $SIPSAK_prefix = 'LIN-'; - print "\n"; - passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); - $queryCID = "$SIPSAK_prefix$campaign$DS$CIDdate"; - - } - $ACTION="Originate"; -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtraCX") -{ - $DBout=''; - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); - fclose($fp); - } - } - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0] < 1) - { - $channel_liveY=0; - echo "No Local agent to send call to, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} - } - else - { - $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $dest_server_ip = $rowx[0]; - $dest_session_id = $rowx[1]; - $dest_user = $rowx[2]; - $S='*'; - - $D_s_ip = explode('.', $dest_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]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel on $call_server_ip, Hungup $extrachannel on $server_ip";} - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel on $server_ip";} - } - - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); - } - } - - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); - fclose($fp); - } - } - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";} - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";} - } - else - { - $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]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); - } - } - - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - -###################### -# ACTION=VolumeControl - raise or lower the volume of a meetme participant -###################### -if ($ACTION=="VolumeControl") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($stage)<1) or (strlen($queryCID)<1) ) - { - echo "Conference $exten, Stage $stage is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $participant_number='XXYYXXYYXXYYXX'; - if (eregi('UP',$stage)) {$vol_prefix='4';} - if (eregi('DOWN',$stage)) {$vol_prefix='3';} - if (eregi('UNMUTE',$stage)) {$vol_prefix='2';} - if (eregi('MUTING',$stage)) {$vol_prefix='1';} - $local_DEF = 'Local/'; - $local_AMP = '@'; - $volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Volume command sent for Conference $exten, Stage $stage Channel $channel on $server_ip\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_www/agc/park_calls_display.php b/LANG_www/agc/park_calls_display.php deleted file mode 100644 index 872f5780..00000000 --- a/LANG_www/agc/park_calls_display.php +++ /dev/null @@ -1,146 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1205 - Added variable filters to close security holes for login form -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.4'; -$build = '60619-1205'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc/vdc_db_query.php b/LANG_www/agc/vdc_db_query.php deleted file mode 100644 index 129af642..00000000 --- a/LANG_www/agc/vdc_db_query.php +++ /dev/null @@ -1,2535 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') -# - $omit_phone_code - ('Y','N') -# - $no_delete_sessions - ('0','1') - -# CHANGELOG: -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 60208-1617 - Added dtmf buttons output per call -# 60213-1521 - Added closer_campaigns update to vicidial_users -# 60215-1036 - Added Callback date-time entry into vicidial_callbacks table -# 60413-1541 - Added USERONLY Callback listings output - CalLBacKLisT -# - Added USERONLY Callback count output - CalLBacKCounT -# 60414-1140 - Added Callback lead lookup for manual dialing -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing -# 60821-1647 - Added ability to not delete sessions at logout -# 60906-1124 - Added lookup and sending of callback data for CALLBK calls -# 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries -# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70115-1733 - Added alt_dial functionality in auto-dial modes -# 70118-1501 - Added user_group to vicidial_log,_agent_log,_closer_log,_callbacks -# 70123-1357 - Fixed bug that would not update vicidial_closer_log status to dispo -# 70202-1438 - Added pause code submit function -# 70203-0930 - Added dialed_number to lead info output -# 70203-1030 - Added dialed_label to lead info output -# 70206-1126 - Added INBOUND status for inbound/closer calls in vicidial_live_agents -# 70212-1253 - Fixed small issue with CXFER -# 70213-1431 - Added QueueMetrics PAUSE/UNPAUSE/AGENTLOGIN/AGENTLOGOFF actions -# 70214-1231 - Added queuemetrics_log_id field for server_id in queue_log -# 70215-1210 - Added queuemetrics COMPLETEAGENT action -# 70216-1051 - Fixed double call complete queuemetrics logging -# 70222-1616 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL -# 70309-1034 - Allow amphersands and questions marks in comments to pass through -# 70313-1052 - Allow pound signs(hash) in comments to pass through -# 70319-1544 - Added agent disable update customer data function -# 70322-1545 - Added sipsak display ability -# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns -# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records -# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling -# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM -# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns -# 71030-2047 - added hopper priority for auto alt dial entries -# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL -# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login -# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php -# 71129-2025 - restricted callbacks count and list to campaign only -# - -$version = '2.0.4-65'; -$build = '71129-2025'; - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -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["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -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["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -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["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["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["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["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -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["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -$ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; -$agents='@agents'; - -if ($ACTION == 'LogiNCamPaigns') - { - $skip_user_validation=1; - } -else - { - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - -################################################################################ -### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a -### specific agent on the login screen -################################################################################ -if ($ACTION == 'LogiNCamPaigns') -{ - if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } - else - { - echo "\n"; - exit; - } -} - - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $in_groups_pre = preg_replace('/-$/','',$closer_choice); - $in_groups = explode(" ",$in_groups_pre); - $in_groups_ct = count($in_groups); - $k=1; - while ($k < $in_groups_ct) - { - if (strlen($in_groups[$k])>1) - { - $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $viga_ct = mysql_num_rows($rslt); - if ($viga_ct > 0) - { - $row=mysql_fetch_row($rslt); - $group_weight = $row[0]; - $calls_today = $row[1]; - } - else - { - $group_weight = 0; - $calls_today = 0; - } - $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - $k++; - } - - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - - ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vla_cc_ct = mysql_num_rows($rslt); - if ($vla_cc_ct > 0) - { - $row=mysql_fetch_row($rslt); - $calls_today =$row[0]; - } - else - {$calls_today ='0';} - $calls_today++; - - ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE - if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) - { - $affected_rows=1; - $CBleadIDset=1; - - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - if (strlen($phone_number)>3) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMBER\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $lead_id = mysql_insert_id($link); - $CBleadIDset=1; - } - } - else - { - ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $lead_id = mysql_insert_id($link); - $CBleadIDset=1; - } - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - } - } - - if ($affected_rows > 0) - { - if (!$CBleadIDset) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $source_id = trim("$row[6]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ##### check if system is set to generate logfile for transfers - $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $enable_agc_xfer_log_ct = mysql_num_rows($rslt); - if ($enable_agc_xfer_log_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_agc_xfer_log =$row[0]; - } - - if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) - { - # DATETIME|campaign|lead_id|phone_number|user|type - # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M - $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); - fclose($fp); - } - - ##### if lead is a callback, grab the callback comments - $CBentry_time = ''; - $CBcallback_time = ''; - $CBuser = ''; - $CBcomments = ''; - if (ereg("CALLBK",$dispo)) - { - $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $cb_record_ct = mysql_num_rows($rslt); - if ($cb_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $CBentry_time = trim("$row[0]"); - $CBcallback_time = trim("$row[1]"); - $CBuser = trim("$row[2]"); - $CBcomments = trim("$row[3]"); - } - } - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (!$CBleadIDset) - { - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### whether to omit phone_code or not - if (eregi('Y',$omit_phone_code)) - {$Ndialstring = "$Local_out_prefix$phone_number";} - else - {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update calls_today count in vicidial_campaign_agents - $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - $LeaD_InfO .= $CBentry_time . "\n"; - $LeaD_InfO .= $CBcallback_time . "\n"; - $LeaD_InfO .= $CBuser . "\n"; - $LeaD_InfO .= $CBcomments . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= "MAIN\n"; - $LeaD_InfO .= $source_id . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo " CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vla_cc_ct = mysql_num_rows($rslt); - if ($vla_cc_ct > 0) - { - $row=mysql_fetch_row($rslt); - $calls_today =$row[0]; - } - else - {$calls_today ='0';} - $calls_today++; - - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### whether to omit phone_code or not - if (eregi('Y',$omit_phone_code)) - {$Ndialstring = "$Local_out_prefix$phone_number";} - else - {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; - } - else - { - ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) - { - ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - 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;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $i++; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - - if ($auto_dial_level > 0) - { - ### check to see if campaign has alt_dial enabled - $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $auto_alt_dial =$row[0]; - } - else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) - { - ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} - - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) - { - $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_phone = $row[0]; - $alt_phone = eregi_replace("[^0-9]","",$alt_phone); - $gmt_offset_now = $row[1]; - $state = $row[2]; - } - else {$alt_phone = '';} - if (strlen($alt_phone)>5) - { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - } - if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) - { - $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $address3 = $row[0]; - $address3 = eregi_replace("[^0-9]","",$address3); - $gmt_offset_now = $row[1]; - $state = $row[2]; - } - else {$address3 = '';} - if (strlen($address3)>5) - { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - - if ($enable_queuemetrics_logging > 0) - { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_qm_ct = mysql_num_rows($rslt); - if ($VAC_qm_ct > 0) - { - $row=mysql_fetch_row($rslt); - $auto_call_id = $row[0]; - $CLlead_id = $row[1]; - $CLphone_number = $row[2]; - $CLstatus = $row[3]; - $CLcampaign_id = $row[4]; - $CLphone_code = $row[5]; - $CLalt_dial = $row[6]; - $CLstage = $row[7]; - $CLcallerid = $row[8]; - $CLuniqueid = $row[9]; - } - - $CLstage = preg_replace("/.*-/",'',$CLstage); - if (strlen($CLstage) < 1) {$CLstage=0;} - - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; - $rslt=mysql_query($stmt, $linkB); - if ($DB) {echo "$stmt\n";} - $VAC_cc_ct = mysql_num_rows($rslt); - if ($VAC_cc_ct > 0) - { - $row=mysql_fetch_row($rslt); - $caller_complete = $row[0]; - } - - if ($caller_complete < 1) - { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - } - mysql_close($linkB); - } - - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - if ($affected_rows > 0) - { - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - } - } - else - { - if ($enable_queuemetrics_logging > 0) - { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_qm_ct = mysql_num_rows($rslt); - if ($VAC_qm_ct > 0) - { - $row=mysql_fetch_row($rslt); - $auto_call_id = $row[0]; - $CLlead_id = $row[1]; - $CLphone_number = $row[2]; - $CLstatus = $row[3]; - $CLcampaign_id = $row[4]; - $CLphone_code = $row[5]; - $CLalt_dial = $row[6]; - $CLstage = $row[7]; - $CLcallerid = $row[8]; - $CLuniqueid = $row[9]; - } - - $CLstage = preg_replace("/XFER|-/",'',$CLstage); - if ($CLstage < 0.25) {$CLstage=0;} - - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - if ($affected_rows > 0) - { - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - } - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for -### calls to see if the channel has updated -################################################################################ -if ($ACTION == 'VDADREcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - echo "lead_id $lead_id is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - } - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $Ctype = 'A'; - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vla_cc_ct = mysql_num_rows($rslt); - if ($vla_cc_ct > 0) - { - $row=mysql_fetch_row($rslt); - $calls_today =$row[0]; - } - else - {$calls_today ='0';} - $calls_today++; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $source_id = trim("$row[6]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ##### if lead is a callback, grab the callback comments - $CBentry_time = ''; - $CBcallback_time = ''; - $CBuser = ''; - $CBcomments = ''; - if (ereg("CALLBK",$dispo)) - { - $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $cb_record_ct = mysql_num_rows($rslt); - if ($cb_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $CBentry_time = trim("$row[0]"); - $CBcallback_time = trim("$row[1]"); - $CBuser = trim("$row[2]"); - $CBcomments = trim("$row[3]"); - } - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; - } - else - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - - $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dialed_number =$row[0]; - $dialed_label =$row[1]; - } - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - $LeaD_InfO .= $CBentry_time . "\n"; - $LeaD_InfO .= $CBcallback_time . "\n"; - $LeaD_InfO .= $CBuser . "\n"; - $LeaD_InfO .= $CBcomments . "\n"; - $LeaD_InfO .= $dialed_number . "\n"; - $LeaD_InfO .= $dialed_label . "\n"; - $LeaD_InfO .= $source_id . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CALLBK, change vicidial_callback record to INACTIVE - if (eregi("CALLBK|CBHOLD", $dispo)) - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### check if system is set to generate logfile for transfers - $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $enable_agc_xfer_log_ct = mysql_num_rows($rslt); - if ($enable_agc_xfer_log_ct > 0) - { - $row=mysql_fetch_row($rslt); - $enable_agc_xfer_log =$row[0]; - } - - if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) - { - # DATETIME|campaign|lead_id|phone_number|user|type - # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A - $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); - fclose($fp); - } - - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - if ($no_delete_sessions < 1) - { - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - } - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the vicidial_live_inbound_agents records for this session - $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vlia_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $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); - $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 ($vla_delete > 0) - { - ############################################# - ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $allow_sipsak_messages = $row[6]; - $i++; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) ) - { - $SIPSAK_message = 'LOGGED OUT'; - passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_message\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); - } - - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; - # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - # $rslt=mysql_query($stmt, $linkB); - # $affected_rows = mysql_affected_rows($linkB); - - $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; - $li_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $li_conf_ct) - { - $row=mysql_fetch_row($rslt); - $logintime = $row[0]; - $i++; - } - - $time_logged_in = ($StarTtime - $logintime); - if ($time_logged_in > 1000000) {$time_logged_in=1;} - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) - { - $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; - if ($format=='debug') {echo "\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;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $i++; - } - ##### 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); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - $DO_NOT_UPDATE=0; - $DO_NOT_UPDATE_text=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $dac_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $dac_conf_ct) - { - $row=mysql_fetch_row($rslt); - $disable_alter_custdata = $row[0]; - $i++; - } - if (ereg('Y',$disable_alter_custdata)) - { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $aco_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $aco_conf_ct) - { - $row=mysql_fetch_row($rslt); - $alter_custdata_override = $row[0]; - $i++; - } - if (ereg('ALLOW_ALTER',$alter_custdata_override)) - { - $DO_NOT_UPDATE=0; - $DO_NOT_UPDATE_text=''; - } - } - - if ($DO_NOT_UPDATE < 1) - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - $comments = eregi_replace("--AMP--",'&',$comments); - $comments = eregi_replace("--QUES--",'?',$comments); - $comments = eregi_replace("--POUND--",'#',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - if ($affected_rows > 0) - { - ############################################# - ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $i++; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - if ($enable_queuemetrics_logging > 0) - { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - } - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - - } - if ($ACTION == 'VDADready') - { - $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### PauseCodeSubmit - Update vicidial_agent_log with pause code -################################################################################ -if ($ACTION == 'PauseCodeSubmit') -{ - $row=''; $rowx=''; - if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) - { - echo "agent_log_id $agent_log_id or pause_code $status is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - if ($affected_rows > 0) - { - ############################################# - ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $allow_sipsak_messages = $row[6]; - $i++; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) ) - { - $SIPSAK_prefix = 'BK-'; - passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$status\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); - } - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); - } - } - } -echo "Pause Code has been updated to $status for $agent_log_id\n"; -} - - -################################################################################ -### CalLBacKLisT - List the USERONLY callbacks for an agent -################################################################################ -if ($ACTION == 'CalLBacKLisT') -{ -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; -if ($DB) {echo "$stmt\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} -echo "$callbacks_count\n"; -$loop_count=0; - while ($callbacks_count>$loop_count) - { - $row=mysql_fetch_row($rslt); - $callback_id[$loop_count] = $row[0]; - $lead_id[$loop_count] = $row[1]; - $campaign_id[$loop_count] = $row[2]; - $status[$loop_count] = $row[3]; - $entry_time[$loop_count] = $row[4]; - $callback_time[$loop_count] = $row[5]; - $comments[$loop_count] = $row[6]; - $loop_count++; - } -$loop_count=0; - while ($callbacks_count>$loop_count) - { - $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; - $loop_count++; - } - -} - - -################################################################################ -### CalLBacKCounT - send the count of the USERONLY callbacks for an agent -################################################################################ -if ($ACTION == 'CalLBacKCounT') -{ -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; -if ($DB) {echo "$stmt\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$cbcount=$row[0]; - -echo "$cbcount"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_www/agc/vicidial.php b/LANG_www/agc/vicidial.php deleted file mode 100644 index ccd81ed1..00000000 --- a/LANG_www/agc/vicidial.php +++ /dev/null @@ -1,6797 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGELOG -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 60214-0932 - Initial Callback calendar display framework -# 60214-1407 - Added ability to minimize the dispo screen to see info below -# 60215-1104 - Added ANYONE scheduled callbacks functionality -# 60410-1116 - Added persistant pause after dispo option and change dispo text -# - Added web form submit that opens new window with dispo on submit -# - Added PREVIOUS CALLBACK in customer info to flag callbacks -# - Added link to try to hangup the call again in the dispo screen -# - Added link noone-in-session screen to call agent phone again -# - Added link customer-hungup screen to go straight to dispo screen -# 60410-1532 - Added agent status and campaign calls dialing display option -# 60411-1547 - Add ability to set callback as USERONLY and some basic formatting -# 60413-1752 - Add basic USERONLY callback frame and listings -# 60414-1039 - Changed manual dial preview and alt dial checkboxes to spans -# - Added beta-level USERONLY callback functionality -# - Added beta-level manual dialing with lead insertion functionality -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# 60804-1710 - fixed scheduled CALLBK for other languages build -# 60808-1145 - Added consultative transfers with customer data -# 60808-2232 - Added campaign name to pulldown for login screen -# 60809-1603 - Added option to locally transfer consult xfers -# 60809-1732 - Added recheck of transferred channels before customer gone mesg -# 60810-1011 - Fixed CXFER leave 3way call bugs -# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay -# 60816-1716 - Fixed customer time display bug and client DST setting -# 60821-1555 - Added option to omit phone_code on dialout of leads -# 60821-1628 - Added ALLFORCE recording option -# 60821-1643 - Added no_delete_sessions option to not delete sessions -# 60822-0512 - Changed phone number fields to be maxlength of 12 -# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php -# 60906-1152 - Added Previous CallBack info display span -# 60906-1715 - Allow for Local phone extension conferences -# 61004-1729 - Add ability to control volume per channel in "calls in this session" -# 61122-1341 - Added vicidial_user_groups allowed_campaigns restrictions -# 61122-1523 - Added more SCRIPT variables -# 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries -# 61130-1617 - Added lead_id to MonitorConf for recording_log -# 61221-1212 - Changed width to 760 to better fit 800x600 screens, widened SCRIPT -# 70109-1128 - Fixed wrapup timer bug -# 70109-1635 - Added option for HotKeys automatically dialing next number in manual mode -# - Added option for alternate number dialing with hotkeys -# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group -# 70201-1249 - Added FAST DIAL option for manually dialing, added UTF8 compatible code -# 70201-1703 - Fixed cursor bug for most text input fields -# 70202-1453 - Added first portions of Agent Pause Codes -# 70203-0108 - Finished Agent Pause Codes functionality -# 70203-0930 - Added dialed_number to webform output -# 70203-1010 - Added dialed_label to webform output -# 70206-1201 - Fixed allow_closers bug -# 70206-1332 - Added vicidial_recording_override users setting function -# 70212-1252 - Fixed small issue with CXFER -# 70213-1018 - Changed CXFER and AXFER to update customer information before transfer -# 70214-1233 - Added queuemetrics_log_id field for server_id in queue_log -# 70215-1240 - Added queuemetrics_log_id field for server_id in queue_log -# 70222-1617 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL -# 70226-1252 - Added Mute/UnMute to agent screen -# 70309-1035 - Allow amphersands and questions marks in comments to pass through -# 70313-1052 - Allow pound signs(hash) in comments to pass through -# 70316-1406 - Moved the MUTE button to be accessible during a transfer/conf -# 70319-1446 - Added agent-deactive-display and disable customer info update functions -# 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper -# 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen -# 70322-1545 - Added sipsak display ability -# 70510-1319 - Added onUnload force Logout -# 70806-1530 - Added Presets Dial links above agent mute button -# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE -# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM -# 71022-1427 - Added formatting of the customer phone number in the main status bar -# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions -# 71101-1204 - Fixed bug in callback calendar with DST -# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion -# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login -# 71122-0256 - Added auto-pause notification -# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to -# 71127-0408 - Added height and width settings for easier modification of screen size -# 71129-2025 - restricted callbacks count and list to campaign only -# - -$version = '2.0.4-142'; -$build = '71129-2025'; - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); - - -$forever_stop=0; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$isdst = date("I"); -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_preview = '1'; # allow preview lead option when manual dial -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats -$show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown -$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL -$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server -$clientDST = '1'; # set to 1 to check for DST on server for agent time -$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout -$volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups -$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 -$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks -# $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks -#$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session - -### SCREEN WIDTH AND HEIGHT CALCULATIONS ### -### DO NOT EDIT! ### -$MASTERwidth=($BROWSER_WIDTH - 340); -$MASTERheight=($BROWSER_HEIGHT - 200); -if ($MASTERwidth < 430) {$MASTERwidth = '430';} -if ($MASTERheight < 300) {$MASTERheight = '300';} - -$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) -$MNwidth = ($MASTERwidth + 330); # 760 - main frame -$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference -$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks -$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links -$SSwidth = ($MASTERwidth + 176); # 606 - scroll script -$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session -$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button -$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer - -$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button -$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links -$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons -$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status -$SSheight = ($MASTERheight + 31); # 331 - script content -$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey -$BPheight = ($MASTERheight - 250); # 50 - bottom buffer - - -$US='_'; -$CL=':'; -$AT='@'; -$DS='-'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$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://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -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 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - -if ($LogiNAJAX > 0) -{ -?> - - - -VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code
  \n"; - echo "

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - 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); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code
  \n"; - echo "

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:
  \n"; -echo "

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./vicidial_auth_entries.txt", "a");} -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - 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($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns =$row[0]; - - if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, you are not allowed to login to this campaign: $VD_campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "   \n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' 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); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_seconds = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; - $campaign_allow_inbound = $row[29]; - $manual_dial_list_id = $row[30]; - $default_xfer_group = $row[31]; - $xfer_groups = $row[32]; - - if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) - { - $campaign_recording = $VU_vicidial_recording_override; - print "\n"; - } - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - if ($agent_pause_codes_active=='Y') - { - ##### grab the pause codes for this campaign - $stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 50;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_pause_codes = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_pause_codes) - { - $row=mysql_fetch_row($rslt); - $pause_codes[$i] =$row[0]; - $pause_code_names[$i] =$row[1]; - $VARpause_codes = "$VARpause_codes'$pause_codes[$i]',"; - $VARpause_code_names = "$VARpause_code_names'$pause_code_names[$i]',"; - $i++; - $j++; - } - $VD_pause_codes_ct = ($VD_pause_codes_ct+$VD_pause_codes); - $VARpause_codes = substr("$VARpause_codes", 0, -1); - $VARpause_code_names = substr("$VARpause_code_names", 0, -1); - } - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if ($campaign_allow_inbound == 'Y') - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 60;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the allowable inbound groups to choose from for transfer options - $xfer_groups = preg_replace("/^ | -$/","",$xfer_groups); - $xfer_groups = preg_replace("/ /","','",$xfer_groups); - $xfer_groups = "'$xfer_groups'"; - $VARxfergroups="''"; - if ($allow_closers == 'Y') - { - $VARxfergroups=''; - $stmt="select group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) order by group_id limit 60;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $xfer_ct = mysql_num_rows($rslt); - $XFgrpCT=0; - while ($XFgrpCT < $xfer_ct) - { - $row=mysql_fetch_row($rslt); - $VARxfergroups = "$VARxfergroups'$row[0]',"; - $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; - if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} - $XFgrpCT++; - } - $VARxfergroups = substr("$VARxfergroups", 0, -1); - $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - } - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code
  \n"; - echo "

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' 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); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' 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); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $enable_sipsak_messages=$row[66]; - - if ($clientDST) - { - $local_gmt = ($local_gmt + $isdst); - } - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - 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); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - if ($webform_sessionname) - {$webform_sessionname = "&session_name=$session_name";} - else - {$webform_sessionname = '';} - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - - if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; - if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### set the callerID for manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - - ############################################# - ##### START SYSTEM_SETTINGS LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $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); - $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]; - $vicidial_agent_disable = $row[6]; - $allow_sipsak_messages = $row[7]; - $i++; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - - if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) ) - { - $SIPSAK_prefix = 'LIN-'; - print "\n"; - passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); - $SIqueryCID = "$SIPSAK_prefix$VD_campaign$DS$CIDdate"; - } - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - ##### grab the campaign_weight and number of calls today on that campaign for the agent - $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vca_ct = mysql_num_rows($rslt); - if ($vca_ct > 0) - { - $row=mysql_fetch_row($rslt); - $campaign_weight = $row[0]; - $calls_today = $row[1]; - $i++; - } - else - { - $campaign_weight = '0'; - $calls_today = '0'; - $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - } - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - print "\n"; - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - print "\n"; - - mysql_close($linkB); - mysql_select_db("$VARDB_database", $link); - } - - - if ($campaign_allow_inbound == 'Y') - { - print "\n"; - } - } - else - { - print "\n"; - - $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($enable_queuemetrics_logging > 0) - { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - print "\n"; - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); - print "\n"; - - mysql_close($linkB); - mysql_select_db("$VARDB_database", $link); - } - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "   \n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "   \n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - if (ereg('MSIE',$browser)) - { - $useIE=1; - print "\n"; - } - else - { - $useIE=0; - print "\n"; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN');"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); - print "\n"; - - $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]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - -\n"; - - -?> - -
- - MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT> -
- - - -LOGOUT\n"; ?> -
-
- - - height=30> - - - - - -
VICIDIALSCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     session ID: Live Call
-
- - - - - height=>

VICIDIAL
-
- - -MANUAL DIAL       FAST DIAL
-
- - -X ACTIVE CALLBACKS
-
- - -
-
- - - D1 - DIAL\n"; - echo "
\n"; - echo "D2 - DIAL\n"; - } - else {echo "
\n";} - ?> -

-
-
- - - height=460>
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list. -
-
-
  - Refresh -                 - Go Back -
-
- - - height=460>
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call. -
- \n"; - } - ?> - Note: all new manual dial leads will go into list

- - - - - - - - - - - - - - - -
Dial Code:   (This is usually a 1 in the USA-Canada)
Phone Number: -   (12 digits max - digits only) -
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.
 
Dial Override:   (digits only please) -
-
- Dial Now -                 - Go Back -
-
- - - -
-
- - - - -Your Status:
Calls Dialing: -
- - - - - > - -
-
- - Transfer - Conference
- - - LOCAL CLOSER - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - - DIAL OVERRIDE   - LEAVE 3-WAY CALL - Dial Blind Transfer - D1 - D2 - -
- - seconds   - channel - Dial With Customer - Park Customer Dial - Blind Transfer VMail Message -
-
-
-
- - - - height=70> - -
Lead Dispositioned As:

- -
-
-
- - - height=70> - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - - height=70> - - - - - - -
Previous Callback Information: close
-
-
-
-
- -
-
- - - height=500>
Noone is in your session:
- Go Back -

- Call Agent Again -
-
- - - height=500>
Customer has hung up:
- Go Back -

- Finish and Disposition Call - -
-
- - - height=550>
Call Wrapup: seconds remaining in wrapup

- -

- Finish Wrapup and Move On - -
-
- - - height=500>
Your session has been disabled
LOGOUT

Go Back -
-
- - - height=500>

LOGOUT
-
- - -
-
- - -
 
-
- - - height=47>
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.
-
- - - height=460>
DISPOSITION CALL :       Hangup Again       minimize
- End-of-call Disposition Selection -
- PAUSE AGENT DIALING
- CLEAR FORM | - SUBMIT -

- WEB FORM SUBMIT -

  -
-
- - - height=460>
SELECT A PAUSE CODE :
- Pause Code Selection - -

  -
-
- - - height=460>
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- MY CALLBACK ONLY
";} - ?> - CB Comments:

- - SUBMIT

- -

  -
-
- - - height=460>
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - Channel - Channel - MY CALLBACK ONLY
";} - ?> -
- - - - height=>
VICIDIAL SCRIPT
-
- - - 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - - - - -> - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information

 
-
- - - -
-
- - - - - id="MainTable"> - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
- ALT PHONE DIAL
- - -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-
Send DTMF

-
-
-
align=left valign=top> - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments: - -\n";} -else - {echo "\n";} -?> - -
-
- -
-
> - 
- - - - - - - - - - - - diff --git a/LANG_www/agc/voicemail_check.php b/LANG_www/agc/voicemail_check.php deleted file mode 100644 index 0aa152d7..00000000 --- a/LANG_www/agc/voicemail_check.php +++ /dev/null @@ -1,140 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1204 - Added variable filters to close security holes for login form -# - -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["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60619-1204'; -$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='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_www/agc_br/active_list_refresh.php b/LANG_www/agc_br/active_list_refresh.php index 61d75d5d..c6d99af6 100644 --- a/LANG_www/agc_br/active_list_refresh.php +++ b/LANG_www/agc_br/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_br/astguiclient.php b/LANG_www/agc_br/astguiclient.php index 1fe0f403..62f2bb66 100644 --- a/LANG_www/agc_br/astguiclient.php +++ b/LANG_www/agc_br/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -185,7 +185,7 @@ echo " 0) { - fwrite ($fp, "VICIDISCAR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICIDISCAR|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + "" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DISCAR"; + out_log_HTML = out_log_HTML + "" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL"; } out_log_HTML = out_log_HTML + ""; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DISCAR"; + in_log_HTML = in_log_HTML + "" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL"; } in_log_HTML = in_log_HTML + ""; @@ -2794,7 +2794,7 @@ echo "\n"; -CAIXA POSTAL     NOVO:     VELHO:             DISCAGEM MANUAL       DISCAR +CAIXA POSTAL     NOVO:     VELHO:             DISCAGEM MANUAL       DIAL CHAMADAS EM ESPERA: 0                DISCAR A EXTENSÃO LOCAL @@ -2837,7 +2837,7 @@ echo "\n"; \n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-PAUSAR | INICIAR     Atualizar a taxa: 1000 ms Mais rápido | Mais devagar

+BATENTE | INICIAR     Atualizar a taxa: 1000 ms Mais rápido | Mais devagar

Inicializando..
Extensões Ativas
diff --git a/LANG_www/agc_br/call_log_display.php b/LANG_www/agc_br/call_log_display.php index abbaabeb..a545165b 100644 --- a/LANG_www/agc_br/call_log_display.php +++ b/LANG_www/agc_br/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_br/conf_exten_check.php b/LANG_www/agc_br/conf_exten_check.php index eee0f698..7c8a8328 100644 --- a/LANG_www/agc_br/conf_exten_check.php +++ b/LANG_www/agc_br/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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";} + + ### 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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|INICIAR",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_SAIR';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_br/inbound_popup.php b/LANG_www/agc_br/inbound_popup.php index d75c9b5b..bd74a2a1 100644 --- a/LANG_www/agc_br/inbound_popup.php +++ b/LANG_www/agc_br/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Número Discado: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Notas:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "DESLIGAR - \n"; echo "ENVIAR PARA MINHA CAIXA POSTAL\n"; diff --git a/LANG_www/agc_br/live_exten_check.php b/LANG_www/agc_br/live_exten_check.php index 7e9fcba6..79649279 100644 --- a/LANG_www/agc_br/live_exten_check.php +++ b/LANG_www/agc_br/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_br/manager_send.php b/LANG_www/agc_br/manager_send.php index de1bac2b..2f8f8d65 100644 --- a/LANG_www/agc_br/manager_send.php +++ b/LANG_www/agc_br/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate comando enviado para Exten $exten Canal $channelligado$server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado para Exten $exten Canal $channelligado$server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate comando enviado para Exten $exten Canal $channelligado$server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Canal $channel não é válido or queryCID $queryCID não é válido, Hangup comando não inserido\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel não está ativoligado$call_server_ip, Checking Live Canal...\n"; + { + echo "Call $CalLCID $channel não está ativoligado$call_server_ip, Checking Live Canal...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Canal $channel não está ativoligado$call_server_ip, Hangup comando não inserido $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Canal $channel não está ativoligado$call_server_ip, Hangup comando não inserido $rowx[0]\n$stmt\n"; + echo "Canal $channel in use by another agentligado$call_server_ip, Hangup comando não inserido $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando enviado para Canal $channelligado$call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### INICIAR 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup comando enviado para Canal $channelligado$call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma dessas variáveis não é válido:\n"; + echo "Canal $channel Deve ser maior que 2 caracteres\n"; + echo "ExtraCanal $extrachannel Deve ser maior que 2 caracteres\n"; + echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; + echo "exten $exten Deve ser definido\n"; + echo "ext_context $ext_context Deve ser definido\n"; + echo "ext_priority $ext_priority Deve ser definido\n"; + echo "\nRedirect Action não enviado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conferenceligado$server_ip, Redirect comando não inserido\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Não foi possível achar uma conferência vazialigado$server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel não está ativoligado$call_server_ip, Redirect comando não inserido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está ativoligado$call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel não está ativoligado$server_ip, Redirect comando não inserido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está ativoligado$server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando não inserido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX comando enviado para Canal $channelligado$call_server_ip and \nHungup $extrachannelligado$server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channelligado$call_server_ip, Hungup $extrachannelligado$server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channelligado$server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma dessas variáveis não é válido:\n"; + echo "Canal $channel Deve ser maior que 2 caracteres\n"; + echo "ExtraCanal $extrachannel Deve ser maior que 2 caracteres\n"; + echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; + echo "exten $exten Deve ser definido\n"; + echo "ext_context $ext_context Deve ser definido\n"; + echo "ext_priority $ext_priority Deve ser definido\n"; + echo "session_id $session_id Deve ser definido\n"; + echo "\nRedirect Action não enviado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conferenceligado$server_ip, Redirect comando não inserido\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Não foi possível achar uma conferência vazialigado$server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel não está ativoligado$call_server_ip, Redirect comando não inserido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está ativoligado$call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel não está ativoligado$server_ip, Redirect comando não inserido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está ativoligado$server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando enviado para Canal $channel and \nExtraCanal $extrachannel\n to $extenligado$server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $extenligado$server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando enviado para Canal $channelligado$call_server_ip and \nExtraCanal $extrachannel\n to $extenligado$server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect comando enviado para Canal $channelligado$server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings goingligadoin this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_br/park_calls_display.php b/LANG_www/agc_br/park_calls_display.php index d9682d85..160aff50 100644 --- a/LANG_www/agc_br/park_calls_display.php +++ b/LANG_www/agc_br/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_br/timeclock.php b/LANG_www/agc_br/timeclock.php new file mode 100644 index 00000000..1fd15a5e --- /dev/null +++ b/LANG_www/agc_br/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + 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:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login do Usuário:
Senha do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='INICIAR', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='INICIAR'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'INICIAR') ) + { + ### 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"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login do Usuário:
Senha do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOSAIR') or ($status=='INICIAR') or ($status=='SAIR') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + 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"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='SAIR', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='SAIR', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='SAIR', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOSAIR') or ($status=='INICIAR') or ($status=='SAIR') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERRO: timeclock entrada do log já realizados:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "BACK TO Agent Login Screen";} + if ($referrer=='admin') + {$BACKlink = "Retornar para Administração";} + if ($referrer=='welcome') + {$BACKlink = "ANTERIOR a tela Bem-vindo";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOSAIR') or ($status=='INICIAR') or ($status=='SAIR') ) + { + $VDdisplayMESSAGE = "Vez desde que foi registrado em:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Você última autenticado-out em:$last_action_date

LOGIN Clique abaixo para log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Quantidade de tempo que tem sido registrado em:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'SAIR'; + $LOGtimeMESSAGE = "Você autenticado-nos em: $last_action_date
Quantidade de tempo que tem sido registrado em:$totTIME_HMS

SAIR Clique abaixo para log-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login do Usuário:
Senha do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_br/vdc_db_query.php b/LANG_www/agc_br/vdc_db_query.php index bea93986..57c2e6ae 100644 --- a/LANG_www/agc_br/vdc_db_query.php +++ b/LANG_www/agc_br/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Senha:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NUMERO\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NUMERO NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### INICIAR 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + 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 "$phone_number $stage $lead_id or $called_count não é válido\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage não é válido\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### INICIAR 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "REGISTRO NÃO DEFINIDO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign não é válido\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "REGISTRO NÃO DEFINIDO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id não é válido\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### INICIAR QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSARALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSARALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Inserido: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "REGISTRO NÃO DEFINIDO\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "REGISTRO NÃO DEFINIDO\n\n"; + } } else { - echo "REGISTRO NÃO DEFINIDO\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_BATENTE|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|REGISTRO_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then sendligadoto vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then sendligadoto vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If CHAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','SAIR','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### INICIAR QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1998,15 +3237,15 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSAR',serverid='1';"; + # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### CHAMADABACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### INICIAR QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### INICIAR QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('PAUSAR',$stage)) {$QMstatus='PAUSARALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} + if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' está agora com o status ' . $stage . "\n"; + echo 'Agent ' . $user . ' está agora com o status ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2405,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'PausaCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -2418,14 +3809,15 @@ if ($ACTION == 'PausaCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### INICIAR QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2453,17 +3845,17 @@ if ($ACTION == 'PausaCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSARREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pausa Code has been updated to $status for $agent_log_id\n"; +echo " Pausa Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_br/vicidial.php b/LANG_www/agc_br/vicidial.php index 20997130..cb2d5c17 100644 --- a/LANG_www/agc_br/vicidial.php +++ b/LANG_www/agc_br/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show callsligadohold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of segundos for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign nameligadologin pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DSTligadoserver for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DISCAR link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a DISCAR link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookupsligadocampaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Desligar Cliente +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TelefoneSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT DISCAR by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call segundos counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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';"; + 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,15 +582,16 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "VICIDISCAR web client: Re-Login\n"; +echo "VICIDIAL web client: Re-Login\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Re-Login
Senha do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; +echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "VICIDISCAR web client: Login da Campanha\n"; + echo "VICIDIAL web client: Login da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Login do Usuário

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,23 +656,24 @@ echo "
Login da Campanha
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "VICIDISCAR web client: Login\n"; + echo "VICIDIAL web client: Login\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -553,15 +703,16 @@ echo "
Login
VICIDISCAR web client: Login do Telefone\n"; +echo "VICIDIAL web client: Login do Telefone\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('SAIR',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "É necessário efetuar login AO PRIMEIRO TIMECLOCK
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("INICIAR|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("INICIAR|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=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
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + 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
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

GERENTE Override:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Senha:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; + echo "VICIDIAL web client: VICIDIAL Login da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Login do Telefone
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "VICIDISCAR web client: Login da Campanha\n"; + echo "VICIDIAL web client: Login da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Login da Campanha
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "VICIDISCAR web client: Login do Telefone Error\n"; + echo "VICIDIAL web client: Login do Telefone Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Login Error
VICIDISCAR web client\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "VICIDIAL web client\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TelefoneSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TelefoneSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### INICIAR SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls todayligadothat campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,19 +1768,19 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSARALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,17 +1810,17 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSARALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1333,9 +1829,10 @@ else } else { - echo "VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; + echo "VICIDIAL web client: VICIDIAL Login da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -1356,9 +1853,10 @@ echo "
VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; + echo "VICIDIAL web client: VICIDIAL Login da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_segundos = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1808,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var PausaCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -1819,14 +2351,43 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Pausa\"\"Início\""; - var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Início\""; - var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Início\""; - var DiaLControl_manual_HTML = "\"Discar"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Início\""; + var DiaLControl_auto_HTML_ready = "\"\"Início\""; + var DiaLControl_auto_HTML_OFF = "\"\"Início\""; + var DiaLControl_manual_HTML = "\"Discar"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and passligadoto originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Discar"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Colocar"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'CUSTOMIZADOER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_SAIR') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Status: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pauseligadonext dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focusligadovicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section workingligadoAPI functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "LIGAÇÕES ATIVAS NA SUA SESSÃO:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#CANAL REMOTODESLIGARVOLUME
" + loop_ct + "" + channelfieldA + "DESLIGAR
" + loop_ct + "" + channelfieldA + "DESLIGAR
" + loop_ct + "" + channelfieldA + "DESLIGAR          
" + loop_ct + "" + channelfieldA + "DESLIGAR          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Parar"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Inicia"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, ESPERA, FROMESPERA, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Pegar"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Colocar"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Discar proximo número"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICIDISCAR Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2956,7 +3832,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/TIMENUMERONAMESTATUSCAMPAIGNLAST DATA/HORA DA CHAMADA COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + 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"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + CIDcheck + "   Aguardando Atender... " + MD_ring_secondS + " segundos"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + CIDcheck + "   Aguardando Atender... " + MD_ring_secondS + " segundos"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Ligado: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3240,7 +4154,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICIDISCAR_LOG ENTRY FOR THIS CHAMADA PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Discar proximo número request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Discar"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Discar"; + } if (document.vicidial_form.LeadPreview.checked==true) { 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 CONTATO or IGNORAR CONTATO"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "LISTA DE DISCAGEM VAZIA") || (MDnextCID == "DNC NUMERO") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "LISTA DE DISCAGEM VAZIA") - {alert("Não existem mais registros na fila de discagem dessa campanha:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("Não existem mais registros na fila de discagem dessa campanha:\n" + campaign); alert_displayed=1;} + 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;} + if (alert_displayed==0) + {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Discar"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIDISCAR_web_QUERY_STRING =~ s/ /+/gi; -// $VICIDISCAR_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Desligar"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Discar"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Discar"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, goligadoto next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Discar"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Discar"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: 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; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " CHAMADA NOT PLACED") { alert("A ligação não foi efetuada. Houve um erro.:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + MDnextCID + "   Aguardando Atender..."; - - document.getElementById("HangupControl").innerHTML = "\"Desligar"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + MDnextCID + "   Aguardando Atender..."; + + document.getElementById("HangupControl").innerHTML = "\"Desligar"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICIDISCAR_LOG ENTRY FOR THIS CHAMADA PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: 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; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Entrante: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLDESLIGAR"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICIDISCAR_LOG ENTRY FOR THIS CHAMADA PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Discar"; + document.getElementById("DiaLControl").innerHTML = "\"Discar"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,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"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4699,33 +6010,80 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DISCAR"); + alert("VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DIAL"); } else { - showDiv('PausaCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - PausaCode_HTML = ''; - document.vicidial_form.PausaCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - PausaCode_HTML = "
# CHAMADABACK DATE/TIMENUMERONAME STATUSCAMPAIGNLAST DATA/HORA DA CHAMADA COMMENTS
PAUSAR CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - PausaCode_HTML = PausaCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {PausaCode_HTML = PausaCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - PausaCode_HTML = PausaCode_HTML + "


Voltar"; - document.getElementById("PausaCodeSelectContent").innerHTML = PausaCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Voltar";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Grupo Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "CUSTOMIZADOER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Voltar"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Discar"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Colocar"; + document.getElementById("HangupBothLines").innerHTML ="\"Desligar"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Você deve selecionar um status");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Discar"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Colocar"; + document.getElementById("HangupBothLines").innerHTML ="\"Desligar"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Você deve selecionar um status");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimizar"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimizar "; document.getElementById("DispoSelectHAspan").innerHTML = "Desligue novamente"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4891,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Pausa Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -4915,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PausaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Grupo Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + 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 + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Mostrar message that there are no voice channels in the VICIDISCAR session +// Mostrar message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE SAIR LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Você não pode sair durante uma chamada. \nAguarda 50 segundos para desligar se for telefone não atendido");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "CLIQUE AQUI PARA FAZER O LOGIN NOVAMENTE\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "CLIQUE AQUI PARA FAZER O LOGIN NOVAMENTE\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to maximizar +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maximizar"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maximizar "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to minimizar +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimizar"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimizar "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Mostrar the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("Você deve estar PAUSED PARA ALTERAR GRUPOS"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Mostrar the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5766,32 +7308,38 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatusSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PausaCodeLinkSpan").innerHTML = "DÊ ENTRADA A um CÓDIGO Da PAUSA"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "DÊ ENTRADA A um CÓDIGO Da PAUSA"; } if (VICIDiaL_allow_closers < 1) { document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Discar"; + document.getElementById("DiaLControl").innerHTML = "\"Discar"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "JAN";} + if (mon == 2) {statusmon = "FEV";} + if (mon == 3) {statusmon = "MAR";} + if (mon == 4) {statusmon = "ABR";} + if (mon == 5) {statusmon = "MAI";} + if (mon == 6) {statusmon = "JUN";} + if (mon == 7) {statusmon = "JLY";} + if (mon == 8) {statusmon = "AGO";} + if (mon == 9) {statusmon = "SET";} + if (mon == 10) {statusmon = "OUT";} + if (mon == 11) {statusmon = "NOV";} + if (mon == 12) {statusmon = "DEZ";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "JAN";} - if (Cmon == 1) {Cmon = "FEV";} - if (Cmon == 2) {Cmon = "MAR";} - if (Cmon == 3) {Cmon = "ABR";} - if (Cmon == 4) {Cmon = "MAI";} - if (Cmon == 5) {Cmon = "JUN";} - if (Cmon == 6) {Cmon = "JLY";} - if (Cmon == 7) {Cmon = "AGO";} - if (Cmon == 8) {Cmon = "SET";} - if (Cmon == 9) {Cmon = "OUT";} - if (Cmon == 10) {Cmon = "NOV";} - if (Cmon == 11) {Cmon = "DEZ";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "JAN";} + if (Cmon == 2) {customermon = "FEV";} + if (Cmon == 3) {customermon = "MAR";} + if (Cmon == 4) {customermon = "ABR";} + if (Cmon == 5) {customermon = "MAI";} + if (Cmon == 6) {customermon = "JUN";} + if (Cmon == 7) {customermon = "JLY";} + if (Cmon == 8) {customermon = "AGO";} + if (Cmon == 9) {customermon = "SET";} + if (Cmon == 10) {customermon = "OUT";} + if (Cmon == 11) {customermon = "NOV";} + if (Cmon == 12) {customermon = "DEZ";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6134,9 +7776,11 @@ else } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " DISCAR TELEFONE ALTERNATIVO
"; + var buildDivHTML = " DISCAR TELEFONE ALT
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6155,10 +7799,12 @@ else if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " DISCAR TELEFONE ALTERNATIVO
"; + var buildDivHTML = " DISCAR TELEFONE ALT
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Transferir"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + 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"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Início\"
\"Discar"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,18 +8001,21 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -SAIR\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +SAIR\n"; ?>
height=30> - + - +
VICIDISCARVICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE    ID da sessão: VALIGN=MIDDLE ALIGN=CENTER>   LIVE    ID da sessão:     Chamadas Ativas
@@ -6346,7 +8023,7 @@ echo "\n"; - height=>

VICIDISCAR
+ height=>

VICIDIAL
@@ -6357,8 +8034,12 @@ echo "\n"; X AGENDAMENTOS ATIVOS
- -
+ +
+
+ + segundos: +     @@ -6375,7 +8056,7 @@ echo "\n";
- + height=460>
AGENDAMENTOS POR AGENTE :
Clique em um dos contatos abaixo para ligar. Se você clicar em um contatos abaixo o mesmo será removido da lista de Agendamentos.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
NOVA DISCAGEM MANUAL PARA :

Digite abaixo a informação do novo contato que você deseja ligar.
\n";
  (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)


Se você deseja ligar para um número que não está na lista de contatos, digite o número que voc6e deseja discar no campo Discagem Sobreposta abaixo. Para desligar essa ligação você deve abrir o link Ligações em sua sessão link no rodapé da página e desligar clicando no link do canal.
 
+

+     +
+

Se você deseja ligar para um número que não está na lista de contatos, digite o número que voc6e deseja discar no campo Discagem Sobreposta abaixo. Para desligar essa ligação você deve abrir o link Ligações em sua sessão link no rodapé da página e desligar clicando no link do canal.
 
Discagem Sobreposta:   (digitos apenas por favor)

- Discar Agora + Discar Agora +                 + Preview Call                 Voltar
@@ -6430,7 +8117,7 @@ echo "\n"; -Your Status:
Calls Dialing: +Your Status:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Your Status:
Calls Dialing: - Transferir a conferência
+ Transferir a conferência            
CLOSER LOCAL @@ -6451,8 +8138,8 @@ Your Status:
Calls Dialing:   - DISCAGEM SOBREPOSTA   - ABANDONAR CHAMADA A TRES + DISCAGEM SOBREPOSTA   +
ABANDONAR CHAMADA A TRES Transferência sem acompanhamento D1 D2 @@ -6512,7 +8199,31 @@ Your Status:
Calls Dialing: + + height=70> + + + + + + +
Extensão Alt Telefone Informação: minimizar
+
+
+
+
+ +
+
+ + + + + +
maximizar
Alt Telefone Info
+
+ + height=500>
Não existe ninguem na sua sessão:
Voltar

@@ -6520,7 +8231,7 @@ Your Status:
Calls Dialing: + height=500>
O cliente desligou:
Voltar

@@ -6529,7 +8240,7 @@ Your Status:
Calls Dialing: + height=550>
Chamada Wrapup: segundos restantes no wrapup



@@ -6538,29 +8249,34 @@ Your Status:
Calls Dialing: - height=500>
Sua sessão foi incapacitada
SAIR

Voltar + + height=500>
Sua sessão foi incapacitada
SAIR

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


Voltar +
+
+ + height=500>

SAIR
- +
- +
 
- + height=47>
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.
- - height=460>
SELEÇÃO DE STATUS :       Desligue novamente       minimizar
+ + height=460>
SELEÇÃO DE STATUS :       Desligue novamente       minimizar
Fim da seleção de status
PAUSAR DISCAGEM DO AGENTE
@@ -6572,15 +8288,26 @@ Your Status:
Calls Dialing: + height=460>
SELECIONE Um CÓDIGO Da PAUSA :
- Pausa Code Selection - + Pausa Code Selection +

 
- + + height=460>
Selecionar um grupo ALIÁS :
+ Grupo Alias Selecção + +

  +
+
+ + + + + height=460>
Selecione uma data para o retorno :
@@ -6604,7 +8331,17 @@ Your Status:
Calls Dialing: + + + + + + + + + +  

+ Comentarios do CB:

ENVIAR

@@ -6623,30 +8360,39 @@ Your Status:
Calls Dialing: + height=460>
SELECAO DO GRUPO DE ENTRADA DO CLOSER
Seleção do grupo de entrada do closer
- LIGACAO MISTURADA(ligações externas ativadas)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + LIGACAO MISTURADA(ligações externas ativadas)
+ REINICIAR | ENVIAR



 
- + Canal Canal ESTE AGENDAMENTO SO APARECE PARA MIM
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " LIGACAO MISTURADA
";} ?>
- height=>
VICIDISCAR SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,37 +8402,45 @@ Your Status:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> -> - +
VICIDISCAR web-client version:     CONFIGURAÇÃO:               Servidor:              
+> +
VICIDIAL web-client version:     CONFIGURAÇÃO:               Servidor:              
Mostrar informações de discagem do canal

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ ID da gravação:
+
STATUS:
-Discar proximo número
+Discar proximo número
VISUALIZAR CONTATO
- DISCAR TELEFONE ALTERNATIVO
+ DISCAR TELEFONE ALT
@@ -6696,7 +8450,7 @@ GRAVANDO ARQUIVO:
ID da gravação:
-Inicia Gravação
+Inicia Gravação

Web Form

@@ -6705,7 +8459,7 @@ ID da gravação:

Desligar Cliente

-
Enviar DTMF

+
Enviar DTMF

- - + + +
segundos:   Canal:   Tempo de cliente:   Customer Time:   Canal:
Informações do cliente:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Título:   Primeiro:   MI:  Ultimo:   Primeiro:   MI:  Ultimo:
Endereço1:
Endereço2:   Endereço3: Endereço3:
Cidade:   Estado:   CEP: Estado: CEP:
Bairro:   ID do Vendedor: Vendedor: Sexo:
Telefone:   Codigo de Area:   Telefone Alternativo: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +Codigo de Area: Telefone Alternativo:
Mostrar:   Email: Email:
Comentários: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_br/voicemail_check.php b/LANG_www/agc_br/voicemail_check.php index 628f19b0..33ce0ac5 100644 --- a/LANG_www/agc_br/voicemail_check.php +++ b/LANG_www/agc_br/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_de/active_list_refresh.php b/LANG_www/agc_de/active_list_refresh.php index 3cd974e6..fa146a57 100644 --- a/LANG_www/agc_de/active_list_refresh.php +++ b/LANG_www/agc_de/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes @@ -161,10 +161,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "Liste Display: "; -if ($ADD==1) {echo "Live Erweiterungen";} -if ($ADD==2) {echo "Besetzte Erweiterungen";} +if ($ADD==1) {echo "Live Nebenstellen";} +if ($ADD==2) {echo "Besetzte Nebenstellen";} if ($ADD==3) {echo "Amtsleitungen";} -if ($ADD==4) {echo "Lokale Erweiterungen";} +if ($ADD==4) {echo "Lokale Nebenstellen";} if ($ADD==5) {echo "Konferenzen";} if ($ADD==99999) {echo "HILFE";} echo "\n"; diff --git a/LANG_www/agc_de/astguiclient.php b/LANG_www/agc_de/astguiclient.php index 7ac371a4..88ca1187 100644 --- a/LANG_www/agc_de/astguiclient.php +++ b/LANG_www/agc_de/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -152,7 +152,7 @@ echo "
\n"; echo "\n"; echo "


"; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -185,7 +185,7 @@ echo "
Login
 
0) { - fwrite ($fp, "VICIWÄHLEN|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICIWÄHLEN|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -219,7 +219,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "


"; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; @@ -256,7 +256,7 @@ echo ""; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
Telefon Login
 
\n"; echo "\n"; echo "


"; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -490,9 +490,9 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF_de.jpg"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON_de.gif"; var image_voicemail_OFF = new Image(); image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF.gif"; var image_voicemail_ON = new Image(); @@ -885,7 +885,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} else { bsr_continue=0; - alert("Sie können nur ZAP Leitungen abhören:\n" + listenvalue); + alert("Sie können nur ISDN Leitungen abhören:\n" + listenvalue); } } if (bsr_continue == '1') @@ -1195,7 +1195,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} { recLIST = recLIST + "|" + monitorchannelvalue; filename = filedate + "_" + user_abb; - var rec_start_html = "Stoppe Aufzeichnung"; + var rec_start_html = "Aufnahme stoppen"; document.getElementById(taskspan).innerHTML = rec_start_html; } @@ -1257,7 +1257,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 = "Stoppe Aufzeichnung"; + var conf_rec_start_html = "Aufnahme stoppen"; document.getElementById(taskconfspan).innerHTML = conf_rec_start_html; } @@ -1384,7 +1384,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=3; if (live_calls > 0) { - var live_calls_HTML = "LIVE ANRUFE AUF DIESEM TELEFON:
Telefon Login
 
Ihr Telefon Login ist nicht aktiv, bitte versuchen sie es noch einmal:
 
"; + var live_calls_HTML = "VERBUNDEN MIT DIESEM TELEFON:
#KUNDEN LEITUNGENTFERNTE LEITUNGAUFNAHMEAUFLEGENPARK
"; if ( (LCAcount > live_calls) || (LCAcount < live_calls) ) { LCAe[0]=''; LCAe[1]=''; LCAe[2]=''; LCAe[3]=''; LCAe[4]=''; LCAe[5]=''; @@ -1410,7 +1410,7 @@ 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 + "Stoppe Aufzeichnung";} + {live_calls_HTML = live_calls_HTML + "Aufnahme stoppen";} else {live_calls_HTML = live_calls_HTML + "Aufzeichnung";} @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + ""; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
#KUNDEN LEITUNGENTFERNTE LEITUNGAUFNAHMEAUFLEGENPARK
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " WÄHLEN
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL
"; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " WÄHLEN
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL
"; @@ -1762,7 +1762,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} show_reglink=1; reglink = "
Register"; } - var conf_head_HTML = "KONFERENZ " + head_conf + "    Registriert bei: " + head_reg + "   " + reglink + "         Betrete Konferenz
Aktualisieren     Aufzeichnung         Senden Sie DTMF         Wählen aus Konferenz
"; + var conf_head_HTML = "KONFERENZ " + head_conf + "    Registriert bei: " + head_reg + "   " + reglink + "         Betrete Konferenz
Aktualisieren     Aufzeichnung         DTMF Senden         Wählen aus Konferenz
"; document.getElementById("ConfereNceHeaderContent").innerHTML = conf_head_HTML; check_for_conf_calls(head_conf,taskrefresh); @@ -1823,7 +1823,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 = "LIVE ANRUFE IN DIESER KONFERENZ:
"; + var live_conf_HTML = "VERBINDUNGEN IN DIESER KONFERENZ:
#ENTFERNTE LEITUNGAUFLEGEN
"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -2288,7 +2288,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 = "
#ENTFERNTE LEITUNGAUFLEGEN
VORHANDENE EXTENSION FAVORITEN
"; + var favedit_HTML = "
VORHANDENE NEBENSTELLEN FAVORITEN
"; loop_ct = 0; while (loop_ct < favlistCT) { @@ -2323,7 +2323,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} { if (loop_ct > 0) { - favedit_HTML = favedit_HTML + " " + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "  
"; + favedit_HTML = favedit_HTML + " " + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "  
"; } loop_ct++; } @@ -2466,7 +2466,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} start_all_refresh(); } function pause() // Pauses the refreshing of the lists - {active_display=2; display_message=" - AKTIVE ANZEIGE IN PAUSE -";} + {active_display=2; display_message=" - AKTIVE ANZEIGE PAUSIERT -";} function start() // resumes the refreshing of the lists {active_display=1; display_message='';} function faster() // lowers by 1000 milliseconds the time until the next refresh @@ -2712,18 +2712,18 @@ echo "\n";
- +
- - - - - + + + + +
LOGOUT
\n"; ?>
Haupt BedienfeldAktive Leitungen BedienfeldKonferenz BedienfeldVoicemail checkenLive AnrufHaupt BedienfeldAktive Leitungen BedienfeldKonferenz BedienfeldVoicemail abhörenLive Anruf
@@ -2756,25 +2756,25 @@ echo "\n"; - +
LIVE ANRUF WEITERLEITEN
Leitung, die verbunden werden soll: Kanal
-
ANRUF WEITERLEITEN
Leitung, die verbunden werden soll: Kanal
Erweiterungen:
Extension Menü

- Senden Sie an ausgewählte Extension

- Senden Sie an ausgewählte Voicemalbox

+ Verbinden mit ausgewählter Nebenstelle

+ Weiterleiten zur ausgewählte Voicemalbox

Verbinden mit dieser Nummer:


Aktualisieren


Zurück zu Hauptfenster

Konferenzen:
(Klicken Sie unten auf eine Nummer, um mit einer Konferenz zu verbinden)
Meinen Kanal auch senden
Konferenz Menü
+
Konferenzen:
(Klicken Sie unten auf eine Nummer, um mit einer Konferenz zu verbinden)
Meinen Kanal auch verbinden
Konferenz Menü
- +
LOKALER Anruf über Extension
Telefon ruft an von: Kanal
- + - + @@ -2837,10 +2837,10 @@ echo "\n";
LOKALE Nebenstellen wahl
Telefon ruft an von: Kanal
Erweiterungen:
Extension Menü

- Rufe ausgewählte Extension an

+ Rufe ausgewählte Nebenstelle an

Rufe ausgewählte Voicemalbox an

Aktualisieren


Zurück zu Hauptfenster

@@ -2794,9 +2794,9 @@ echo "\n";
VOICEMAIL     NEU:     ALT:             MANUELLER ANRUF       WÄHLEN
VOICEMAIL     NEU:     ALT:             MANUELLER ANRUF       DIAL
GEPARKTE ANRUFE: 0                LOKALE ANRUF EXTENSIONS
GEPARKTE ANRUFE: 0                LOKALE NEBENSTELLEN
OUTBOUND ANRUFE:
- @@ -2850,7 +2850,7 @@ echo "\n"; BESTELLEN | - diff --git a/LANG_www/agc_de/call_log_display.php b/LANG_www/agc_de/call_log_display.php index 42b10ec2..035c8dd1 100644 --- a/LANG_www/agc_de/call_log_display.php +++ b/LANG_www/agc_de/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_de/conf_exten_check.php b/LANG_www/agc_de/conf_exten_check.php index f6d2cb2b..b8b13c4a 100644 --- a/LANG_www/agc_de/conf_exten_check.php +++ b/LANG_www/agc_de/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -124,7 +168,7 @@ if ($format=='debug') echo "\n"; echo "\n"; echo "\n"; -echo "Konferenz Erweiterung überprüfen"; +echo "<title>Conf Extension Check"; echo "\n"; echo "\n"; echo "\n"; @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Wartende Anrufe: $RingCalls";} + else {$RingCalls = "Wartende Anrufe: $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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|START",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_LOGOUT';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Konferenz $conf_exten wurde registriert bei $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_de/inbound_popup.php b/LANG_www/agc_de/inbound_popup.php index 1d84f761..38fa1855 100644 --- a/LANG_www/agc_de/inbound_popup.php +++ b/LANG_www/agc_de/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -318,11 +318,11 @@ echo "$NOW_TIME

\n"; echo "ANGEPASST - \n"; echo "\n"; - echo "
\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
-PAUSE | START     Aktualisierungsfrequenz: 1000 ms Schneller | Langsamer

+STOP | START     Aktualisierungsfrequenz: 1000 ms Schneller | Langsamer

Initialisierung..
Aktive Erweiterung
+
Aktive Nebenstellen
AKTUALISIEREN | BESTELLEN |
Lokale Erweiterungen
+
Lokale Nebenstellen
AKTUALISIEREN | BESTELLEN |
Nummer Gewählt: $row[8]
Anmerkungen: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Gewählte Nummer: $row[8]
Notizen: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "AUFLEGEN - \n"; - echo "SENDE AN MEINE VOICEMAILBOX\n"; + echo "AN MEINE VOICEMAILBOX SENDEN\n"; echo "
\n"; diff --git a/LANG_www/agc_de/live_exten_check.php b/LANG_www/agc_de/live_exten_check.php index 1fb73011..4ab2d371 100644 --- a/LANG_www/agc_de/live_exten_check.php +++ b/LANG_www/agc_de/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup @@ -109,7 +109,7 @@ if ($format=='debug') echo "\n"; echo "\n"; echo "\n"; -echo "LIVE Erweiterung überprüfen"; +echo "<title>Aktive Nebenstelle überprüfen"; echo "\n"; echo "\n"; echo "\n"; diff --git a/LANG_www/agc_de/manager_send.php b/LANG_www/agc_de/manager_send.php index fcb79355..70b82fc4 100644 --- a/LANG_www/agc_de/manager_send.php +++ b/LANG_www/agc_de/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -220,14 +284,15 @@ if ($ACTION=="SysCIDOriginate") { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; + echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht abgesetzt\n"; } else { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet um Exten $exten Kanal $channel an $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate Befehl gesendet für Exten $exten Kanal $channel an $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -312,7 +379,7 @@ if ($ACTION=="Originate") { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; + echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht abgesetzt\n"; } else { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet um Exten $exten Kanal $channel an $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate Befehl gesendet für Exten $exten Kanal $channel an $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -339,7 +423,7 @@ if ($ACTION=="HangupConfDial") if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) { $channel_live=0; - echo "conference $exten ist unzulässig or ext_context $ext_context or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; + echo "conference $exten ist unzulässig or ext_context $ext_context or queryCID $queryCID ist unzulässig, Hangup Befehl nicht abgesetzt\n"; } else { @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; - echo "Kanal $channel ist unzulässig or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; - } + echo "Kanal $channel ist unzulässig or queryCID $queryCID ist unzulässig, Hangup Befehl nicht abgesetzt\n"; + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel ist nicht Live an $call_server_ip, Checking Live Kanal...\n"; + { + echo "Call $CalLCID $channel ist nicht Live an $call_server_ip, Checking Live Kanal...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Kanal $channel ist nicht Live an $call_server_ip, Hangup Befehl nicht abgesetzt $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Kanal $channel ist nicht Live an $call_server_ip, Hangup Befehl nicht eingesetzt $rowx[0]\n$stmt\n"; + echo "Kanal $channel in use by another agent an $call_server_ip, Hangup Befehl nicht abgesetzt $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup Befehl gesendet um Kanal $channel an $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup Befehl gesendet für Kanal $channel an $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Eine dieser Variablen ist unzulässig:\n"; + echo "Kanal $channel muss länger als 2 Buchstaben sein\n"; + echo "ExtraKanal $extrachannel muss länger als 2 Buchstaben sein\n"; + echo "queryCID $queryCID muss länger als 14 Buchstaben sein\n"; + echo "exten $exten muß eingestellt werden\n"; + echo "ext_context $ext_context muß eingestellt werden\n"; + echo "ext_priority $ext_priority muß eingestellt werden\n"; + echo "\nRedirect Action nicht gesendet\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference an $server_ip, Redirect Befehl nicht abgesetzt\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Kann keine leere Konferenz finden an $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht abgesetzt\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht abgesetzt\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect Befehl nicht abgesetzt\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX Befehl gesendet für Kanal $channel an $call_server_ip and \nHungup $extrachannel an $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel an $call_server_ip, Hungup $extrachannel an $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel an $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Eine dieser Variablen ist unzulässig:\n"; + echo "Kanal $channel muss länger als 2 Buchstaben sein\n"; + echo "ExtraKanal $extrachannel muss länger als 2 Buchstaben sein\n"; + echo "queryCID $queryCID muss länger als 14 Buchstaben sein\n"; + echo "exten $exten muß eingestellt werden\n"; + echo "ext_context $ext_context muß eingestellt werden\n"; + echo "ext_priority $ext_priority muß eingestellt werden\n"; + echo "session_id $session_id muß eingestellt werden\n"; + echo "\nRedirect Action nicht gesendet\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference an $server_ip, Redirect Befehl nicht abgesetzt\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Kann keine leere Konferenz finden an $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht abgesetzt\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht abgesetzt\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra Befehl gesendet für Kanal $channel and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten an $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra Befehl gesendet für Kanal $channel an $call_server_ip and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -636,7 +1306,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0]==0) { $channel_liveX=0; - echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $call_server_ip";} } } @@ -653,7 +1323,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0]==0) { $channel_liveY=0; - echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $server_ip";} } } @@ -666,7 +1336,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0] < 1) { $channel_liveY=0; - echo "No Local agent to send call to, Redirect Befehl nicht eingesetzt\n"; + echo "No Local agent to send call to, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} } else @@ -699,7 +1369,7 @@ if ($ACTION=="RedirectXtraCX") if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "RedirectXtraCX Befehl gesendet um Kanal $channel an $call_server_ip and \nHungup $extrachannel an $server_ip\n"; + echo "RedirectXtraCX Befehl gesendet für Kanal $channel an $call_server_ip and \nHungup $extrachannel an $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel an $call_server_ip, Hungup $extrachannel an $server_ip";} } } @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -774,7 +1447,7 @@ if ($ACTION=="RedirectXtra") else { $channel_liveX=0; - echo "Kann keine leere Konferenz finden an $server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kann keine leere Konferenz finden an $server_ip, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Kann keine leere Konferenz finden an $server_ip";} } } @@ -794,7 +1467,7 @@ if ($ACTION=="RedirectXtra") if ($rowx[0]==0) { $channel_liveX=0; - echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $call_server_ip, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $call_server_ip";} } } @@ -811,7 +1484,7 @@ if ($ACTION=="RedirectXtra") if ($rowx[0]==0) { $channel_liveY=0; - echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht abgesetzt\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel ist nicht Live an $server_ip";} } } @@ -823,7 +1496,7 @@ if ($ACTION=="RedirectXtra") if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "RedirectXtra Befehl gesendet um Kanal $channel and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; + echo "RedirectXtra Befehl gesendet für Kanal $channel and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten an $server_ip";} } else @@ -848,7 +1521,7 @@ if ($ACTION=="RedirectXtra") if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "RedirectXtra Befehl gesendet um Kanal $channel an $call_server_ip and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; + echo "RedirectXtra Befehl gesendet für Kanal $channel an $call_server_ip and \nExtraKanal $extrachannel\n to $exten an $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} } } @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,17 +1596,19 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { $channel_live=0; - echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $server_ip, Redirect Befehl nicht abgesetzt\n"; } } if ($channel_live==1) @@ -915,8 +1616,9 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} - echo "Redirect Befehl gesendet um Kanal $channel an $server_ip\n"; + echo "Redirect Befehl gesendet für Kanal $channel an $server_ip\n"; } } } @@ -938,24 +1640,26 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) { $channel_live=0; - echo "Kanal $channel ist unzulässig or queryCID $queryCID ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist unzulässig or queryCID $queryCID ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht abgesetzt\n"; } else { $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { $channel_live=0; - echo "Kanal $channel ist nicht Live an $server_ip, $ACTION Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist nicht Live an $server_ip, $ACTION Befehl nicht abgesetzt\n"; } } if ($channel_live==1) @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,10 +1702,11 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } - echo "$ACTION Befehl gesendet um Kanal $channel an $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; + echo "$ACTION Befehl gesendet für Kanal $channel an $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; } } } @@ -1014,34 +1723,105 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; - echo "Kanal $channel ist unzulässig or exten $exten ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; + echo "Kanal $channel ist unzulässig or exten $exten ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht abgesetzt\n"; } else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going an in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,11 +1859,12 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } } - echo "$ACTION Befehl gesendet um Kanal $channel an $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n AUFNAHME DAUERT BIS ZU 60 MINUTEN\n"; + echo "$ACTION Befehl gesendet für Kanal $channel an $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n AUFNAHME DAUERT BIS ZU 60 MINUTEN\n"; } } @@ -1096,7 +1879,7 @@ if ($ACTION=="VolumeControl") { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($stage)<1) or (strlen($queryCID)<1) ) { - echo "Konferenz $exten, Stage $stage ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; + echo "Konferenz $exten, Stage $stage ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht abgesetzt\n"; } else { @@ -1112,7 +1895,8 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Volume Befehl gesendet um Konferenz $exten, Stage $stage Kanal $channel an $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Volume Befehl gesendet für Konferenz $exten, Stage $stage Kanal $channel an $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_de/park_calls_display.php b/LANG_www/agc_de/park_calls_display.php index 044634c8..1a3b34ce 100644 --- a/LANG_www/agc_de/park_calls_display.php +++ b/LANG_www/agc_de/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_de/timeclock.php b/LANG_www/agc_de/timeclock.php new file mode 100644 index 00000000..bcecf8d1 --- /dev/null +++ b/LANG_www/agc_de/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "Diese Benutzer und Passwort Kombination ist nicht gültig
Bitte noch einmal:"; + + echo"\n"; + echo"VICIDIAL: Stechuhr\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Stechuhr
 
Benutzer Login:
Benutzer Passwort:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + 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 "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'START') ) + { + ### You cannot log in or out within 30 Sekunden of your last login/logout + $VDdisplayMESSAGE = "Bitte warten Sie wenigstens 30 Sekunden zwischen dem an- und abmelden und umgekehrt"; + + echo"\n"; + echo"VICIDIAL: Stechuhr\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Stechuhr
 
Benutzer Login:
Benutzer Passwort:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Sie sind jetzt abgemeldet"; + $LOGtimeMESSAGE = "Abgemeldet um $NOW_TIME
Zeit die sie angemeldet waren: $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';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "FEHLER: Stechuhreintrag wurde bereits gemacht: $status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "ZURÜCK zur Benutzeranmeldung";} + if ($referrer=='admin') + {$BACKlink = "ZURÜCK zur Administration";} + if ($referrer=='welcome') + {$BACKlink = "ZURÜCK zur Einstiegsseite";} + + echo"\n"; + echo"VICIDIAL: Stechuhr\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Stechuhr
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) + { + $VDdisplayMESSAGE = "Zeit seit Sie das letzte mal angemeldet waren: $totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Zuletzt ausgelogged um: $last_action_date

Klicken Sie unten auf LOGIN um sich anzumelden"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Zeit die Sie bereits angemeldet sind: $totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'LOGOUT'; + $LOGtimeMESSAGE = "Angemeldet seit: $last_action_date
Zeit die Sie bereits angemeldet sind: $totTIME_HMS

Klicken Sie unten auf LOGOUT um sich abzumelden"; + } + + echo"\n"; + echo"VICIDIAL: Stechuhr\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Stechuhr
 
$LOGtimeMESSAGE
 
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL: Stechuhr\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Stechuhr
 
Benutzer Login:
Benutzer Passwort:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_de/vdc_db_query.php b/LANG_www/agc_de/vdc_db_query.php index f40fd378..7fba8117 100644 --- a/LANG_www/agc_de/vdc_db_query.php +++ b/LANG_www/agc_de/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Passwort:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NUMMER\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NUMMER NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "ALTERNATIVE TELEFONNUMMER NUMMER STATUS NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count ist unzulässig\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "ALTERNATIVE TELEFONNUMMER NUMMER STATUS CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage ist unzulässig\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "LOG NICHT EINGEGEBEN\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign ist unzulässig\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,14 +1579,15 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { - echo "VICIDiaL_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME\n"; + echo "VICIDiaL_LOG Eingefügt: $uniqueid|$channel|$NOW_TIME\n"; echo "$StarTtime\n"; } else @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1024,7 +1608,7 @@ if ($stage == "start") # if ($affected_rows > 0) # { - # echo "CALL_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME"; + # echo "CALL_LOG Eingefügt: $uniqueid|$channel|$NOW_TIME"; # } # else # { @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "LOG NICHT EINGEGEBEN\n"; echo "uniqueid $uniqueid or lead_id: $lead_id ist unzulässig\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Eingefügt: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "LOG NICHT EINGEGEBEN\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "LOG NICHT EINGEGEBEN\n\n"; + } } else { - echo "LOG NICHT EINGEGEBEN\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|AUFNAHME_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send an to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send an to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If ANRUFBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2000,13 +3239,13 @@ else # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### ANRUFBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' ist jetzt im Status ' . $stage . "\n"; + echo 'Agent ' . $user . ' ist jetzt im Status ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2418,14 +3809,15 @@ if ($ACTION == 'PauseCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2455,15 +3847,15 @@ if ($ACTION == 'PauseCodeSubmit') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pause Code has been updated to $status for $agent_log_id\n"; +echo " Pause Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_de/vicidial.php b/LANG_www/agc_de/vicidial.php index b72ec677..93aac712 100644 --- a/LANG_www/agc_de/vicidial.php +++ b/LANG_www/agc_de/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of Sekunden for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls an hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of Sekunden for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name an login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST an server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a WÄHLEN link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a WÄHLEN link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups an campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Kunden auflegen +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TelefonSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT WÄHLEN by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call Sekunden counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='MANAGER OVERRIDE 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,16 +582,17 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "VICIWÄHLEN web client: Re-Login\n"; +echo "VICIDIAL web client: Re-Login\n"; echo "\n"; echo "\n"; +echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Deutsch
\n"; echo "
\n"; echo "\n"; -echo "


"; -echo ""; +echo "


"; +echo ""; echo ""; echo "\n"; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Re-Login
 
Benutzer Passwort:
Kampagne: $camp_form_code
$camp_form_code
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "VICIWÄHLEN web client: Kampagne Login\n"; + echo "VICIDIAL web client: Kampagne Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; @@ -483,8 +632,8 @@ echo "
\n"; #echo "\n"; echo "

Benutzer Login

"; - echo ""; - echo ""; + echo "
"; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -507,24 +656,25 @@ echo "
Kampagne Login
 
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "VICIWÄHLEN web client: Login\n"; + echo "VICIDIAL web client: Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; echo "
\n"; echo "\n"; - echo "


"; - echo ""; + echo "


"; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -553,16 +703,17 @@ echo "
Login
 
VICIWÄHLEN web client: Telefon Login\n"; +echo "VICIDIAL web client: Telefon Login\n"; echo "\n"; echo "\n"; +echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Deutsch
\n"; echo "\n"; echo "\n"; -echo "


"; -echo ""; +echo "


"; +echo ""; echo ""; echo "\n"; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "Sie müssen sich in die TIMECLOCK ERSTE
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("START|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("START|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: There are no Shifts enabled for your user group
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: You are not allowed to log in outside of your shift
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

MANAGER OVERRIDE:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Passwort:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "VICIWÄHLEN web client: VICIWÄHLEN Kampagne Login\n"; + echo "VICIDIAL web client: VICIDIAL Kampagne Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "
Telefon Login
 
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "VICIWÄHLEN web client: Kampagne Login\n"; + echo "VICIDIAL web client: Kampagne Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; @@ -909,8 +1278,8 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; + echo "
"; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Kampagne Login
 
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "VICIWÄHLEN web client: Telefon Login Error\n"; + echo "VICIDIAL web client: Telefon Login Error\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; @@ -950,8 +1366,8 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; - echo ""; + echo "


"; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Login Error
 
Ihr Telefon Login ist nicht aktiv, bitte versuchen sie es noch einmal:
 
VICIWÄHLEN web client\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "VICIDIAL web client\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TelefonSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TelefonSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1083,12 +1577,12 @@ else if ($allow_closers=="Y") { $VICIDiaL_allow_closers = 1; - print "\n"; + print "\n"; } else { $VICIDiaL_allow_closers = 0; - print "\n"; + print "\n"; } @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1134,54 +1628,58 @@ else $i++; } if ($prev_login_ct > 0) - {print "\n";} + {print "\n";} else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NEU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today an that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,17 +1768,17 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,15 +1810,15 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1333,13 +1829,14 @@ else } else { - echo "VICIWÄHLEN web client: VICIWÄHLEN Kampagne Login\n"; + echo "VICIDIAL web client: VICIDIAL Kampagne Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "Es sind keine aktiven Adressen mehr im Hopper\n"; + echo "Es sind für diese Kampagne keine aktiven Adressen mehr im Hopper\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -1356,9 +1853,10 @@ echo "
VICIWÄHLEN web client: VICIWÄHLEN Kampagne Login\n"; + echo "VICIDIAL web client: VICIDIAL Kampagne Login\n"; echo "\n"; echo "\n"; + echo " Stechuhr
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_Sekunden = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1819,54 +2351,83 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Pause\"\"WiederAufnehmen\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"WiederAufnehmen\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"WiederAufnehmen\""; - var DiaLControl_manual_HTML = "\"Nächste"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"WiederAufnehmen\""; + var DiaLControl_auto_HTML_ready = "\"\"WiederAufnehmen\""; + var DiaLControl_auto_HTML_OFF = "\"\"WiederAufnehmen\""; + var DiaLControl_manual_HTML = "\"Nächste"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF_de.jpg"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON_de.gif"; var image_LB_dialnextnumber = new Image(); - image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber.gif"; + image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_de.gif"; var image_LB_hangupcustomer = new Image(); - image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer.gif"; + image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_de.gif"; var image_LB_transferconf = new Image(); - image_LB_transferconf.src="../agc/images/vdc_LB_transferconf.gif"; + image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_de.gif"; var image_LB_grabparkedcall = new Image(); image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall.gif"; var image_LB_parkcall = new Image(); - image_LB_parkcall.src="../agc/images/vdc_LB_parkcall.gif"; + image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_de.gif"; var image_LB_webform = new Image(); - image_LB_webform.src="../agc/images/vdc_LB_webform.gif"; + image_LB_webform.src="../agc/images/vdc_LB_webform_de.gif"; var image_LB_stoprecording = new Image(); - image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording.gif"; + image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording2_de.gif"; var image_LB_startrecording = new Image(); - image_LB_startrecording.src="../agc/images/vdc_LB_startrecording.gif"; + image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_de.gif"; var image_LB_pause = new Image(); image_LB_pause.src="../agc/images/vdc_LB_pause.gif"; var image_LB_resume = new Image(); - image_LB_resume.src="../agc/images/vdc_LB_resume.gif"; + image_LB_resume.src="../agc/images/vdc_LB_resume_de.gif"; var image_LB_senddtmf = new Image(); - image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf.gif"; + image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_de.gif"; var image_LB_dialnextnumber_OFF = new Image(); - image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF.gif"; + image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_de.gif"; var image_LB_hangupcustomer_OFF = new Image(); - image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF.gif"; + image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_de.gif"; var image_LB_transferconf_OFF = new Image(); - image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF.gif"; + image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_de.gif"; var image_LB_grabparkedcall_OFF = new Image(); image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif"; var image_LB_parkcall_OFF = new Image(); - image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF.gif"; + image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_de.gif"; var image_LB_webform_OFF = new Image(); - image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF.gif"; + image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_de.gif"; var image_LB_stoprecording_OFF = new Image(); image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif"; var image_LB_startrecording_OFF = new Image(); @@ -1874,9 +2435,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var image_LB_pause_OFF = new Image(); image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF.gif"; var image_LB_resume_OFF = new Image(); - image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF.gif"; + image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_de.gif"; var image_LB_senddtmf_OFF = new Image(); - image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF.gif"; + image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_de.gif"; @@ -1974,21 +2535,77 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (taskdirection=='MUTING') { - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } else { - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } } } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass an to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"mit"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Kundenanruf"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'ANGEPASSTER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2155,11 +2819,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="\"Transferleitung"; + // document.getElementById("HangupXferLine").innerHTML ="\"Nachfrage"; } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_LOGOUT') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Status: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause an next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus an vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working an API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,8 +3101,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; - var live_conf_HTML = "LIVE ANRUFE IN IHRER SESSION:
>"; + var live_conf_HTML = "LIVE ANRUFE IN IHRER SITZUNG:
#ENTFERNTE LEITUNGAUFLEGENLAUTSTÄRKE
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,25 +3159,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) { agentchannel = channelfieldA; - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { agentchannel = channelfieldA; - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#ENTFERNTE LEITUNGAUFLEGENLAUTSTÄRKE
" + loop_ct + "" + channelfieldA + "AUFLEGEN
" + loop_ct + "" + channelfieldA + "AUFLEGEN
" + loop_ct + "" + channelfieldA + "AUFLEGEN          
" + loop_ct + "" + channelfieldA + "AUFLEGEN          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2493,9 +3292,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Stope"; + var conf_rec_start_html = "\"Stope"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Starte"; } @@ -2509,8 +3308,8 @@ 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 = "\"Starte"; - if (campaign_recording == 'ALLFORCE') + var conf_rec_start_html = "\"Starte"; + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Starte"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARK, FROMPARK, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2626,11 +3423,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { xferredirect_query=''; taskvar = 'NOTHING'; - alert("Transfer Nummer muss mehr als 1 Stelle haben:" + blindxferdialstring); + alert("Telefon Nummer muss mehr als 1 Stelle haben:" + blindxferdialstring); } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Geparkten"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; - document.getElementById("ParkControl").innerHTML ="\"Parke"; + document.getElementById("ParkControl").innerHTML ="\"Parke"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Nächste Nummer wählen"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Wähle alternative Telefonnummer: TELEFONNUMMER or ALTERNATIVE TELEFONNUMMER or ADRESSE3 or ADRESSE BEENDEN"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICIWÄHLEN Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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 = "\"Starte"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + var conf_rec_start_html = "\"Starte"; + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Starte"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2914,7 +3790,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("SIE MÜSSEN IM PAUSE MODUS SEIN, UM DIE WIEDERVORLAGEN IM AUTOMATISCHEM WÄHLMODUS EINZUSEHEN"); + alert("SIE MÜSSEN PAUSIERT SEIN, UM DIE WIEDERVORLAGEN IM AUTOMATISCHEM WÄHLMODUS EINZUSEHEN"); } else { @@ -2956,7 +3832,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 = "
# ANRUFBACK DATE/TIMENUMMERNAMESTATUSCAMPAIGNLAST ANRUF DATUM\/ZEIT COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3024,7 +3900,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("SIE MÜSSEN IM PAUSE MODUS SEIN, UM EINE NEUE ADRESSE IM AUTOMATISCHEM WÄHLMODUS MANUELL ZU WÄHLEN"); + alert("SIE MÜSSEN PAUSIERT SEIN, UM EINE NEUE ADRESSE IM AUTOMATISCHEM WÄHLMODUS MANUELL ZU WÄHLEN"); } else { @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Alias-Gruppe: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Klicken Sie hier, um eine Gruppe Alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,10 +3984,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { - alert("SIE MÜSSEN Eine TELEFONNUMMER UND Einen VORWAHLKNOPF-CODE EINGEBEN,UM SCHNELLEN VORWAHLKNOPF ZU BENUTZEN"); + alert("SIE MÜSSEN Eine TELEFONNUMMER UND Einen LÄNDER-CODE EINGEBEN,UM DIE SCHNELL WAHL ZU BENUTZEN"); } else { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + CIDcheck + "   Warte auf Freizeichen... " + MD_ring_secondS + " Sekunden"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + CIDcheck + "   Warte auf Freizeichen... " + MD_ring_secondS + " Sekunden"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3180,15 +4093,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} XD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Angerufener dritter Teilnehmer: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; + document.getElementById("MainStatuSSpan").innerHTML = " Nachfrage Teilnehmer: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"3-WEGE"; + document.getElementById("Leave3WayCall").innerHTML ="\"NACHFRAGE"; - document.getElementById("DialWithCustomer").innerHTML ="\"Kunden"; + document.getElementById("DialWithCustomer").innerHTML ="\"mit"; document.getElementById("ParkCustomerDial").innerHTML ="\"Kundenanruf"; - document.getElementById("HangupXferLine").innerHTML ="\"Transferleitung"; + document.getElementById("HangupXferLine").innerHTML ="\"Nachfrage"; document.getElementById("HangupBothLines").innerHTML ="\"Beide"; @@ -3214,33 +4127,34 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Angerufen: " + status_display_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Parke"; + document.getElementById("ParkControl").innerHTML ="\"Parke"; - document.getElementById("HangupControl").innerHTML = "\"Kunden"; + document.getElementById("HangupControl").innerHTML = "\"Kunden"; - document.getElementById("XferControl").innerHTML = "\"Transfer"; + document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALE"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Verbinden"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS ANRUF PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Nächste Nummer wählen request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Adressenvorschau ADRESSE WÄHLEN or ADRESSE ÜBERSPRINGEN"; + var man_status = "Adressenvorschau ADRESSE WÄHLEN or ADRESSE ÜBERSPRINGEN"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "HOPPER LEER") || (MDnextCID == "DNC NUMMER") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "HOPPER LEER") - {alert("Es sind keine Adressen im Hopper vorhanden:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("Es sind für diese Kampagne keine aktiven Adressen mehr im Hopper:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("Diese Telefonnummer ist nicht in den Listen der Campagne:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Unspezifizierter Fehler:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIWÄHLEN_web_QUERY_STRING =~ s/ /+/gi; -// $VICIWÄHLEN_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,23 +4443,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; MD_channel_look=1; custchannellive=1; - document.getElementById("HangupControl").innerHTML = "\"Kunden"; + document.getElementById("HangupControl").innerHTML = "\"Kunden"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go an to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefonE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: ADRESSE3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefon Kennung und Nummer: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Diese Telfonnummer DEAKTIVIEREN";} + else + {EAactive_link = "Diese Telefonnummer AKTIVIEREN";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktiv: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Anzahl Alternativen: " + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notizen:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " ANRUF NOT PLACED") { alert("Anruf wurde nicht getätigt, es gab eine Störung:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + MDnextCID + "   Warte auf Freizeichen..."; - - document.getElementById("HangupControl").innerHTML = "\"Kunden"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + MDnextCID + "   Warte auf Freizeichen..."; + + document.getElementById("HangupControl").innerHTML = "\"Kunden"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Diese Telfonnummer DEAKTIVIEREN";} + else + {EAactive_link = "Diese Telefonnummer AKTIVIEREN";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktiv: " + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS ANRUF PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,110 +5183,157 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Anmerkungen:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: ADRESSE3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT. NUMMERN WAHL: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefon Kennung und Nummer: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Diese Telfonnummer DEAKTIVIEREN";} + else + {EAactive_link = "Diese Telefonnummer AKTIVIEREN";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktiv: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Anzahl Alternativen: " + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notizen: " + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Parke"; + document.getElementById("ParkControl").innerHTML ="\"Parke"; - document.getElementById("HangupControl").innerHTML = "\"Kunden"; + document.getElementById("HangupControl").innerHTML = "\"Kunden"; - document.getElementById("XferControl").innerHTML = "\"Transfer"; + document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALE"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Verbinden"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; if (lastcustserverip == server_ip) { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Eingehend: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLAUFLEGEN"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS ANRUF PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4376,15 +5663,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Web"; - document.getElementById("ParkControl").innerHTML = "\"Parke"; - document.getElementById("HangupControl").innerHTML = "\"Kunden"; - document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + document.getElementById("ParkControl").innerHTML = "\"Parke"; + document.getElementById("HangupControl").innerHTML = "\"Kunden"; + document.getElementById("XferControl").innerHTML = "\"Transfer"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALE"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Verbinden"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; document.vicidial_form.custdatetime.value = ''; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,13 +5838,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"3-WEGE"; + // document.getElementById("Leave3WayCall").innerHTML ="\"NACHFRAGE"; - document.getElementById("DialWithCustomer").innerHTML ="\"Kunden"; + document.getElementById("DialWithCustomer").innerHTML ="\"mit"; document.getElementById("ParkCustomerDial").innerHTML ="\"Kundenanruf"; - document.getElementById("HangupXferLine").innerHTML ="\"Transferleitung"; + document.getElementById("HangupXferLine").innerHTML ="\"Nachfrage"; document.getElementById("HangupBothLines").innerHTML ="\"Beide"; } @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4699,7 +6010,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("SIE MÜSSEN PAUSIERT WERDEN, UM Einen PAUSE CODE Im AUTO-WÄHLEN MODUSEINZUGEBEN"); + alert("SIE MÜSSEN PAUSIERT WERDEN, UM Einen PAUSE CODE Im AUTO-DIAL MODUS EINZUGEBEN"); } else { @@ -4717,15 +6028,62 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (loop_ct == VD_pause_codes_ct_half) {PauseCode_HTML = PauseCode_HTML + "
# ANRUFBACK DATE/TIMENUMMERNAME STATUSCAMPAIGNLAST ANRUF DATUM\/ZEIT COMMENTS
";} } - PauseCode_HTML = PauseCode_HTML + "


Zurück"; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Zurück";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Alias-Gruppe Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "ANGEPASSTER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Zurück"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="
\"mit"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Kundenanruf"; + document.getElementById("HangupBothLines").innerHTML ="\"Beide"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Sie müssen ein Gesprächsergebnis wählen");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"mit"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Kundenanruf"; + document.getElementById("HangupBothLines").innerHTML ="\"Beide"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Sie müssen ein Gesprächsergebnis wählen");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimieren"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimieren "; document.getElementById("DispoSelectHAspan").innerHTML = "Wieder Auflegen"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Alias-Gruppe + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Alias-Gruppe: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Alias-Gruppe: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Zeigen message that there are no voice channels in the VICIWÄHLEN session +// Zeigen message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,15 +6607,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); - alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + LogouT('CLOSE'); + alert("BITTE NICHT VERGESSEN DEN LOGOUT KNOPF ZU BENÜTZEN.\n"); } } // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Sie können sich nicht während eines Anrufs abmelden. \nWarten Sie 50 Sekunden bis der Anruf beantwortet wird oder fehlschlägt");} @@ -5213,7 +6623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (VD_live_customer_call==1) { - alert("NOCH EIN LIVE ANRUF! Beenden Sie ihn, dann können Sie sich abmelden.\n" + VD_live_customer_call); + alert("Abmelden während des Gespräches nicht möglich, bitte BEENDEN SIE ZUERST das Gespräch.\n" + VD_live_customer_call); } else { @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "KLICKEN SIE HIER, UM SICH WIEDER ANZUMELDEN\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLICKEN SIE HIER, UM SICH WIEDER ANZUMELDEN\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to maximieren +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maximieren"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maximieren "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to minimieren +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimieren"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimieren "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Zeigen the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("SIE MÜSSEN PAUSIERT SEIN UM DIE GRUPPE ZU WECHSELN"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Zeigen the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5767,22 +7309,28 @@ else hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatusSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { document.getElementById("PauseCodeLinkSpan").innerHTML = "GEBEN Sie Einen PAUSE CODE Ein"; } @@ -5791,7 +7339,7 @@ else document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Starte"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Nächste"; + document.getElementById("DiaLControl").innerHTML = "\"Nächste"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "JAN";} + if (mon == 2) {statusmon = "FEB";} + if (mon == 3) {statusmon = "MÄR";} + if (mon == 4) {statusmon = "APR";} + if (mon == 5) {statusmon = "MAI";} + if (mon == 6) {statusmon = "JUN";} + if (mon == 7) {statusmon = "JLI";} + if (mon == 8) {statusmon = "AUG";} + if (mon == 9) {statusmon = "SEP";} + if (mon == 10) {statusmon = "OKT";} + if (mon == 11) {statusmon = "NOV";} + if (mon == 12) {statusmon = "DEZ";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,42 +7617,71 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "JAN";} - if (Cmon == 1) {Cmon = "FEB";} - if (Cmon == 2) {Cmon = "MÄR";} - if (Cmon == 3) {Cmon = "APR";} - if (Cmon == 4) {Cmon = "MAI";} - if (Cmon == 5) {Cmon = "JUN";} - if (Cmon == 6) {Cmon = "JLI";} - if (Cmon == 7) {Cmon = "AUG";} - if (Cmon == 8) {Cmon = "SEP";} - if (Cmon == 9) {Cmon = "OKT";} - if (Cmon == 10) {Cmon = "NOV";} - if (Cmon == 11) {Cmon = "DEZ";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "JAN";} + if (Cmon == 2) {customermon = "FEB";} + if (Cmon == 3) {customermon = "MÄR";} + if (Cmon == 4) {customermon = "APR";} + if (Cmon == 5) {customermon = "MAI";} + if (Cmon == 6) {customermon = "JUN";} + if (Cmon == 7) {customermon = "JLI";} + if (Cmon == 8) {customermon = "AUG";} + if (Cmon == 9) {customermon = "SEP";} + if (Cmon == 10) {customermon = "OKT";} + if (Cmon == 11) {customermon = "NOV";} + if (Cmon == 12) {customermon = "DEZ";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } start_all_refresh(); } function pause() // Pauses the refreshing of the lists - {active_display=2; display_message=" - AKTIVE ANZEIGE IN PAUSE - ";} + {active_display=2; display_message=" - AKTIVE ANZEIGE PAUSIERT - ";} function start() // resumes the refreshing of the lists {active_display=1; display_message='';} function faster() // lowers by 1000 milliseconds the time until the next refresh @@ -6134,9 +7776,11 @@ else } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " ALTERNATIVE TELEFONNUMMER WÄHLEN
"; + var buildDivHTML = " ALT. NUMMER WÄHLEN
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6155,10 +7799,12 @@ else if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " ALTERNATIVE TELEFONNUMMER WÄHLEN
"; + var buildDivHTML = " ALT. NUMMER WÄHLEN
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6175,7 +7821,7 @@ else else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Konferenz Informationen zeigen

 "; + document.getElementById("busycallsdisplay").innerHTML = "Konferenz Informationen anzeigen

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -6188,13 +7834,13 @@ else { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; } } @@ -6210,7 +7856,7 @@ else document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); - document.getElementById("XferControl").innerHTML = "\"Transfer"; + document.getElementById("XferControl").innerHTML = "\"Transfer"; var loop_ct = 0; var live_XfeR_HTML = ''; var XfeR_SelecT = ''; @@ -6231,9 +7877,24 @@ else hideDiv('TransferMain'); if (showoffvar == 'YES') { - document.getElementById("XferControl").innerHTML = "\"Transfer"; + document.getElementById("XferControl").innerHTML = "\"Transfer"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Alias-Gruppe: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Klicken Sie hier, um eine Gruppe Alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"WiederAufnehmen\"
\"Nächste"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6324,33 +7998,36 @@ echo "\n"; - MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT> +
MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -LOGOUT\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +LOGOUT\n"; ?>
height=30> - - - - + + + +
VICIWÄHLENSCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     Session ID: Live AnrufVICIDIALSCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     Session ID:     Live Anruf
- height=>

VICIWÄHLEN
+ height=>

VICIDIAL
-MANUELLER ANRUF       SCHNELLER VORWAHLKNOPF
+MANUELLER ANRUF       SCHNELL WAHL
@@ -6361,6 +8038,10 @@ echo "\n";
+ Sekunden: +     + + \n";
- + height=460>
WIEDERVORLAGEN FÜR AGENT :
Klicken Sie jetzt unten auf eine Wiedervorlage, um den Kunden zurückzurufen. Danach wird die Wiedervorlage aus der Liste gelöscht..
@@ -6386,13 +8067,13 @@ echo "\n";
- + height=460> - +
NEUE MANUELLE ADRESSE FÜR :

Tragen Sie unten die Informationen zu der neuen Adresse ein, die SIE wählen möchten.
\n"; + echo "Anmerkung: eine Vorwahl für $dial_prefix wird dem Anfang dieser Telefonnummer hinzugefügt
\n"; } ?> Note: all new manual dial leads will go into list

@@ -6409,14 +8090,20 @@ echo "\n";
  (Wenn diese Option ausgewählt ist, wird versucht, die Telefonnummer im System zu finden, bevor eine neue Adresse eingefügt wird)


Wenn Sie eine Nummer wählen möchten, die nicht in der Adressliste aufgenommen werden soll, müssen die genaue Nummer in das WÄHLVORGANG OVERRIDE Feld eintragen. Um diesen Anruf aufzulegen, müssen Sie auf den ANRUFS IN THIS SESSION Link klicken, und dann mit dem Leitung Link den Anruf zu beenden..
 
+

+     +
+

Wenn Sie eine Nummer wählen möchten, die nicht in der Adressliste aufgenommen werden soll, müssen die genaue Nummer in das WÄHL OVERRIDE Feld eintragen. Um diesen Anruf dann aufzulegen, müssen Sie auf den VERBINDUNGEN IN DIESER SITZUNG Link klicken, und dann über die Auswahl der Leitung den entsprechenden Anruf zu beenden..
 
Wahl Override:   (Bitte nur Zahlen)

- Jetzt wählen + Jetzt wählen +                 + Vorschau Call                 Zurück
@@ -6424,13 +8111,13 @@ echo "\n"; -
+
-Ihr Status:
Calls Dialing: +Ihr Status:
Calls Dialing:
@@ -6440,20 +8127,20 @@ Ihr Status:
Calls Dialing: - Transfer - Konferenz
+ Transfer - Konferenz            
- LOKALER SUPERVISOR - Transferleitung auflegen + LOKALE SUPERVISOR NACHFRAGE + Nachfrage auflegen
Beide Leitungen auflegen
Anzurufende Telefonnummer   - WÄHLVORGANG OVERRIDE   - 3-WEGE ANRUF VERLASSEN - Wähle blinden Transfer + WÄHL OVERRIDE   + NACHFRAGE VERLASSEN + Verbinden ohne Nachfrage D1 D2 @@ -6461,7 +8148,7 @@ Ihr Status:
Calls Dialing:   channel - Kunden anrufen + mit Kunde wählen Kundenanruf parken Blind Transfer VMail Message
@@ -6512,7 +8199,31 @@ Ihr Status:
Calls Dialing: + + height=70> + + + + + + +
Weitere alternative Telefonnummern: minimieren
+
+
+
+
+ +
+
+ + + + + +
maximieren
Alt Telefon Info
+
+ + height=500>
Niemand ist in ihrer Konferenz.:
Zurück

@@ -6520,7 +8231,7 @@ Ihr Status:
Calls Dialing: + height=500>
Kunde hat aufgelegt:
Zurück

@@ -6529,8 +8240,8 @@ Ihr Status:
Calls Dialing: - height=550>
Anruf Nachbereitung Verbleibende Sekunden der Nachbereitung

+ + height=550>
Anruf Nachbereitung: Verbleibende Sekunden der Nachbereitung



Beende Nachbereitung und mache weiter @@ -6538,29 +8249,34 @@ Ihr Status:
Calls Dialing: - height=500>
Ihr Lernabschnitt ist gesperrt worden
LOGOUT

Zurück + + height=500>
Ihre Sitzung ist gesperrt worden
LOGOUT

Zurück
- + + height=500>
Es ist eine Zeit-Synchronisation Problem mit Ihrem System haben, wenden Sie sich bitte sagen Sie sich an Ihren Systemadministrator


Zurück +
+
+ + height=500>

LOGOUT
- +
- +
 
- + height=47>
Die Änderungen an den Kundendaten werden nicht übernommen. Sie müssen die Kundendaten ändern bevor Sie aufgelegt haben..
- - height=460>
ABSCHLUSS ANRUF :       Wieder Auflegen       minimieren
+ + height=460> - + @@ -2837,7 +2837,7 @@ echo "\n";
ANRUF ABSCHLIESSEN :       Wieder Auflegen       minimieren
Gesprächsergebnis Auswahl
WÄHLPAUSE
@@ -6572,16 +8288,27 @@ Ihr Status:
Calls Dialing: - height=460> - +
WÄHLEN Sie Einen PAUSE CODE Vor :
+ + height=460>
WÄHLEN Sie Einen PAUSE CODE :
Pause Code Selection

 
- - height=460>"; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
Wählen Sie ein Rückrufadatum :
+ + height=460>
Wählen Sie eine Gruppe ALIAS :
+ Gruppe Alias Auswahl + +

  +
+
+ + + + + + height=460>"; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
Wählen Sie ein Rückrufdatum :
Wählen Sie unten ein Datum   @@ -6604,7 +8331,17 @@ Ihr Status:
Calls Dialing: + + + + + + + + + +  

+ WV Anmerkungen:

ÜBERNEHMEN

@@ -6623,89 +8360,106 @@ Ihr Status:
Calls Dialing: + height=460>
SUPERVISOR INBOUND GRUPPENWAHL
Supervisor Inbound Gruppenwahl
- GEMISCHTES ANRUFEN(Outbound aktiviert)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + INBOUND und OUTBOUND(Outbound aktiviert)
+ ZURÜCKSETZEN | ÜBERNEHMEN



 
- + Kanal Kanal NUR MEINE WIEDERVORLAGE
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " INBOUND und OUTBOUND
";} ?>
- height=>
VICIWÄHLEN SCRIPT
+ height=>
VICIDIAL SCRIPT
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TASTATURKÜRZEL DEAKTIVIERT +TASTATURKÜRZEL DEAKTIVIERT -> - +
VICIWÄHLEN Web-Client Version:     BUILD:               Server:              
-Konferenz Informationen zeigen

 
+> +
VICIDIAL Web-Client Version:     BUILD:               Server:              
+Konferenz Informationen anzeigen

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ Aufzeichnugs ID:
+
STATUS:
-Nächste Nummer wählen
+Nächste Nummer wählen
ADRESSEN VORSCHAU
- ALTERNATIVE TELEFONNUMMER WÄHLEN
+ ALT. NUMMER WÄHLEN
Aufzeichnungsdatei:

-Aufzeichnugs ID:
+Aufzeichnungs ID:
-Starte Aufnahme
+Starte Aufnahme

-Web Formular
+Web Formular

-Parke Anruf
-Transfer - Konferenz
+Parke Anruf
+Transfer - Konferenz

-Kunden auflegen
+Kunden auflegen

-
Senden Sie DTMF

+
DTMF Senden

- - + + +
Sekunden:   Kanal:   Cust Zeit:   Customer Time:   Kanal:
Kunden Information:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Titel:   Vorname:   MI:  Nachname:   Vorname:   MI:  Nachname:
Adresse1:
Adresse2:   Adresse3: Adresse3:
Stadt:   Bundesland:   Postleitzahl: Bundesland: Postleitzahl:
Region:   Anbieter ID: Anbieter ID: Geschlecht:
Telefon:   Vorwahl:   Alternative Telefonnummer: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +LandesCode: Alternative Telefonnummer:
Zeigen:   Email: Email:
Anmerkungen: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_de/voicemail_check.php b/LANG_www/agc_de/voicemail_check.php index 6ddcee43..e731bb90 100644 --- a/LANG_www/agc_de/voicemail_check.php +++ b/LANG_www/agc_de/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_el/active_list_refresh.php b/LANG_www/agc_el/active_list_refresh.php index 2de39cae..5e47093b 100644 --- a/LANG_www/agc_el/active_list_refresh.php +++ b/LANG_www/agc_el/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_el/astguiclient.php b/LANG_www/agc_el/astguiclient.php index c54d4038..ec7a082f 100644 --- a/LANG_www/agc_el/astguiclient.php +++ b/LANG_www/agc_el/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -185,7 +185,7 @@ echo "
0) { - fwrite ($fp, "VICIΚΛΗΣΗ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICIΚΛΗΣΗ|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -490,9 +490,9 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_el.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_el.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_voicemail_OFF = new Image(); image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF_el.gif"; var image_voicemail_ON = new Image(); @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + "
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " ΚΛΗΣΗ
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL
"; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " ΚΛΗΣΗ
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL
"; @@ -2723,7 +2723,7 @@ echo "\n";
Πίνακας Ενεργών Γραμμών Πίνακας διασκέψεων Ελεγχος Φωνητικού ταχυδρομείουΕνεργή κλήσηΕνεργή κλήση
@@ -2794,7 +2794,7 @@ echo "\n";
ΦΩΝ.ΤΑΧ.     ΝΕΟ:     ΠΑΛΑΙΟ:             ΧΕΙΡ.ΚΛΗΣΗ       ΚΛΗΣΗ
ΦΩΝ.ΤΑΧ.     ΝΕΟ:     ΠΑΛΑΙΟ:             ΧΕΙΡ.ΚΛΗΣΗ       DIAL
ΣΤΑΘΜ.ΚΛΗΣΕΙΣ: 0                ΤΗΛ.ΣΥΝΔ. ΤΟΠΙΚΗΣ ΚΛΗΣΗΣ
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-ΠΑΥΣΗ | ΕΝΑΡΞΗ     Ρυθμός ανανέωσης: 1000 ms Γρηγορότερα | Πιό αργά

+ΣΤΑΣΗ | ΕΝΑΡΞΗ     Ρυθμός ανανέωσης: 1000 ms Γρηγορότερα | Πιό αργά

Αρχή..
Ενεργές τηλ. συνδέσεις
diff --git a/LANG_www/agc_el/call_log_display.php b/LANG_www/agc_el/call_log_display.php index d6f4ea88..92dba8b6 100644 --- a/LANG_www/agc_el/call_log_display.php +++ b/LANG_www/agc_el/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_el/conf_exten_check.php b/LANG_www/agc_el/conf_exten_check.php index 9d5a9c1f..8ce4b074 100644 --- a/LANG_www/agc_el/conf_exten_check.php +++ b/LANG_www/agc_el/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Ζητεί, στο Queue: $RingCalls";} + else {$RingCalls = "Ζητεί, στο Queue: $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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Κατάσταση: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|ΕΝΑΡΞΗ",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_ΑΠΟΣΥΝΔΕΣΗ';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Κατάσταση: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Διάσκεψη $conf_exten έχει καταχωρηθεί $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_el/inbound_popup.php b/LANG_www/agc_el/inbound_popup.php index fd8c7ba5..6777df10 100644 --- a/LANG_www/agc_el/inbound_popup.php +++ b/LANG_www/agc_el/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Αριθμός που καλέσατε: $row[8]
Σημειώσεις: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Σημειώσεις:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "ΚΛΕΙΣΙΜΟ - \n"; echo "ΣΤΕΙΛΕ ΣΤΟ ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ΜΟΥ\n"; diff --git a/LANG_www/agc_el/live_exten_check.php b/LANG_www/agc_el/live_exten_check.php index ad511dc2..0b363a58 100644 --- a/LANG_www/agc_el/live_exten_check.php +++ b/LANG_www/agc_el/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_el/manager_send.php b/LANG_www/agc_el/manager_send.php index a66018c8..c198d62c 100644 --- a/LANG_www/agc_el/manager_send.php +++ b/LANG_www/agc_el/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel στο $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel στο $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel στο $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει, Hangup εντολή που δεν έγινε εισαγωγή\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel δεν είναι ενεργό στο $call_server_ip, Checking Live Κανάλι...\n"; + { + echo "Call $CalLCID $channel δεν είναι ενεργό στο $call_server_ip, Checking Live Κανάλι...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Hangup εντολή που δεν έγινε εισαγωγή $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Hangup εντολή που δεν έγινε εισαγωγή $rowx[0]\n$stmt\n"; + echo "Κανάλι $channel in use by another agent στο $call_server_ip, Hangup εντολή που δεν έγινε εισαγωγή $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### ΕΝΑΡΞΗ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; + echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "ExtraΚανάλι $extrachannel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; + echo "exten $exten πρέπει να τεθεί\n"; + echo "ext_context $ext_context πρέπει να τεθεί\n"; + echo "ext_priority $ext_priority πρέπει να τεθεί\n"; + echo "\nRedirect Action μην σταλμένος\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Δεν υπάρχει κενή διάσκεψη στο $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel δεν είναι ενεργό στο $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel δεν είναι ενεργό στο $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect εντολή που δεν έγινε εισαγωγή\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip and \nHungup $extrachannel στο $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel στο $call_server_ip, Hungup $extrachannel στο $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel στο $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; + echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "ExtraΚανάλι $extrachannel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; + echo "exten $exten πρέπει να τεθεί\n"; + echo "ext_context $ext_context πρέπει να τεθεί\n"; + echo "ext_priority $ext_priority πρέπει να τεθεί\n"; + echo "session_id $session_id πρέπει να τεθεί\n"; + echo "\nRedirect Action μην σταλμένος\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Δεν υπάρχει κενή διάσκεψη στο $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel δεν είναι ενεργό στο $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel δεν είναι ενεργό στο $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel and \nExtraΚανάλι $extrachannel\n to $exten στο $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten στο $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip and \nExtraΚανάλι $extrachannel\n to $exten στο $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect εντολή που στέλνεται για Κανάλι $channel στο $server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going στο in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 εντολή που στέλνεται για Διάσκεψη $exten, Stage $stage Κανάλι $channel στο $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_el/park_calls_display.php b/LANG_www/agc_el/park_calls_display.php index 4937023c..52c6f8c7 100644 --- a/LANG_www/agc_el/park_calls_display.php +++ b/LANG_www/agc_el/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_el/timeclock.php b/LANG_www/agc_el/timeclock.php new file mode 100644 index 00000000..9bf9426c --- /dev/null +++ b/LANG_www/agc_el/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "Ο χρήστη και τον κωδικό πρόσβασης που πληκτρολογήσατε δεν είναι ενεργό στο σύστημα
Παρακαλώ δοκιμάστε ξανά:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
 

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='ΕΝΑΡΞΗ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='ΕΝΑΡΞΗ'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'ΕΝΑΡΞΗ') ) + { + ### You cannot log in or out within 30 δευτερόλεπτα of your last login/logout + $VDdisplayMESSAGE = "Δεν μπορείτε να συνδεθείτε ή να αναφέρονται μέσα σε 30 δευτερόλεπτα από την τελευταία σας login ή logout"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
 

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOΑΠΟΣΥΝΔΕΣΗ') or ($status=='ΕΝΑΡΞΗ') or ($status=='ΑΠΟΣΥΝΔΕΣΗ') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Έχετε πλέον συνδεθεί-out"; + $LOGtimeMESSAGE = "Έχετε αποσυνδεθεί από την$NOW_TIME
Ποσό φορά που ήταν συνδεδεμένος στο:$totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='ΑΠΟΣΥΝΔΕΣΗ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='ΑΠΟΣΥΝΔΕΣΗ', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='ΑΠΟΣΥΝΔΕΣΗ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOΑΠΟΣΥΝΔΕΣΗ') or ($status=='ΕΝΑΡΞΗ') or ($status=='ΑΠΟΣΥΝΔΕΣΗ') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERROR: timeclock καταχώρηση αρχείου καταγραφής που έχουν ήδη πραγματοποιηθεί:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "ΕΠΙΣΤΡΟΦΗ στο γραφείο Σύνδεση οθόνης";} + if ($referrer=='admin') + {$BACKlink = "ΕΠΙΣΤΡΟΦΗ στην Διοίκηση";} + if ($referrer=='welcome') + {$BACKlink = "ΕΠΙΣΤΡΟΦΗ στην οθόνη υποδοχής";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOΑΠΟΣΥΝΔΕΣΗ') or ($status=='ΕΝΑΡΞΗ') or ($status=='ΑΠΟΣΥΝΔΕΣΗ') ) + { + $VDdisplayMESSAGE = "Ο χρόνος από την τελευταία φορά που είναι συνδεδεμένος στο:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Μπορείτε τελευταίου συνδεδεμένου αναφέρονται σε:$last_action_date

Κάντε κλικ παρακάτω για να ΕΙΣΟΔΟΣ log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Χρονικό διάστημα σας έχει συνδεθεί σε:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'ΑΠΟΣΥΝΔΕΣΗ'; + $LOGtimeMESSAGE = "Μπορείτε συνδεδεμένος στην διεύθυνση: $last_action_date
Χρονικό διάστημα σας έχει συνδεθεί σε:$totTIME_HMS

Κάντε κλικ παρακάτω για να ΑΠΟΣΥΝΔΕΣΗ log-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
 

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_el/vdc_db_query.php b/LANG_www/agc_el/vdc_db_query.php index d39f9fad..cd2326f8 100644 --- a/LANG_www/agc_el/vdc_db_query.php +++ b/LANG_www/agc_el/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Σύνδεση:
\n"; + $VDdisplayMESSAGE.= "Manager Κωδικός πρόσβασης:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC ΑΡΙΘΜΟΣ\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "ΑΡΙΘΜΟΣ NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### ΕΝΑΡΞΗ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "ΕΝΑΛΛΑΚΤΙΚΟ ΤΗΛΕΦΩΝΟ ΑΡΙΘΜΟΣ ΚΑΤΑΣΤΑΣΗ NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count δεν ισχύει\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "ΕΝΑΛΛΑΚΤΙΚΟ ΤΗΛΕΦΩΝΟ ΑΡΙΘΜΟΣ ΚΑΤΑΣΤΑΣΗ CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage δεν ισχύει\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### ΕΝΑΡΞΗ 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign δεν ισχύει\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; echo "uniqueid $uniqueid or lead_id: $lead_id δεν ισχύει\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### ΕΝΑΡΞΗ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='ΠΑΥΣΗALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='ΠΑΥΣΗALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Εισαγωγή : $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n\n"; + } } else { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_ΣΤΑΣΗ|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|ΕΓΓΡΑΦΗ_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send στο to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send στο to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If ΚΛΗΣΗBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','ΑΠΟΣΥΝΔΕΣΗ','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### ΕΝΑΡΞΗ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1998,15 +3237,15 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='ΠΑΥΣΗ',serverid='1';"; + # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### ΚΛΗΣΗBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### ΕΝΑΡΞΗ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLΚΑΤΑΣΤΑΣΗ',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### ΕΝΑΡΞΗ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('ΠΑΥΣΗ',$stage)) {$QMstatus='ΠΑΥΣΗALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} + if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' είναι τώρα στη κατάσταση ' . $stage . "\n"; + echo 'Agent ' . $user . ' είναι τώρα στη κατάσταση ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2405,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'ΠαύσηCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -2418,14 +3809,15 @@ if ($ACTION == 'ΠαύσηCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### ΕΝΑΡΞΗ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2453,17 +3845,17 @@ if ($ACTION == 'ΠαύσηCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='ΠΑΥΣΗREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Παύση Code has been updated to $status for $agent_log_id\n"; +echo " Παύση Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_el/vicidial.php b/LANG_www/agc_el/vicidial.php index 4d71a6d7..acf7cf79 100644 --- a/LANG_www/agc_el/vicidial.php +++ b/LANG_www/agc_el/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of δευτερόλεπτα for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls στο hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of δευτερόλεπτα for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name στο login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST στο server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a ΚΛΗΣΗ link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a ΚΛΗΣΗ link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups στο campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Κλείσιμο Πελάτη +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$ΤηλSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT ΚΛΗΣΗ by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call δευτερόλεπτα counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='MANAGER OVERRIDE 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,15 +582,16 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "χειριστής VICIΚΛΗΣΗ: Επανασύνδεση\n"; +echo "χειριστής VICIDIAL: Επανασύνδεση\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Ελληνικά
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Επανασύνδεση
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code
$camp_form_code
  \n"; +echo "

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "χειριστής VICIΚΛΗΣΗ: Σύνδεση εκστρατείας\n"; + echo "χειριστής VICIDIAL: Σύνδεση εκστρατείας\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Σύνδεση χρήστη

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,23 +656,24 @@ echo "
Σύνδεση εκστρατείας
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "χειριστής VICIΚΛΗΣΗ: Σύνδεση\n"; + echo "χειριστής VICIDIAL: Σύνδεση\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -553,15 +703,16 @@ echo "
Σύνδεση
χειριστής VICIΚΛΗΣΗ: Σύνδεση Τηλεφώνου\n"; +echo "χειριστής VICIDIAL: Σύνδεση Τηλεφώνου\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Ελληνικά
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('ΑΠΟΣΥΝΔΕΣΗ',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "Πρέπει να συνδεθείτε ΣΤΗΝ ΠΡΩΤΗ ΤΟΥ TIMECLOCK
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("ΕΝΑΡΞΗ|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("ΕΝΑΡΞΗ|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: There are no Shifts enabled for your user group
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: You are not allowed to log in outside of your shift
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

MANAGER OVERRIDE:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Σύνδεση:
\n"; + $VDdisplayMESSAGE.= "Manager Κωδικός πρόσβασης:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "χειριστής VICIΚΛΗΣΗ: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; + echo "χειριστής VICIDIAL: VICIDIAL Σύνδεση εκστρατείας\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Σύνδεση Τηλεφώνου
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "χειριστής VICIΚΛΗΣΗ: Σύνδεση εκστρατείας\n"; + echo "χειριστής VICIDIAL: Σύνδεση εκστρατείας\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Σύνδεση εκστρατείας
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "χειριστής VICIΚΛΗΣΗ: Σύνδεση Τηλεφώνου Error\n"; + echo "χειριστής VICIDIAL: Σύνδεση Τηλεφώνου Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Σύνδεση Error
χειριστής VICIΚΛΗΣΗ\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "χειριστής VICIDIAL\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($ΤηλSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($ΤηλSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### ΕΝΑΡΞΗ SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a ΝΕΟ record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today στο that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,19 +1768,19 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='ΠΑΥΣΗALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,17 +1810,17 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='ΠΑΥΣΗALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1333,9 +1829,10 @@ else } else { - echo "χειριστής VICIΚΛΗΣΗ: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; + echo "χειριστής VICIDIAL: VICIDIAL Σύνδεση εκστρατείας\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -1356,9 +1853,10 @@ echo "
χειριστής VICIΚΛΗΣΗ: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; + echo "χειριστής VICIDIAL: VICIDIAL Σύνδεση εκστρατείας\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_δευτερόλεπτα = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1808,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var ΠαύσηCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -1819,20 +2351,49 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Παύση\"\"Επανάληψη\""; - var DiaLControl_auto_HTML_ready = "\"Παύση\"\"Επανάληψη\""; - var DiaLControl_auto_HTML_OFF = "\"Παύση\"\"Επανάληψη\""; - var DiaLControl_manual_HTML = "\"Κλήση"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Επανάληψη\""; + var DiaLControl_auto_HTML_ready = "\"\"Επανάληψη\""; + var DiaLControl_auto_HTML_OFF = "\"\"Επανάληψη\""; + var DiaLControl_manual_HTML = "\"Κλήση"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_el.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_el.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_LB_dialnextnumber = new Image(); image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_el.gif"; var image_LB_hangupcustomer = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass στο to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Κλήση"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Στάθμευση"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'ΣΥΝΗΘΕΙΑER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentΚατάστασηΚατάσταση").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentΚατάστασηCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentΚατάστασηDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_ΑΠΟΣΥΝΔΕΣΗ') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Κατάσταση: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause στο next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus στο vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working στο API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΤΗ ΣΥΝΟΔΟ ΣΑΣ:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#ΑΠΟΜΑΚΡΟ ΚΑΝΑΛΙΚΛΕΙΣΙΜΟΟΓΚΟΣ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ          
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Στάση"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Εναρξη"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, ΣΤΑΘΜΕΥΣΗ, FROMΣΤΑΘΜΕΥΣΗ, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Αρπαγμα"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Στάθμευση"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Κλήση επόμενου αριθμού"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Κλήση εναλκού αριθμού: ΚΥΡΙΟ ΤΗΛΕΦΩΝΟ or ΕΝΑΛΛΑΚΤΙΚΟ ΤΗΛΕΦΩΝΟ or 3ΔΙΕΥΘΥΝΣΗ or ΤΕΛΕΙΩΣΤΕ"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICIΚΛΗΣΗ Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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 = "\"Εναρξη"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2956,7 +3832,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 = "
# ΚΛΗΣΗBACK DATE/TIMEΑΡΙΘΜΟΣNAMEΚΑΤΑΣΤΑΣΗCAMPAIGNLAST ΗΜΕΡΟΜΗΝΙΑ/ΧΡΟΝΟΣ ΚΛΗΣΗΣ COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Ομάδα Γνωστός: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Κάντε κλικ εδώ για να Επιλέξτε μια ομάδα Γνωστός"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + CIDcheck + "   Αναμονή για κουδούνισμα... " + MD_ring_secondS + " δευτερόλεπτα"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + CIDcheck + "   Αναμονή για κουδούνισμα... " + MD_ring_secondS + " δευτερόλεπτα"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Αποκαλούμενος: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3240,7 +4154,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICIΚΛΗΣΗ_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Κλήση επόμενου αριθμού request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Προβολή καθοδήγησης μετά ΚΛΗΣΗ ΟΔΗΓΟΥ or Παράλειψη Οδηγού"; + var man_status = "Προβολή καθοδήγησης μετά ΚΛΗΣΗ ΟΔΗΓΟΥ or Παράλειψη Οδηγού"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "ΚΕΝΟΣ HOPPER") || (MDnextCID == "DNC ΑΡΙΘΜΟΣ") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "ΚΕΝΟΣ HOPPER") - {alert("Δεν υπάρχουν άλλοι οδηγοί στον hopper για την εκστρατεία:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("Δεν υπάρχουν άλλοι οδηγοί στον hopper για την εκστρατεία:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("Αυτός ο αριθμός τηλεφώνου δεν είναι στην εκστρατεία καταλόγους:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Απροσδιόριστο σφάλμα:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIΚΛΗΣΗ_web_QUERY_STRING =~ s/ /+/gi; -// $VICIΚΛΗΣΗ_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go στο to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTΤηλE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: 3ΔΙΕΥΘΥΝΣΗ ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Μήκη και Αριθμός: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να Ανενεργό";} + else + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να ΔΡΑΣΤΙΚΗΣ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Σημειώσεις:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " ΚΛΗΣΗ NOT PLACED") { alert("η κλήση δεν τοποθετήθηκε, υπήρξε ένα λάθος:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + MDnextCID + "   Αναμονή για κουδούνισμα..."; - - document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + MDnextCID + "   Αναμονή για κουδούνισμα..."; + + document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να Ανενεργό";} + else + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να ΔΡΑΣΤΙΚΗΣ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICIΚΛΗΣΗ_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Σχολιάζει:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: 3ΔΙΕΥΘΥΝΣΗ ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Μήκη και Αριθμός: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να Ανενεργό";} + else + {EAactive_link = "Αλλαγή αυτό τον αριθμό τηλεφώνου για να ΔΡΑΣΤΙΚΗΣ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Σημειώσεις:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Εισερχόμενο: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLΚΛΕΙΣΙΜΟ"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICIΚΛΗΣΗ_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"ΑΠΟΧΩΡΗΣΗ"; + // document.getElementById("Leave3WayCall").innerHTML ="\"ΑΠΟΧΩΡΗΣΗ"; document.getElementById("DialWithCustomer").innerHTML ="\"Κλήση"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4703,29 +6014,76 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - showDiv('ΠαύσηCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - ΠαύσηCode_HTML = ''; - document.vicidial_form.ΠαύσηCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - ΠαύσηCode_HTML = "
# ΚΛΗΣΗBACK DATE/TIMEΑΡΙΘΜΟΣNAME ΚΑΤΑΣΤΑΣΗCAMPAIGNLAST ΗΜΕΡΟΜΗΝΙΑ/ΧΡΟΝΟΣ ΚΛΗΣΗΣ COMMENTS
ΠΑΥΣΗ CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - ΠαύσηCode_HTML = ΠαύσηCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {ΠαύσηCode_HTML = ΠαύσηCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - ΠαύσηCode_HTML = ΠαύσηCode_HTML + "


Επιστροφή"; - document.getElementById("ΠαύσηCodeSelectContent").innerHTML = ΠαύσηCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Επιστροφή";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Ομάδα Γνωστός Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "ΣΥΝΗΘΕΙΑER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Επιστροφή"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Κλήση"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Στάθμευση"; + document.getElementById("HangupBothLines").innerHTML ="\"Κλείσιμο"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Πρέπει να επιλέξετε ένα τερματισμό");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Κλήση"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Στάθμευση"; + document.getElementById("HangupBothLines").innerHTML ="\"Κλείσιμο"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Πρέπει να επιλέξετε ένα τερματισμό");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "ελαχιστοποιήστε"; + document.getElementById("DispoSelectMaxMin").innerHTML = " ελαχιστοποιήστε "; document.getElementById("DispoSelectHAspan").innerHTML = "Ξανακλήσε"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4891,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Παύση Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('ΠαύσηCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -4915,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=ΠαύσηCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Ομάδα Γνωστός + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Ομάδα Γνωστός: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Ομάδα Γνωστός: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Παρουσίαση message that there are no voice channels in the VICIΚΛΗΣΗ session +// Παρουσίαση message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE ΑΠΟΣΥΝΔΕΣΗ LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Δεν μπορείτε να αποσυνδεθείτε κατά τη διάρκεια μιας προσπάθειας κλήσεως. \nΠεριμένετε 50 δευτερόλεπτα την κλήση για να αποτύχει εάν δεν απαντέται");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΣΥΝΔΕΘΕΙΤΕ ΠΑΛΙ\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΣΥΝΔΕΘΕΙΤΕ ΠΑΛΙ\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to μεγιστοποιήστε +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "μεγιστοποιήστε"; + document.getElementById("DispoSelectMaxMin").innerHTML = " μεγιστοποιήστε "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to ελαχιστοποιήστε +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "ελαχιστοποιήστε"; + document.getElementById("DispoSelectMaxMin").innerHTML = " ελαχιστοποιήστε "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Παρουσίαση the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("Πρέπει να είστε Paused TO CHANGE ΟΜΑΔΕΣ"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Παρουσίαση the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5766,32 +7308,38 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('ΠαύσηCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentΚατάστασηCalls');} if (agentcallsstatus != '1') {hideDiv('AgentΚατάστασηSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("ΠαύσηCodeLinkSpan").innerHTML = "ΠΛΗΚΤΡΟΛΟΓΕΣΤΕ έναν ΚΩΔΙΚΟ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "ΠΛΗΚΤΡΟΛΟΓΕΣΤΕ έναν ΚΩΔΙΚΟ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ"; } if (VICIDiaL_allow_closers < 1) { document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; + document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "ΙΑΝ";} + if (mon == 2) {statusmon = "ΦΕΒ";} + if (mon == 3) {statusmon = "ΜΑΡ";} + if (mon == 4) {statusmon = "ΑΠΡ";} + if (mon == 5) {statusmon = "ΜΆΙ";} + if (mon == 6) {statusmon = "ΙΟΝ";} + if (mon == 7) {statusmon = "ΙΟΛ";} + if (mon == 8) {statusmon = "ΑΥΓ";} + if (mon == 9) {statusmon = "ΣΕΠ";} + if (mon == 10) {statusmon = "ΟΚΤ";} + if (mon == 11) {statusmon = "ΝΟΕ";} + if (mon == 12) {statusmon = "ΔΕΚ";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "ΙΑΝ";} - if (Cmon == 1) {Cmon = "ΦΕΒ";} - if (Cmon == 2) {Cmon = "ΜΑΡ";} - if (Cmon == 3) {Cmon = "ΑΠΡ";} - if (Cmon == 4) {Cmon = "ΜΆΙ";} - if (Cmon == 5) {Cmon = "ΙΟΝ";} - if (Cmon == 6) {Cmon = "ΙΟΛ";} - if (Cmon == 7) {Cmon = "ΑΥΓ";} - if (Cmon == 8) {Cmon = "ΣΕΠ";} - if (Cmon == 9) {Cmon = "ΟΚΤ";} - if (Cmon == 10) {Cmon = "ΝΟΕ";} - if (Cmon == 11) {Cmon = "ΔΕΚ";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "ΙΑΝ";} + if (Cmon == 2) {customermon = "ΦΕΒ";} + if (Cmon == 3) {customermon = "ΜΑΡ";} + if (Cmon == 4) {customermon = "ΑΠΡ";} + if (Cmon == 5) {customermon = "ΜΆΙ";} + if (Cmon == 6) {customermon = "ΙΟΝ";} + if (Cmon == 7) {customermon = "ΙΟΛ";} + if (Cmon == 8) {customermon = "ΑΥΓ";} + if (Cmon == 9) {customermon = "ΣΕΠ";} + if (Cmon == 10) {customermon = "ΟΚΤ";} + if (Cmon == 11) {customermon = "ΝΟΕ";} + if (Cmon == 12) {customermon = "ΔΕΚ";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6137,6 +7779,8 @@ else var buildDivHTML = " ΚΛΗΣΗ ENAΛ/ΚΟΥ ΤΗΛΕΦΩΝΟΥ
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6159,6 +7803,8 @@ else document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Μεταφορά"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Ομάδα Γνωστός: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Κάντε κλικ εδώ για να Επιλέξτε μια ομάδα Γνωστός"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Επανάληψη\"
\"Κλήση"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,26 +8001,29 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -ΑΠΟΣΥΝΔΕΣΗ\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +ΑΠΟΣΥΝΔΕΣΗ\n"; ?>
height=30> - + - - + +
VICIΚΛΗΣΗVICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     ID εργασίας: Ενεργή κλήση VALIGN=MIDDLE ALIGN=CENTER>   LIVE     ID εργασίας:     Ενεργή κλήση
- height=>

VICIΚΛΗΣΗ
+ height=>

VICIDIAL
@@ -6357,8 +8034,12 @@ echo "\n"; X ΕΝΕΡΓΕΣ ΕΠΑΝΑΚΛΗΣΕΙΣ
- -
+ +
+
+ + δευτερόλεπτα: +     @@ -6375,7 +8056,7 @@ echo "\n";
- + height=460>
ΕΠΑΝΑΚΛΗΣΕΙΣ ΓΙΑ ΤΟΝ ΧΕΙΡΙΣΤΗ :
Επιλέξτε μία επανάκληση παρακάτω για να καλέσετε τον πελάτη τώρα. Εάν επιλέξετε μία εγγραφή παρακάτω, θα διαγραφεί από την λίστα.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
ΝΕΑ ΧΕΙΡΟΚΙΝΗΤΗ ΚΛΗΣΗ ΟΔΗΓΟΥ ΓΙΑ :

Καταχωρήστε τις πληροφορίες παρακάτω για τον νέο οδηγό που επιθυμήτε να καλέσετε.
\n";
  (Η επιλογή αυτή επιτρέπει να βρει τον αριθμό στο σύστημα προτού γίνει εισαγωγή ως νέος οδηγός)


Εάν θέλετε να καλέσετε έναν αριθμό και να μην προστεθεί ως νέος οδηγός, καταχωρήστε τον με την σωστή μορφή στο πεδίο Αγνόησε Κλήση παρακάτω. Για να κλείσετε αυτή την κλήση θα πρέπει να ανοίξετε το ΚΛΗΣΕΙΣ ΣΕ ΑΥΤΗ ΤΗΝ ΔΙΑΙΔΚΑΣΙΑ στο κάτω μέρος της οθόνης και να την κλείσετε επιλέγοντας το κανάλι.
 
+

+     +
+

Εάν θέλετε να καλέσετε έναν αριθμό και να μην προστεθεί ως νέος οδηγός, καταχωρήστε τον με την σωστή μορφή στο πεδίο Αγνόησε Κλήση παρακάτω. Για να κλείσετε αυτή την κλήση θα πρέπει να ανοίξετε το ΚΛΗΣΕΙΣ ΣΕ ΑΥΤΗ ΤΗΝ ΔΙΑΙΔΚΑΣΙΑ στο κάτω μέρος της οθόνης και να την κλείσετε επιλέγοντας το κανάλι.
 
Αγνόησε Κλήση:   (παρακαλώ μόνο ψηφία)

- Κάλεσε Τώρα + Κάλεσε Τώρα +                 + Προεπισκόπηση πρόσκλησης                 Επιστροφή
@@ -6430,7 +8117,7 @@ echo "\n"; -Your Κατάσταση:
Calls Dialing: +Your Κατάσταση:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Your Κατάσταση:
- + + height=70> + + + + + + +
Εκτεταμένη Alt Τηλέφωνο Πληροφοριών: ελαχιστοποιήστε
+
+
+
+
+ +
+
+ + + + + +
μεγιστοποιήστε
Alt Τηλ Info
+
+ + height=500>
Κανένας δεν είναι στη σύνοδό σας:
Επιστροφή

@@ -6520,7 +8231,7 @@ Your Κατάσταση:
- + height=500>
Ο πελάτης έχει κλείσει το τηλέφωνο:
Επιστροφή

@@ -6529,7 +8240,7 @@ Your Κατάσταση:
- + height=550>
Αναδίπλωση Κλήσης: απομύνοντα δευτερόλεπτα σε αναδίπλωση



@@ -6538,29 +8249,34 @@ Your Κατάσταση:
- - height=500>
Η σύνοδός σας έχει τεθεί εκτός λειτουργίας
ΑΠΟΣΥΝΔΕΣΗ

Επιστροφή + + height=500>
Η σύνοδός σας έχει τεθεί εκτός λειτουργίας
ΑΠΟΣΥΝΔΕΣΗ

Επιστροφή
- + + height=500>
Υπάρχει ένα πρόβλημα συγχρονισμού με το χρόνο σας, παρακαλούμε ενημερώστε τον διαχειριστή του συστήματός σας


Επιστροφή +
+
+ + height=500>

ΑΠΟΣΥΝΔΕΣΗ
- +
- +
 
- + height=47>
Οποιεσδήποτε αλλαγές που γίνονται στις πληροφορίες πελατών κατωτέρω αυτή τη στιγμή δεν θα είναι, πρέπει να αλλάξετε τις πληροφορίες πελατών ενώπιον σας Hangup η κλήση.
- - height=460>
Τερματισμός Κλήσης :       Ξανακλήσε       ελαχιστοποιήστε
+ + height=460>
Τερματισμός Κλήσης :       Ξανακλήσε       ελαχιστοποιήστε
Επιλογή τερματισμού της κλήσης
ΤΕΡΜΑΤΙΣΜΟΣ ΚΛΗΣΗΣ
@@ -6572,15 +8288,26 @@ Your Κατάσταση:
- + height=460>
ΕΠΙΛΕΞΤΕ έναν ΚΩΔΙΚΑ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ :
- Παύση Code Selection - + Παύση Code Selection +

 
- + + height=460>
ΕΠΙΛΕΞΤΕ ΟΜΑΔΑ ALIAS :
+ Γνωστός Ομάδα Επιλογής + +

  +
+
+ + + + + height=460>
Επιλέξτε μια ημερομηνία CallBack :
@@ -6604,7 +8331,17 @@ Your Κατάσταση: + + + + + + + + + +  

+ Σχόλια CB:

ΥΠΟΒΑΛΕΤΕ

@@ -6623,30 +8360,39 @@ Your Κατάσταση:
- + height=460>
CLOSER ΕΙΣΕΡΧΟΜΕΝΗ ΕΠΙΛΟΓΗ ΟΜΑΔΑΣ
Επιλογή Closer εισερχόμενης ομάδας
- ΣΥΝΔΥΑΣΜΕΝΗ ΚΛΗΣΗ(εξερχόμενες ενεργοποιημένες)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + ΣΥΝΔΥΑΣΜΕΝΗ ΚΛΗΣΗ(εξερχόμενες ενεργοποιημένες)
+ ΕΠΑΝΑΦΟΡΑ | ΥΠΟΒΑΛΕΤΕ



 
- + Κανάλι Κανάλι ΜΟΝΟ ΤΗΝ ΕΠΑΝΑΚΛΗΣΗ ΜΟΥ
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " ΣΥΝΔΥΑΣΜΕΝΗ ΚΛΗΣΗ
";} ?>
- height=>
VICIΚΛΗΣΗ SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,28 +8402,36 @@ Your Κατάσταση: px;z-index:15;" id="MaiNfooterspan"> -> - +
Έκδοση VICIΚΛΗΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:               Κεντρικός υπολογιστής:              
+> +
Έκδοση VICIDIAL:     ΔΗΜΙΟΥΡΓΙΑ:               Κεντρικός υπολογιστής:              
Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) ) +
ΚΑΤΑΣΤΑΣΗ:
-Κλήση επόμενου αριθμού
+Κλήση επόμενου αριθμού
ΠΡΟΒΟΛΗ ΟΔΗΓΟΥ
ΚΛΗΣΗ ENAΛ/ΚΟΥ ΤΗΛΕΦΩΝΟΥ
@@ -6696,7 +8450,7 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) ) ΤΑΥΤΟΤΗΤΑ ΕΓΓΡΑΦΗΣ:
-Εναρξη ηχογράφισης
+Εναρξη ηχογράφισης

Σελίδα Διαδικτύου

@@ -6705,7 +8459,7 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) )
Κλείσιμο Πελάτη

-
Στείλε DTMF

+
Στείλε DTMF

- - + + +
δευτερόλεπτα:   Κανάλι:   Χρόνος Πελάτη:   Customer Time:   Κανάλι:
Πληροφορίες Πελάτη:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Τίτλος:   Πρώτο:   Μσ:  Επίθετο:   Πρώτο:   Μσ:  Επίθετο:
Διεύθυνση1:
Διεύθυνση2:   Διεύθυνση3: Διεύθυνση3:
Πόλη:   Κράτος:   Ταχ.Κωδ.: Κράτος: Ταχ.Κωδ.:
Επαρχία:   ID προμηθευτού: ID προμηθευτού: Φύλο:
Τηλ:   Κωδικός Κλήσης:   Εναλ/κό Τηλ: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +Κωδικός Κλήσης: Εναλ/κό Τηλ:
Παρουσίαση:   Ηλεκτρονικό ταχυδρομείο: Ηλεκτρονικό ταχυδρομείο:
Σχολιάζει: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_el/voicemail_check.php b/LANG_www/agc_el/voicemail_check.php index fb64e8a9..52bfe4ce 100644 --- a/LANG_www/agc_el/voicemail_check.php +++ b/LANG_www/agc_el/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_es/active_list_refresh.php b/LANG_www/agc_es/active_list_refresh.php index fb94a573..5978f25d 100644 --- a/LANG_www/agc_es/active_list_refresh.php +++ b/LANG_www/agc_es/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_es/astguiclient.php b/LANG_www/agc_es/astguiclient.php index 667ad057..7564a585 100644 --- a/LANG_www/agc_es/astguiclient.php +++ b/LANG_www/agc_es/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -2837,7 +2837,7 @@ echo "\n"; \n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-PAUSA | COMIENZO     Actualizar la tarifa: 1000 ms Más rápido | Más lento

+PARADA | COMIENZO     Actualizar la tarifa: 1000 ms Más rápido | Más lento

Inizializando..
Extensiones Activas
diff --git a/LANG_www/agc_es/call_log_display.php b/LANG_www/agc_es/call_log_display.php index cc48a77b..634a24b8 100644 --- a/LANG_www/agc_es/call_log_display.php +++ b/LANG_www/agc_es/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_es/conf_exten_check.php b/LANG_www/agc_es/conf_exten_check.php index e7fdc4ad..4f7689ed 100644 --- a/LANG_www/agc_es/conf_exten_check.php +++ b/LANG_www/agc_es/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Pide, en la cola: $RingCalls";} + else {$RingCalls = "Pide, en la cola: $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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|COMIENZO",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_SALIR';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 Ha sido registrado para $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_es/inbound_popup.php b/LANG_www/agc_es/inbound_popup.php index 58462f0d..b1f2d57b 100644 --- a/LANG_www/agc_es/inbound_popup.php +++ b/LANG_www/agc_es/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Número Marcado: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Notas:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "COLGAR - \n"; echo "ENVIAR A MI BUZÓN DE VOZ\n"; diff --git a/LANG_www/agc_es/live_exten_check.php b/LANG_www/agc_es/live_exten_check.php index 817f49d1..89087055 100644 --- a/LANG_www/agc_es/live_exten_check.php +++ b/LANG_www/agc_es/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_es/manager_send.php b/LANG_www/agc_es/manager_send.php index e56b8680..03c7e29e 100644 --- a/LANG_www/agc_es/manager_send.php +++ b/LANG_www/agc_es/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Canal $channel No es válido or queryCID $queryCID No es válido, Hangup comando no insertado\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel no está activo en $call_server_ip, Checking Live Canal...\n"; + { + echo "Call $CalLCID $channel no está activo en $call_server_ip, Checking Live Canal...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Canal $channel no está activo en $call_server_ip, Hangup comando no insertado $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Canal $channel no está activo en $call_server_ip, Hangup comando no insertado $rowx[0]\n$stmt\n"; + echo "Canal $channel in use by another agent en $call_server_ip, Hangup comando no insertado $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando enviado a Canal $channel en $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### COMIENZO 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup comando enviado a Canal $channel en $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Una de estas variables No es válido:\n"; + echo "Canal $channel debe ser mayor de 2 caracteres\n"; + echo "ExtraCanal $extrachannel debe ser mayor de 2 caracteres\n"; + echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; + echo "exten $exten debe ser fijado\n"; + echo "ext_context $ext_context debe ser fijado\n"; + echo "ext_priority $ext_priority debe ser fijado\n"; + echo "\nRedirect Action no enviado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference en $server_ip, Redirect comando no insertado\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No puede encontrar conferencia vacía en $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel no está activo en $call_server_ip, Redirect comando no insertado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel no está activo en $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel no está activo en $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando no insertado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX comando enviado a Canal $channel en $call_server_ip and \nHungup $extrachannel en $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel en $call_server_ip, Hungup $extrachannel en $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel en $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Una de estas variables No es válido:\n"; + echo "Canal $channel debe ser mayor de 2 caracteres\n"; + echo "ExtraCanal $extrachannel debe ser mayor de 2 caracteres\n"; + echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; + echo "exten $exten debe ser fijado\n"; + echo "ext_context $ext_context debe ser fijado\n"; + echo "ext_priority $ext_priority debe ser fijado\n"; + echo "session_id $session_id debe ser fijado\n"; + echo "\nRedirect Action no enviado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference en $server_ip, Redirect comando no insertado\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No puede encontrar conferencia vacía en $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel no está activo en $call_server_ip, Redirect comando no insertado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel no está activo en $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel no está activo en $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando enviado a Canal $channel and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten en $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando enviado a Canal $channel en $call_server_ip and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect comando enviado a Canal $channel en $server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going en in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 a Conferencia $exten, Stage $stage Canal $channel en $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_es/park_calls_display.php b/LANG_www/agc_es/park_calls_display.php index 20b4c114..6584e083 100644 --- a/LANG_www/agc_es/park_calls_display.php +++ b/LANG_www/agc_es/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_es/timeclock.php b/LANG_www/agc_es/timeclock.php new file mode 100644 index 00000000..4c7b4854 --- /dev/null +++ b/LANG_www/agc_es/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "El usuario y la contraseña que ha introducido no son activos en el sistema
Por favor, inténtelo de nuevo:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Conexión Del Usuario:
Contraseña Del Usuario:
 

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='COMIENZO', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='COMIENZO'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'COMIENZO') ) + { + ### You cannot log in or out within 30 segundos of your last login/logout + $VDdisplayMESSAGE = "No puede iniciar sesión o en un plazo de 30 segundos de su última conexión o desconexión"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Conexión Del Usuario:
Contraseña Del Usuario:
 

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOSALIR') or ($status=='COMIENZO') or ($status=='SALIR') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Ya ha iniciado la sesión en"; + $LOGtimeMESSAGE = "Que en la sesión$NOW_TIME
Cantidad de tiempo que se han registrado en:$totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='SALIR', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='SALIR', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='SALIR', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOSALIR') or ($status=='COMIENZO') or ($status=='SALIR') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERROR: timeclock entrada de registro ya realizados:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "VOLVER a la pantalla de Inicio";} + if ($referrer=='admin') + {$BACKlink = "VOLVER a la Administración";} + if ($referrer=='welcome') + {$BACKlink = "VOLVER a la pantalla de bienvenida";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOSALIR') or ($status=='COMIENZO') or ($status=='SALIR') ) + { + $VDdisplayMESSAGE = "Vez desde que se conectó por última vez en:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "-Usted se conectó por última vez en:$last_action_date

Haga clic en Conectarse a continuación para acceder al sistema"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Cantidad de tiempo que se han registrado en:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'SALIR'; + $LOGtimeMESSAGE = "Iniciado la sesión en que usted en: $last_action_date
Cantidad de tiempo que se han registrado en:$totTIME_HMS

Haga clic a continuación para acceder SALIR-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Conexión Del Usuario:
Contraseña Del Usuario:
 

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_es/vdc_db_query.php b/LANG_www/agc_es/vdc_db_query.php index a0cba6aa..a0b7f4f8 100644 --- a/LANG_www/agc_es/vdc_db_query.php +++ b/LANG_www/agc_es/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Conexión:
\n"; + $VDdisplayMESSAGE.= "Manager Contraseña:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NÚMERO\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NÚMERO NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### COMIENZO 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "TELÉFONO ALT NÚMERO ESTADO NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count No es válido\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "TELÉFONO ALT NÚMERO ESTADO CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage No es válido\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### COMIENZO 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "REGISTRO NO ENTRADO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign No es válido\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "REGISTRO NO ENTRADO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id No es válido\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### COMIENZO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Insertado: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "REGISTRO NO ENTRADO\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "REGISTRO NO ENTRADO\n\n"; + } } else { - echo "REGISTRO NO ENTRADO\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_PARADA|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|GRABACIÓN_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send en to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If LLAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','SALIR','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### COMIENZO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1998,15 +3237,15 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSA',serverid='1';"; + # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### LLAMADABACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### COMIENZO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLESTADO',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### COMIENZO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('PAUSA',$stage)) {$QMstatus='PAUSAALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} + if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' ahora está en estado ' . $stage . "\n"; + echo 'Agent ' . $user . ' ahora está en estado ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2405,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'PausaCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -2418,14 +3809,15 @@ if ($ACTION == 'PausaCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### COMIENZO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2453,17 +3845,17 @@ if ($ACTION == 'PausaCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSAREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pausa Code has been updated to $status for $agent_log_id\n"; +echo " Pausa Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_es/vicidial.php b/LANG_www/agc_es/vicidial.php index b7272b81..5af8345c 100644 --- a/LANG_www/agc_es/vicidial.php +++ b/LANG_www/agc_es/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls en hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of segundos for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name en login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST en server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a DIAL link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups en campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Colgar al Cliente +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TeléfonoSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT DIAL by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call segundos counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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 DE TRANSFERENCIA 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -439,12 +585,13 @@ if ($relogin == 'YES') echo "web client VICIDIAL: Conexión Otra Vez\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Conexión Otra Vez
Contraseña Del Usuario:
Campaña: $camp_form_code
$camp_form_code
  \n"; +echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; echo "\n\n"; @@ -475,6 +623,7 @@ if ($user_login_first == 1) echo "web client VICIDIAL: Conexión en la Campaña\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Conexión Del Usuario

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,10 +656,10 @@ echo "
Conexión en la Campaña
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; @@ -518,12 +667,13 @@ echo "web client VICIDIAL: Conexión\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -556,12 +706,13 @@ if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) echo "web client VICIDIAL: Conexión Del Teléfono\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "
Conexión
\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('SALIR',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "USTED DEBE ENTRAR A LA PRIMERA TIMECLOCK
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("COMIENZO|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("COMIENZO|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: No hay cambios habilitado para su grupo de usuarios
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: No se le permite acceder fuera de su turno
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

GERENTE DE TRANSFERENCIA:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Conexión:
\n"; + $VDdisplayMESSAGE.= "Manager Contraseña:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,8 +920,8 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; @@ -640,6 +930,7 @@ $VDloginDISPLAY=0; echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Conexión Del Teléfono
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -901,6 +1269,7 @@ echo "web client VICIDIAL: Conexión en la Campaña\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,11 +1299,57 @@ echo "
Conexión en la Campaña
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) @@ -942,6 +1357,7 @@ if (!$authphone) echo "web client VICIDIAL: Conexión Del Teléfono Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo " - +
Conexión Error
0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } echo "web client VICIDIAL\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TeléfonoSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TeléfonoSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### COMIENZO SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NUEVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today en that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,19 +1768,19 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,17 +1810,17 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1336,6 +1832,7 @@ else echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -1359,6 +1856,7 @@ echo "
web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_segundos = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1808,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var PausaCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -1819,14 +2351,43 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Pausa\"\"Comienzo\""; - var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Comienzo\""; - var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Comienzo\""; - var DiaLControl_manual_HTML = "\"Marcar"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Comienzo\""; + var DiaLControl_auto_HTML_ready = "\"\"Comienzo\""; + var DiaLControl_auto_HTML_OFF = "\"\"Comienzo\""; + var DiaLControl_manual_HTML = "\"Marcar"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass en to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Marcar"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Dial"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'A MEDIDAER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentEstadoEstado").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentEstadoCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentEstadoDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_SALIR') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Estado: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause en next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus en vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working en API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "LLAMADAS ACTIVAS EN SU SESIÓN:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#CANAL REMOTOCOLGARVOLUMEN
" + loop_ct + "" + channelfieldA + "COLGAR
" + loop_ct + "" + channelfieldA + "COLGAR
" + loop_ct + "" + channelfieldA + "COLGAR          
" + loop_ct + "" + channelfieldA + "COLGAR          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Parar"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Comenzar"; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Comenzar"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Comenzar"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Capturar"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Aparcar"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Marcar el Siguiente Número"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Marcar Número de teléfono Alt: TELÉFONO PRINCIPAL or TELÉFONO ALT or DIRECCIÓN3 or ACABAR LEAD"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2833,7 +3707,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Comenzar"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comenzar"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2956,7 +3832,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 = "
# LLAMADABACK DATE/TIMENÚMERONAMEESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Grupo de Alias: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Haga clic aquí para escoger un grupo de alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + CIDcheck + "   Espeerar al Ring... " + MD_ring_secondS + " segundos"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + CIDcheck + "   Espeerar al Ring... " + MD_ring_secondS + " segundos"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Llamado: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Marcar el Siguiente Número request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Mostrar el Lead entonces MARCAR LEAD or SALTAR LEAD"; + var man_status = "Mostrar el Lead entonces MARCAR LEAD or SALTAR LEAD"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "TOLVA VACÍA") || (MDnextCID == "DNC NÚMERO") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "TOLVA VACÍA") - {alert("No más Leads en el hopper de la campaña:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("No más Leads en el hopper de la campaña:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("Este número de teléfono no está en la campaña de las listas:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Error no especificado:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; -// $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Colgar"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go en to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTeléfonoE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: DIRECCIÓN3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Código y número de teléfono: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Cambiar este número de teléfono a INACTIVAS";} + else + {EAactive_link = "Cambiar este número de teléfono a ACTIVO";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Activo:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Cuenta:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " LLAMADA NOT PLACED") { alert("la llamada no fue atendida, hubo un error:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   Espeerar al Ring..."; - - document.getElementById("HangupControl").innerHTML = "\"Colgar"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   Espeerar al Ring..."; + + document.getElementById("HangupControl").innerHTML = "\"Colgar"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Cambiar este número de teléfono a INACTIVAS";} + else + {EAactive_link = "Cambiar este número de teléfono a ACTIVO";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Activo:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,6 +5103,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Comentarios:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: DIRECCIÓN3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NÚMERO: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Código y número de teléfono: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Cambiar este número de teléfono a INACTIVAS";} + else + {EAactive_link = "Cambiar este número de teléfono a ACTIVO";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Activo:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Cuenta:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Entrante: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLCOLGAR"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4332,6 +5618,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // UPDATE VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,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 ="\"Marcar"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4703,29 +6014,76 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - showDiv('PausaCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - PausaCode_HTML = ''; - document.vicidial_form.PausaCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - PausaCode_HTML = "
# LLAMADABACK DATE/TIMENÚMERONAME ESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA COMMENTS
PAUSA CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - PausaCode_HTML = PausaCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {PausaCode_HTML = PausaCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - PausaCode_HTML = PausaCode_HTML + "


Vaya Detrás"; - document.getElementById("PausaCodeSelectContent").innerHTML = PausaCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Vaya Detrás";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Grupo de Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "A MEDIDAER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Vaya Detrás"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Marcar"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Dial"; + document.getElementById("HangupBothLines").innerHTML ="\"Colgar"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Usted debe seleccionar una disposición");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Formulario"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Marcar"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Dial"; + document.getElementById("HangupBothLines").innerHTML ="\"Colgar"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Usted debe seleccionar una disposición");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "reduzca al mínimo"; + document.getElementById("DispoSelectMaxMin").innerHTML = " reduzca al mínimo "; document.getElementById("DispoSelectHAspan").innerHTML = "Retraso Otra vez"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4891,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Pausa Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -4915,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PausaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Grupo de Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Grupo de Alias: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Grupo de Alias: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE SALIR LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Usted no puede salir durante un intento de marcado. \nEsperar 50 segundos para que el marcado falle si no es respondido");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to maximice +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maximice"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maximice "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to reduzca al mínimo +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "reduzca al mínimo"; + document.getElementById("DispoSelectMaxMin").innerHTML = " reduzca al mínimo "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Demostración the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("USTED DEBE CAMBIAR pausa GRUPOS"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Demostración the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5766,32 +7308,38 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentEstadoCalls');} if (agentcallsstatus != '1') {hideDiv('AgentEstadoSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PausaCodeLinkSpan").innerHTML = "INTRODUZCA Un CÓDIGO De la PAUSA"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "INTRODUZCA Un CÓDIGO De la PAUSA"; } if (VICIDiaL_allow_closers < 1) { document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comenzar"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "ENE";} + if (mon == 2) {statusmon = "FEB";} + if (mon == 3) {statusmon = "MAR";} + if (mon == 4) {statusmon = "ABR";} + if (mon == 5) {statusmon = "PUE";} + if (mon == 6) {statusmon = "JUN";} + if (mon == 7) {statusmon = "JUL";} + if (mon == 8) {statusmon = "AGO";} + if (mon == 9) {statusmon = "SEP";} + if (mon == 10) {statusmon = "OCT";} + if (mon == 11) {statusmon = "NOV";} + if (mon == 12) {statusmon = "DIC";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "ENE";} - if (Cmon == 1) {Cmon = "FEB";} - if (Cmon == 2) {Cmon = "MAR";} - if (Cmon == 3) {Cmon = "ABR";} - if (Cmon == 4) {Cmon = "PUE";} - if (Cmon == 5) {Cmon = "JUN";} - if (Cmon == 6) {Cmon = "JUL";} - if (Cmon == 7) {Cmon = "AGO";} - if (Cmon == 8) {Cmon = "SEP";} - if (Cmon == 9) {Cmon = "OCT";} - if (Cmon == 10) {Cmon = "NOV";} - if (Cmon == 11) {Cmon = "DIC";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "ENE";} + if (Cmon == 2) {customermon = "FEB";} + if (Cmon == 3) {customermon = "MAR";} + if (Cmon == 4) {customermon = "ABR";} + if (Cmon == 5) {customermon = "PUE";} + if (Cmon == 6) {customermon = "JUN";} + if (Cmon == 7) {customermon = "JUL";} + if (Cmon == 8) {customermon = "AGO";} + if (Cmon == 9) {customermon = "SEP";} + if (Cmon == 10) {customermon = "OCT";} + if (Cmon == 11) {customermon = "NOV";} + if (Cmon == 12) {customermon = "DIC";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6137,6 +7779,8 @@ else var buildDivHTML = " TELÉFONO DEL ALT
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6159,6 +7803,8 @@ else document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Transferencia"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Grupo de Alias: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Haga clic aquí para escoger un grupo de alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,9 +8001,12 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -SALIR\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +SALIR\n"; ?>
@@ -6338,7 +8015,7 @@ echo "\n";
VICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     sesión ID: VALIGN=MIDDLE ALIGN=CENTER>   LIVE     sesión ID:     Llamada Activa
@@ -6357,8 +8034,12 @@ echo "\n"; X SERVICIOS REPETIDOS ACTIVOS
- -
+ +
+
+ + segundos: +     @@ -6375,7 +8056,7 @@ echo "\n";
- + height=460>
SERVICIOS REPETIDOS PARA EL AGENTE :
Chasque encendido un servicio repetido abajo ahora para llamar la parte posteriora del cliente. Si usted chasca encendido un expediente abajo para llamarlo, será quitado de la lista.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
NUEVO PLOMO MANUAL DEL DIAL PARA :

Incorpore la información abajo para el nuevo plomo que usted desea llamar.
\n";
  (Esta opción si está comprobada procurará encontrar el número de teléfono en el sistema antes de insertarlo como nuevo plomo)


Si usted desea marcar un número y hacerlo no agregar como nuevo plomo, entre en dialstring exacto ese usted desean llamar en el campo de la invalidación del dial abajo. Al retraso esta llamada usted tendrá que abrir las LLAMADAS EN ESTE acoplamiento de la SESIÓN en el fondo de la pantalla y colgarlas para arriba chascando en su acoplamiento del canal allí.
 
+

+     +
+

Si usted desea marcar un número y hacerlo no agregar como nuevo plomo, entre en dialstring exacto ese usted desean llamar en el campo de la invalidación del dial abajo. Al retraso esta llamada usted tendrá que abrir las LLAMADAS EN ESTE acoplamiento de la SESIÓN en el fondo de la pantalla y colgarlas para arriba chascando en su acoplamiento del canal allí.
 
Inválidoación Del Dial:   (los dígitos satisfacen solamente)

-
Dial Ahora + Dial Ahora +                 + Vista previa de llamada                 Vaya Detrás
@@ -6430,7 +8117,7 @@ echo "\n"; -Su Estado:
Calls Dialing: +Su Estado:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Su Estado:
Calls Dialing: - Transferencia - Conferencia
+ Transferencia - Conferencia            
CLOSER LOCAL @@ -6451,8 +8138,8 @@ Su Estado:
Calls Dialing:   - INVALIDACIÓN DEL MARCADO   - ABANDONAR LLAMADA 3-WAY + INVALIDACIÓN DEL MARCADO   +
ABANDONAR LLAMADA 3-WAY Marcar Blind Transfer D1 D2 @@ -6512,7 +8199,31 @@ Su Estado:
Calls Dialing: + + height=70> + + + + + + +
Teléfono de Información ampliado Alt: reduzca al mínimo
+
+
+
+
+ +
+
+ + + + + +
maximice
Alt Teléfono Info
+
+ + height=500>
Nadie está en su sesión:
Vaya Detrás

@@ -6520,7 +8231,7 @@ Su Estado:
Calls Dialing: + height=500>
El cliente ha colgado:
Vaya Detrás

@@ -6529,7 +8240,7 @@ Su Estado:
Calls Dialing: + height=550>
Llamada Wrapup: segundos restantes en wrapup



@@ -6538,29 +8249,34 @@ Su Estado:
Calls Dialing: - height=500>
Se ha inhabilitado su sesión
SALIR

Vaya Detrás + + height=500>
Se ha inhabilitado su sesión
SALIR

Vaya Detrás
- + + height=500>
Hay un problema de sincronización de tiempo con su sistema, por favor, dígale a su administrador del sistema


Vaya Detrás +
+
+ + height=500>

SALIR
- +
- +
 
- + height=47>
Cualquier cambio realizado al cliente que no será la información abajo en este tiempo comitted, usted debe cambiar la información del cliente antes de usted retraso la llamada.
- - height=460>
DISPOSITION LLAMADA :       Retraso Otra vez       reduzca al mínimo
+ + height=460> - + @@ -2837,7 +2837,7 @@ echo "\n";
DISPOSITION LLAMADA :       Retraso Otra vez       reduzca al mínimo
selección de la disposición del End-of-call
PARAR LA LLAMADA
@@ -6572,15 +8288,26 @@ Su Estado:
Calls Dialing: + height=460>
SELECCIONE Un CÓDIGO De la PAUSA :
- Pausa Code Selection - + Pausa Code Selection +

 
- + + height=460>
SELECCIONAR UN GRUPO DE ALIAS :
+ Grupo de Selección de Alias + +

  +
+
+ + + + + height=460>"; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
Seleccione una fecha del servicio repetido :
@@ -6604,7 +8331,17 @@ Su Estado:
Calls Dialing: + + + + + + + + + +  

+ Comentarios de los CBES:

ENVIAR

@@ -6623,30 +8360,39 @@ Su Estado:
Calls Dialing: + height=460>
SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER
SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER
- BLENDED LLAMADAING(Salientes activdas)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + BLENDED LLAMADAING(Salientes activdas)
+ REINICIAR | ENVIAR



 
- + Canal Canal MI SERVICIO REPETIDO SOLAMENTE
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " BLENDED LLAMADAING
";} ?>
- height=>
VICIDIAL SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,14 +8402,22 @@ Su Estado:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> ->"; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
versión web client VICIDIAL:     CONSTRUCCION:               Servidor:              
+> +
versión web client VICIDIAL:     CONSTRUCCION:               Servidor:              
Mostrar la información del canal Conferencia

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
@@ -6672,12 +8426,12 @@ Su Estado:
Calls Dialing: - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ GRABACIÓN ID:
+
ESTADO:
-Marcar el Siguiente Número
+Marcar el Siguiente Número
MOSTRAR LEAD
TELÉFONO DEL ALT
@@ -6696,7 +8450,7 @@ GRABANDO ARCHIVO:
GRABACIÓN ID:
-Comenzar La Grabación
+Comenzar La Grabación

Formulario Web

@@ -6705,7 +8459,7 @@ GRABACIÓN ID:

Colgar al Cliente

-
Enviar DTMF

+
Enviar DTMF

- - + + +
segundos:   Canal:   Tiempo:   Customer Time:   Canal:
Información Del Cliente:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Título:   Primero:   IM:   Último:   Primero:   IM:   Último:
Dirección1:
Dirección2:   Dirección3: Dirección3:
Ciudad:   Estado:   Código Postal: Estado: CódigoPostal:
Provincia:   Vendedor ID: VendedorID: Género:
Teléfono:   Código Del Dial:   Teléfono Alt: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +Código Del Dial: Teléfono Alt:
Demostración:   Email: Email:
Comentarios: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_es/voicemail_check.php b/LANG_www/agc_es/voicemail_check.php index f153ee04..657fbe84 100644 --- a/LANG_www/agc_es/voicemail_check.php +++ b/LANG_www/agc_es/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_fr/active_list_refresh.php b/LANG_www/agc_fr/active_list_refresh.php index 013bf635..8eb27a79 100644 --- a/LANG_www/agc_fr/active_list_refresh.php +++ b/LANG_www/agc_fr/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_fr/astguiclient.php b/LANG_www/agc_fr/astguiclient.php index d1182304..ea455cc6 100644 --- a/LANG_www/agc_fr/astguiclient.php +++ b/LANG_www/agc_fr/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -185,7 +185,7 @@ echo "
0) { - fwrite ($fp, "VICICOMPOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICICOMPOSER|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + "
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " COMPOSER
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL
"; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " COMPOSER
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL
"; @@ -2794,7 +2794,7 @@ echo "\n";
Boite Vocale     NOUVEAU:     ANCIEN:             APPEL MANUEL       COMPOSER
Boite Vocale     NOUVEAU:     ANCIEN:             APPEL MANUEL       DIAL
APPELS EN ATTENTE: 0                EXTENSIONS LOCALES
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-PAUSE | DEBUT     Vitesse de rafraichissement: 1000 ms Plus rapidement | Plus lentement

+ARRÊT | DEBUT     Vitesse de rafraichissement: 1000 ms Plus rapidement | Plus lentement

Initialisation..
Extensions Actives
diff --git a/LANG_www/agc_fr/call_log_display.php b/LANG_www/agc_fr/call_log_display.php index 723cbca9..b7a379e9 100644 --- a/LANG_www/agc_fr/call_log_display.php +++ b/LANG_www/agc_fr/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_fr/conf_exten_check.php b/LANG_www/agc_fr/conf_exten_check.php index 415c0e14..7ad51245 100644 --- a/LANG_www/agc_fr/conf_exten_check.php +++ b/LANG_www/agc_fr/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Appels dans la file d'attente: $RingCalls";} + else {$RingCalls = "Appels dans la file d'attente: $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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Statut: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|DEBUT",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_DÉCONNEXION';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Statut: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Conférence $conf_exten a été attribué à $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_fr/inbound_popup.php b/LANG_www/agc_fr/inbound_popup.php index 12da02df..bc225893 100644 --- a/LANG_www/agc_fr/inbound_popup.php +++ b/LANG_www/agc_fr/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Numéro Composé: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Notes:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "RACCROCHER - \n"; echo "ENVOYEZ VERS MA BOITE VOCALE\n"; diff --git a/LANG_www/agc_fr/live_exten_check.php b/LANG_www/agc_fr/live_exten_check.php index 2a734ad9..3a54d0be 100644 --- a/LANG_www/agc_fr/live_exten_check.php +++ b/LANG_www/agc_fr/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_fr/manager_send.php b/LANG_www/agc_fr/manager_send.php index e0d38628..38f6eed9 100644 --- a/LANG_www/agc_fr/manager_send.php +++ b/LANG_www/agc_fr/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate commande envoyée pour Exten $exten Canal $channel sur $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate commande envoyée pour Exten $exten Canal $channel sur $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate commande envoyée pour Exten $exten Canal $channel sur $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Canal $channel est invalide or queryCID $queryCID est invalide, Hangup commande non insérée\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel n'est pas en ligne sur $call_server_ip, Checking Live Canal...\n"; + { + echo "Call $CalLCID $channel n'est pas en ligne sur $call_server_ip, Checking Live Canal...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Canal $channel n'est pas en ligne sur $call_server_ip, Hangup commande non insérée $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Canal $channel n'est pas en ligne sur $call_server_ip, Hangup commande non insérée $rowx[0]\n$stmt\n"; + echo "Canal $channel in use by another agent sur $call_server_ip, Hangup commande non insérée $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup commande envoyée pour Canal $channel sur $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### DEBUT 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup commande envoyée pour Canal $channel sur $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Une de ces variables est invalide:\n"; + echo "Canal $channel doit avoir plus de 2 caractères \n"; + echo "ExtraCanal $extrachannel doit avoir plus de 2 caractères \n"; + echo "queryCID $queryCID doit avoir plus de 14 caractères \n"; + echo "exten $exten est obligatoire\n"; + echo "ext_context $ext_context est obligatoire\n"; + echo "ext_priority $ext_priority est obligatoire\n"; + echo "\nRedirect Action pas envoyé\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference sur $server_ip, Redirect commande non insérée\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Il n'y a pas de conférence disponible sur $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel n'est pas en ligne sur $call_server_ip, Redirect commande non insérée\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel n'est pas en ligne sur $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel n'est pas en ligne sur $server_ip, Redirect commande non insérée\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel n'est pas en ligne sur $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect commande non insérée\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX commande envoyée pour Canal $channel sur $call_server_ip and \nHungup $extrachannel sur $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel sur $call_server_ip, Hungup $extrachannel sur $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel sur $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Une de ces variables est invalide:\n"; + echo "Canal $channel doit avoir plus de 2 caractères \n"; + echo "ExtraCanal $extrachannel doit avoir plus de 2 caractères \n"; + echo "queryCID $queryCID doit avoir plus de 14 caractères \n"; + echo "exten $exten est obligatoire\n"; + echo "ext_context $ext_context est obligatoire\n"; + echo "ext_priority $ext_priority est obligatoire\n"; + echo "session_id $session_id est obligatoire\n"; + echo "\nRedirect Action pas envoyé\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference sur $server_ip, Redirect commande non insérée\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Il n'y a pas de conférence disponible sur $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel n'est pas en ligne sur $call_server_ip, Redirect commande non insérée\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel n'est pas en ligne sur $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel n'est pas en ligne sur $server_ip, Redirect commande non insérée\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel n'est pas en ligne sur $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra commande envoyée pour Canal $channel and \nExtraCanal $extrachannel\n to $exten sur $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten sur $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra commande envoyée pour Canal $channel sur $call_server_ip and \nExtraCanal $extrachannel\n to $exten sur $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect commande envoyée pour Canal $channel sur $server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going sur in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 commande envoyée pour Conférence $exten, Stage $stage Canal $channel sur $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_fr/park_calls_display.php b/LANG_www/agc_fr/park_calls_display.php index c50f7365..bec5b6ae 100644 --- a/LANG_www/agc_fr/park_calls_display.php +++ b/LANG_www/agc_fr/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_fr/timeclock.php b/LANG_www/agc_fr/timeclock.php new file mode 100644 index 00000000..68ad3b3a --- /dev/null +++ b/LANG_www/agc_fr/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "L'utilisateur et le mot de passe que vous avez entrés ne sont pas actifs dans le système
S'il vous plaît essayez de nouveau:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Ouverture de Session:
Mot de passe Utilisateur:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='DEBUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='DEBUT'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'DEBUT') ) + { + ### You cannot log in or out within 30 secondes of your last login/logout + $VDdisplayMESSAGE = "Vous ne pouvez pas vous connecter ou dans un délai de 30 secondes de votre dernière connexion ou déconnexion"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Ouverture de Session:
Mot de passe Utilisateur:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTODÉCONNEXION') or ($status=='DEBUT') or ($status=='DÉCONNEXION') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Vous avez maintenant connecté à"; + $LOGtimeMESSAGE = "Vous vous êtes connecté à$NOW_TIME
Montant de temps vous avez été enregistrés dans:$totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='DÉCONNEXION', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='DÉCONNEXION', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='DÉCONNEXION', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTODÉCONNEXION') or ($status=='DEBUT') or ($status=='DÉCONNEXION') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERREUR: timeclock entrée de journal déjà fait:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "RETOUR à l'Agent Ouverture de Session Screen";} + if ($referrer=='admin') + {$BACKlink = "RETOUR à l'administration";} + if ($referrer=='welcome') + {$BACKlink = "RETOUR à l'écran de bienvenue";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTODÉCONNEXION') or ($status=='DEBUT') or ($status=='DÉCONNEXION') ) + { + $VDdisplayMESSAGE = "Temps écoulé depuis la dernière session ont été vous-en:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Vous dernière connecté à:$last_action_date

Cliquez ci-dessous pour LOGIN log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Montant de temps vous avez été enregistrés dans:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'DÉCONNEXION'; + $LOGtimeMESSAGE = "Vous vous êtes inscrit en ligne à: $last_action_date
Montant de temps vous avez été enregistrés dans:$totTIME_HMS

Cliquez ci-dessous pour vous connecter DÉCONNEXION-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Ouverture de Session:
Mot de passe Utilisateur:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_fr/vdc_db_query.php b/LANG_www/agc_fr/vdc_db_query.php index b9b7f19f..a272b6b3 100644 --- a/LANG_www/agc_fr/vdc_db_query.php +++ b/LANG_www/agc_fr/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Ouverture de Session:
\n"; + $VDdisplayMESSAGE.= "Manager Mot de passe:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NOMBRE\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NOMBRE NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### DEBUT 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "TELEPHONE 2nd. NOMBRE STATUT NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count est invalide\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "TELEPHONE 2nd. NOMBRE STATUT CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage est invalide\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### DEBUT 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "NOTATION NON ENTRÉE\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign est invalide\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "NOTATION NON ENTRÉE\n"; echo "uniqueid $uniqueid or lead_id: $lead_id est invalide\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### DEBUT QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Inséré: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "NOTATION NON ENTRÉE\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "NOTATION NON ENTRÉE\n\n"; + } } else { - echo "NOTATION NON ENTRÉE\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_ARRÊT|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|ENREGISTREMENT_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send sur to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send sur to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If APPELBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','DÉCONNEXION','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### DEBUT QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2000,13 +3239,13 @@ else # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### APPELBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### DEBUT QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUT',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### DEBUT QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' le statut actuel est ' . $stage . "\n"; + echo 'Agent ' . $user . ' le statut actuel est ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2418,14 +3809,15 @@ if ($ACTION == 'PauseCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### DEBUT QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2455,15 +3847,15 @@ if ($ACTION == 'PauseCodeSubmit') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pause Code has been updated to $status for $agent_log_id\n"; +echo " Pause Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_fr/vicidial.php b/LANG_www/agc_fr/vicidial.php index 16774d12..f6bbd929 100644 --- a/LANG_www/agc_fr/vicidial.php +++ b/LANG_www/agc_fr/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of secondes for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls sur hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of secondes for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name sur login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST sur server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a COMPOSER link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a COMPOSER link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups sur campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Raccrocher +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TéléphoneSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT COMPOSER by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call secondes counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='MANAGER OVERRIDE 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,15 +582,16 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "VICICOMPOSER Client Web: S'identifier à nouveau\n"; +echo "VICIDIAL Client Web: S'identifier à nouveau\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Français
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
S'identifier à nouveau
Mot de passe Utilisateur:
Campagne: $camp_form_code
$camp_form_code
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "VICICOMPOSER Client Web: Ouverture de Campagne\n"; + echo "VICIDIAL Client Web: Ouverture de Campagne\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Ouverture de Session

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,23 +656,24 @@ echo "
Ouverture de Campagne
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "VICICOMPOSER Client Web: Ouverture de Session\n"; + echo "VICIDIAL Client Web: Ouverture de Session\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -553,15 +703,16 @@ echo "
Ouverture de Session
VICICOMPOSER Client Web: Ouverture de Session téléphonique\n"; +echo "VICIDIAL Client Web: Ouverture de Session téléphonique\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Français
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('DÉCONNEXION',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "Vous devez vous connecter pour timeclock LE PREMIER
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("DEBUT|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("DEBUT|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERREUR: Il n'y a pas de changements activée pour votre groupe d'utilisateurs
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERREUR: Vous n'êtes pas autorisés à se connecter à l'extérieur de votre quart de travail
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

MANAGER OVERRIDE:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Ouverture de Session:
\n"; + $VDdisplayMESSAGE.= "Manager Mot de passe:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "VICICOMPOSER Client Web: VICICOMPOSER Ouverture de Campagne\n"; + echo "VICIDIAL Client Web: VICIDIAL Ouverture de Campagne\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Ouverture de Session téléphonique
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "VICICOMPOSER Client Web: Ouverture de Campagne\n"; + echo "VICIDIAL Client Web: Ouverture de Campagne\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Ouverture de Campagne
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "VICICOMPOSER Client Web: Ouverture de Session téléphonique Error\n"; + echo "VICIDIAL Client Web: Ouverture de Session téléphonique Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Ouverture de Session Error
VICICOMPOSER Client Web\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "VICIDIAL Client Web\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TéléphoneSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TéléphoneSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### DEBUT SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NOUVEAU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today sur that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,17 +1768,17 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,15 +1810,15 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1333,9 +1829,10 @@ else } else { - echo "VICICOMPOSER Client Web: VICICOMPOSER Ouverture de Campagne\n"; + echo "VICIDIAL Client Web: VICIDIAL Ouverture de Campagne\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -1356,9 +1853,10 @@ echo "
VICICOMPOSER Client Web: VICICOMPOSER Ouverture de Campagne\n"; + echo "VICIDIAL Client Web: VICIDIAL Ouverture de Campagne\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_secondes = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1819,14 +2351,43 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Pause\"\"Résumé\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"Résumé\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Résumé\""; - var DiaLControl_manual_HTML = "\"Appel"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Résumé\""; + var DiaLControl_auto_HTML_ready = "\"\"Résumé\""; + var DiaLControl_auto_HTML_OFF = "\"\"Résumé\""; + var DiaLControl_manual_HTML = "\"Appel"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass sur to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Appel"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Mettre"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'COUTUMEER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatutStatut").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatutCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatutDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_DÉCONNEXION') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Statut: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause sur next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus sur vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working sur API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "IL Y A DES APPELS EN COURS SUR VOTRE SESSION:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#CANAL DISTANTRACCROCHERVOLUME
" + loop_ct + "" + channelfieldA + "RACCROCHER
" + loop_ct + "" + channelfieldA + "RACCROCHER
" + loop_ct + "" + channelfieldA + "RACCROCHER          
" + loop_ct + "" + channelfieldA + "RACCROCHER          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Cesser"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Enregistrer\""; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Enregistrer\""; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Enregistrer\""; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, MISE EN ATT, FROMMISE EN ATT, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Recup."; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Mettre"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Appel Numéro Suivant"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Appel Numéro 2nd.: TÉLÉPHONE PRINCIPAL or TELEPHONE 2nd. or ADRESSE3 or TERMINER LA SAISIE"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICICOMPOSER Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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 = "\"Enregistrer\""; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Enregistrer\""; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2956,7 +3832,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 = "
# APPELBACK DATE/TIMENOMBRENAMESTATUTCAMPAIGNLAST APPEL DATE/TIME COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Groupe Alias: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Cliquez ici pour choisir un groupe Alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + CIDcheck + "   Attente... " + MD_ring_secondS + " secondes"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + CIDcheck + "   Attente... " + MD_ring_secondS + " secondes"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Appelé: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3240,7 +4154,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICICOMPOSER_LOG ENTRY FOR THIS APPEL PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS APPEL PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Appel Numéro Suivant request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Appel"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Appel"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Prévisualiser la fiche Prospect et APPELER or SUIVANT"; + var man_status = "Prévisualiser la fiche Prospect et APPELER or SUIVANT"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "LISTE D'APPEL VIDE") || (MDnextCID == "DNC NOMBRE") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "LISTE D'APPEL VIDE") - {alert("Plus de fiches clients éligibles pour cette campagne:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("Plus de fiches clients éligibles pour cette campagne:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("Ce numéro de téléphone n'est pas dans la campagne des listes:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Erreur non spécifiée:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Appel"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICICOMPOSER_web_QUERY_STRING =~ s/ /+/gi; -// $VICICOMPOSER_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Appel"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Appel"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go sur to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Appel"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Appel"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTéléphoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: ADRESSE3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Code et numéro de téléphone: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Modifiez ce numéro de téléphone à INACTIVE";} + else + {EAactive_link = "Modifiez ce numéro de téléphone à ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notes:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " APPEL NOT PLACED") { alert("l'appel n'a pas été composé, une erreur s'est produite:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + MDnextCID + "   Attente..."; - - document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + MDnextCID + "   Attente..."; + + document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Modifiez ce numéro de téléphone à INACTIVE";} + else + {EAactive_link = "Modifiez ce numéro de téléphone à ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICICOMPOSER_LOG ENTRY FOR THIS APPEL PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS APPEL PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Commentaires:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: ADRESSE3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT numéro: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Code et numéro de téléphone: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Modifiez ce numéro de téléphone à INACTIVE";} + else + {EAactive_link = "Modifiez ce numéro de téléphone à ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notes:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Entrant: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLRACCROCHER"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICICOMPOSER_LOG ENTRY FOR THIS APPEL PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS APPEL PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Appel"; + document.getElementById("DiaLControl").innerHTML = "\"Appel"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"QUITTER"; + // document.getElementById("Leave3WayCall").innerHTML ="\"QUITTER"; document.getElementById("DialWithCustomer").innerHTML ="\"Appel"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4699,7 +6010,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("VOUS DEVEZ ÊTRE FAIT UNE PAUSE POUR ÉCRIRE Un CODE De PAUSE DANS LeMODE D'AUTO-COMPOSER"); + alert("VOUS DEVEZ ÊTRE FAIT UNE PAUSE POUR ÉCRIRE Un CODE De PAUSE DANS LeMODE D'AUTO-DIAL"); } else { @@ -4717,15 +6028,62 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (loop_ct == VD_pause_codes_ct_half) {PauseCode_HTML = PauseCode_HTML + "
# APPELBACK DATE/TIMENOMBRENAME STATUTCAMPAIGNLAST APPEL DATE/TIME COMMENTS
";} } - PauseCode_HTML = PauseCode_HTML + "


Retour"; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Retour";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Groupe Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "COUTUMEER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Retour"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="
\"Appel"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Mettre"; + document.getElementById("HangupBothLines").innerHTML ="\"Raccrocher"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Vous devez choisir un status");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Appel"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Mettre"; + document.getElementById("HangupBothLines").innerHTML ="\"Raccrocher"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Vous devez choisir un status");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "réduire"; + document.getElementById("DispoSelectMaxMin").innerHTML = " réduire "; document.getElementById("DispoSelectHAspan").innerHTML = "Décrochement Encore"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Groupe Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Groupe Alias: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Groupe Alias: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Visualiser message that there are no voice channels in the VICICOMPOSER session +// Visualiser message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE DÉCONNEXION LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Vous ne pouvez pas vous déconnecter en cours de numérotation. \nAttendre 50 secondes sur non réponse");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "APPUYER ICI POUR VOUS IDENTIFIER\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "APPUYER ICI POUR VOUS IDENTIFIER\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to agrandir +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "agrandir"; + document.getElementById("DispoSelectMaxMin").innerHTML = " agrandir "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to réduire +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "réduire"; + document.getElementById("DispoSelectMaxMin").innerHTML = " réduire "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Visualiser the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("VOUS DEVEZ ÊTRE pause pour changer de groupe"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Visualiser the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5767,22 +7309,28 @@ else hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatutCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatutSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { document.getElementById("PauseCodeLinkSpan").innerHTML = "ÉCRIVEZ Un CODE De PAUSE"; } @@ -5791,7 +7339,7 @@ else document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Enregistrer\""; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Appel"; + document.getElementById("DiaLControl").innerHTML = "\"Appel"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "JAN";} + if (mon == 2) {statusmon = "FEV";} + if (mon == 3) {statusmon = "MAR";} + if (mon == 4) {statusmon = "AVR";} + if (mon == 5) {statusmon = "MAI";} + if (mon == 6) {statusmon = "JUN";} + if (mon == 7) {statusmon = "JUL";} + if (mon == 8) {statusmon = "AOÛ";} + if (mon == 9) {statusmon = "SEP";} + if (mon == 10) {statusmon = "OCT";} + if (mon == 11) {statusmon = "NOV";} + if (mon == 12) {statusmon = "DEC";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "JAN";} - if (Cmon == 1) {Cmon = "FEV";} - if (Cmon == 2) {Cmon = "MAR";} - if (Cmon == 3) {Cmon = "AVR";} - if (Cmon == 4) {Cmon = "MAI";} - if (Cmon == 5) {Cmon = "JUN";} - if (Cmon == 6) {Cmon = "JUL";} - if (Cmon == 7) {Cmon = "AOÛ";} - if (Cmon == 8) {Cmon = "SEP";} - if (Cmon == 9) {Cmon = "OCT";} - if (Cmon == 10) {Cmon = "NOV";} - if (Cmon == 11) {Cmon = "DEC";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "JAN";} + if (Cmon == 2) {customermon = "FEV";} + if (Cmon == 3) {customermon = "MAR";} + if (Cmon == 4) {customermon = "AVR";} + if (Cmon == 5) {customermon = "MAI";} + if (Cmon == 6) {customermon = "JUN";} + if (Cmon == 7) {customermon = "JUL";} + if (Cmon == 8) {customermon = "AOÛ";} + if (Cmon == 9) {customermon = "SEP";} + if (Cmon == 10) {customermon = "OCT";} + if (Cmon == 11) {customermon = "NOV";} + if (Cmon == 12) {customermon = "DEC";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6137,6 +7779,8 @@ else var buildDivHTML = " APPEL NUM. 2nd.
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6159,6 +7803,8 @@ else document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Transfert"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Groupe Alias: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Cliquez ici pour choisir un groupe Alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Résumé\"
\"Appel"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,18 +8001,21 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -DÉCONNEXION\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +DÉCONNEXION\n"; ?>
height=30> - + - +
VICICOMPOSERVICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     Id de session: VALIGN=MIDDLE ALIGN=CENTER>   LIVE     Id de session:     Appel en cours
@@ -6346,7 +8023,7 @@ echo "\n"; - height=>

VICICOMPOSER
+ height=>

VICIDIAL
@@ -6361,6 +8038,10 @@ echo "\n";
+ secondes: +     + + \n";
- + height=460>
RAPPELS PERSONNELS :
Selectionnez un rappel a éffectuer immédiatement. Une fois éffectué, ce rappel diparaitra de la liste.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
NOUVEL APPEL MANUEL VERS :

Nouveau prospect: remplissez le formulaire ci dessous.
\n";
  (Si cette option est activée, le numéro de téléphone sera recherché dans la base avant d'être inséré)


Si vous désirez composer un numéro sans insérer de nouvelle fiche client, entrez le N° a appeler dans le champ Surnumerotation. Pour raccrocher cet appel, vous devrez ouvrir la page Appels en Cours et raccrocher manuellement le canal correspondant.
 
+

+     +
+

Si vous désirez composer un numéro sans insérer de nouvelle fiche client, entrez le N° a appeler dans le champ Surnumerotation. Pour raccrocher cet appel, vous devrez ouvrir la page Appels en Cours et raccrocher manuellement le canal correspondant.
 
Surnumérotation:   (Ce champ n'accepte que des chiffres)

- Appel Manuel + Appel Manuel +                 + Preview Call                 Retour
@@ -6430,7 +8117,7 @@ echo "\n"; -Votre Statut:
Calls Dialing: +Votre Statut:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Votre Statut:
Calls Dialing: - Transfert - Conférence
+ Transfert - Conférence            
CLOSER LOCAL @@ -6451,8 +8138,8 @@ Votre Statut:
Calls Dialing:   - SURNUMEROTATION   - QUITTER LA CONF A 3 + SURNUMEROTATION   +
QUITTER LA CONF A 3 Transfert immédiat D1 D2 @@ -6512,7 +8199,31 @@ Votre Statut:
Calls Dialing: + + height=70> + + + + + + +
Extended Information Alt Téléphone: réduire
+
+
+
+
+ +
+
+ + + + + +
agrandir
Alt Téléphone Info
+
+ + height=500>
Votre session est vide:
Retour

@@ -6520,7 +8231,7 @@ Votre Statut:
Calls Dialing: + height=500>
Le client a raccroché:
Retour

@@ -6529,7 +8240,7 @@ Votre Statut:
Calls Dialing: + height=550>
Traitement Post Appel : secondes restant pour le traitement post appel



@@ -6538,29 +8249,34 @@ Votre Statut:
Calls Dialing: - height=500>
Votre session a été neutralisée
DÉCONNEXION

Retour + + height=500>
Votre session a été neutralisée
DÉCONNEXION

Retour
- + + height=500>
Il ya un problème de synchronisation avec votre système, s'il vous plaît dites-le à votre administrateur système


Retour +
+
+ + height=500>

DÉCONNEXION
- +
- +
 
- + height=47>
Aucune modification ne peut être prise en compte, les modifications doivent être validées avant de raccrocher.
- - height=460>
STATUER L'APPEL :       Décrochement Encore       réduire
+ + height=460>
STATUER L'APPEL :       Décrochement Encore       réduire
Selection du status de fin d'appel
PAUSE DE LA NUMEROTATION
@@ -6572,7 +8288,7 @@ Votre Statut:
Calls Dialing: + height=460>
CHOISISSEZ Un CODE De PAUSE :
Pause Code Selection @@ -6580,7 +8296,18 @@ Votre Statut:
Calls Dialing: + + height=460>
CHOISIR UN GROUPE ALIAS :
+ Groupe de sélection Alias + +

  +
+
+ + + + + height=460>\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
Choisissez une date de Rappel :
@@ -6604,7 +8331,17 @@ Votre Statut:
Calls Dialing: + + + + + + + + + +  

+ Commentaires du Rappel:

VALIDER

@@ -6623,30 +8360,39 @@ Votre Statut:
Calls Dialing: + height=460>
UN CHOIX DE GROUPE D'ARRIVÉE PLUS ÉTROIT
Un Choix De Groupe D'arrivée Plus étroit
- APPEL EN MODE BLENDED(Mode "Appels Sortants" Activé)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + APPEL EN MODE BLENDED(Mode "Appels Sortants" Activé)
+ REINITIALISATION | VALIDER



 
- + Canal Canal RAPPELS PERSONNELS
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " APPEL EN MODE BLENDED
";} ?>
- height=>
VICICOMPOSER SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,28 +8402,36 @@ Votre Statut:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> -> - +
VICICOMPOSER Client Web:     BUILD:               Serveur:              
+> +
VICIDIAL Client Web:     BUILD:               Serveur:              
Montrez les informations sur la conférence

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ IDENTIFIANT:
+
STATUT:
-Appel Numéro Suivant
+Appel Numéro Suivant
Prévisualisation
APPEL NUM. 2nd.
@@ -6696,7 +8450,7 @@ ENREGISTREMENT:
IDENTIFIANT:
-Enregistrer
+Enregistrer

Formulaire Web

@@ -6705,7 +8459,7 @@ IDENTIFIANT:

Raccrocher

-
Envoyez DTMF

+
Envoyez DTMF

- - + + +
secondes:   Canal:   Durée d'Appel:   Customer Time:   Canal:
Informations Client:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Titre:   Prenom:   Mi:  Nom:   Prenom:   Mi:  Nom:
Adresse1:
Adresse2:   Adresse3: Adresse3:
Ville:   État:   Code postal: État: CodePostal:
Province:   Code Vendeur: CodeVendeur: Sexe:
Téléphone:   DialCode:   Tel. 2nd: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +DialCode: Tel. 2nd:
Visualiser:   Email: Email:
Commentaires: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_fr/voicemail_check.php b/LANG_www/agc_fr/voicemail_check.php index 1d3f197c..c81c0882 100644 --- a/LANG_www/agc_fr/voicemail_check.php +++ b/LANG_www/agc_fr/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_it/conf_exten_check.php b/LANG_www/agc_it/conf_exten_check.php index 80ead1e4..f50dc165 100644 --- a/LANG_www/agc_it/conf_exten_check.php +++ b/LANG_www/agc_it/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -40,12 +40,15 @@ # 80703-1106 - Added API functionality for Hangup and Dispo # 81104-0229 - Added mysql error logging capability # 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # -$version = '2.0.4-15'; -$build = '81104-1409'; +$version = '2.0.5-18'; +$build = '90307-1855'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=14; +$mysql_log_count=17; $one_mysql_log=0; require("dbconnect.php"); @@ -252,8 +255,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 = "Calls in Queue: $RingCalls";} - else {$RingCalls = "Calls in Queue: $RingCalls";} + if ($RingCalls > 0) {$RingCalls = "Chiede, in coda: $RingCalls";} + else {$RingCalls = "Chiede, in coda: $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')) );"; @@ -294,19 +297,118 @@ echo " } ### grab the API hangup and API dispo fields in vicidial_live_agents - $stmt="SELECT external_hangup,external_status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $external_hangup = $row[0]; $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; if (strlen($external_status)<1) {$external_status = '::::::::::';} - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stato: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . "|\n"; + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|INIZIO",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_LOGOUT';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stato: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_it/inbound_popup.php b/LANG_www/agc_it/inbound_popup.php index 58ddc803..5e9d5b61 100644 --- a/LANG_www/agc_it/inbound_popup.php +++ b/LANG_www/agc_it/inbound_popup.php @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Numero chiamato: $row[8]
Note: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Note:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "RIAGGANCIA - \n"; echo "INVIA ALLA MIA VOICEMAIL\n"; diff --git a/LANG_www/agc_it/manager_send.php b/LANG_www/agc_it/manager_send.php index f1a879f5..c26c98e8 100644 --- a/LANG_www/agc_it/manager_send.php +++ b/LANG_www/agc_it/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 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 @@ -36,7 +36,11 @@ # - $session_id - ('8600051') # - $FROMvdc - ('YES','NO') # - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) - +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -78,12 +82,15 @@ # 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call # 81020-1459 - Fixed bugs in queue_log logging # 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # -$version = '2.0.5-35'; -$build = '81104-0203'; +$version = '2.0.5-38'; +$build = '90305-1040'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=82; +$mysql_log_count=83; $one_mysql_log=0; require("dbconnect.php"); @@ -159,6 +166,15 @@ if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -371,11 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} - echo "Originate comando inviato per Exten $exten Canale $channel su $server_ip\n"; + echo "Originate comando inviato per Exten $exten Canale $channel su $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -484,6 +516,29 @@ $rslt=mysql_query($stmt, $link); } } } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $channel_live=0; + echo "Canale $channel in use by another agent su $call_server_ip, Hangup comando non inserito $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } + } + else + { + echo "$stmt\n"; + } + } if ($channel_live==1) { diff --git a/LANG_www/agc_it/timeclock.php b/LANG_www/agc_it/timeclock.php new file mode 100644 index 00000000..c9cdfe14 --- /dev/null +++ b/LANG_www/agc_it/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "Lutente e la password che hai inserito non sono attivi nel sistema
Si prega di riprovare:"; + + echo"\n"; + echo"VICIDIAL:Orologio\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Orologio
 
Login Utente:
Password Utente:
 

VERSIONE: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='INIZIO', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='INIZIO'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'INIZIO') ) + { + ### You cannot log in or out within 30 secondi of your last login/logout + $VDdisplayMESSAGE = "Non è possibile accedere o entro 30 secondi del tuo ultimo accesso o il logout"; + + echo"\n"; + echo"VICIDIAL:Orologio\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Orologio
 
Login Utente:
Password Utente:
 

VERSIONE: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOLOGOUT') or ($status=='INIZIO') or ($status=='LOGOUT') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Lei ha appena effettuato laccesso-out"; + $LOGtimeMESSAGE = "Hai effettuato laccesso a$NOW_TIME
Importo di tempo sono state registrate in:$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';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOLOGOUT') or ($status=='INIZIO') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERRORE: orologio registro entrata già fatto:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "Torna alla schermata di login di agente";} + if ($referrer=='admin') + {$BACKlink = "BACK per Amministrazione";} + if ($referrer=='welcome') + {$BACKlink = "Torna alla schermata iniziale";} + + echo"\n"; + echo"VICIDIAL:Orologio\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Orologio
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSIONE: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOLOGOUT') or ($status=='INIZIO') or ($status=='LOGOUT') ) + { + $VDdisplayMESSAGE = "Tempo dallultimo registrato in:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "È lultima connesso a:$last_action_date

Clicca qui sotto per LOGIN log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Quantità di tempo è stato registrato in:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'LOGOUT'; + $LOGtimeMESSAGE = "Hai effettuato laccesso al-in: $last_action_date
Quantità di tempo è stato registrato in:$totTIME_HMS

Clicca qui sotto per LOGOUT log-out"; + } + + echo"\n"; + echo"VICIDIAL:Orologio\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Orologio
 
$LOGtimeMESSAGE
 
 

VERSIONE: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Orologio\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Orologio
 
Login Utente:
Password Utente:
 

VERSIONE: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_it/vdc_db_query.php b/LANG_www/agc_it/vdc_db_query.php index b3e1f9d7..70d4881d 100644 --- a/LANG_www/agc_it/vdc_db_query.php +++ b/LANG_www/agc_it/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -77,7 +77,12 @@ # - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) # - $conf_dialed = ('0','1') # - $leaving_threeway = ('0','1') - +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -174,13 +179,23 @@ # 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause # 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug # 81111-1630 - Added another hangup fix for non-hangup -# 81113-0724 - Fixed vicidial_agent_log bug +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.5-93'; -$build = '81113-0724'; +$version = '2.0.5-103'; +$build = '90307-1735'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=183; +$mysql_log_count=193; $one_mysql_log=0; require("dbconnect.php"); @@ -334,6 +349,16 @@ if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threew elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -446,7 +471,7 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) { echo "\n"; - echo "\n"; - - $o=0; - while ($camps_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - echo "\n"; + $VDdisplayMESSAGE = "ERRORE: Non ci sono cambiamenti abilitati per il tuo gruppo di utenti\n"; + $VDloginDISPLAY=1; } else { - echo "\n"; + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00193',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDdisplayMESSAGE = "ERRORE: Non ti è consentito di accedere al di fuori del proprio turno\n"; + $VDloginDISPLAY=1; + } + } + if ($VDloginDISPLAY > 0) + { + $loginDATE = date("Ymd"); + $VDdisplayMESSAGE.= "

Sovrascrive MANAGER:
\n"; + $VDdisplayMESSAGE.= "
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Password:
\n"; + $VDdisplayMESSAGE.= "




\n"; + echo "$VDdisplayMESSAGE"; + exit; } - exit; } -} + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; + } + exit; + } @@ -735,11 +847,24 @@ if ($ACTION == 'manDiaLnextCaLL') } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -750,7 +875,7 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} @@ -817,7 +942,8 @@ if ($ACTION == 'manDiaLnextCaLL') $gmt_offset_now = trim("$row[8]"); $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -961,9 +1087,19 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} @@ -974,7 +1110,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} @@ -985,6 +1121,14 @@ 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);} + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + ############################################# ##### INIZIO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; @@ -1115,6 +1259,34 @@ if ($ACTION == 'alt_phone_change') } +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage non e` valido\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -1200,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -1207,7 +1388,7 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} @@ -1218,7 +1399,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} @@ -1239,6 +1420,15 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# ##### INIZIO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; @@ -1310,7 +1500,7 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1367,6 +1557,10 @@ if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "LOG NON INSERITO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign non e` valido\n"; exit; @@ -1987,6 +2181,36 @@ if ($stage == "end") } } + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Inserito: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "LOG NON INSERITO\n"; + } + } + } + ##### update the duration and end time in the vicidial_log table $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2043,25 +2267,28 @@ if ($stage == "end") $affected_rows = mysql_affected_rows($link); } - if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + if ($enable_queuemetrics_logging > 0) { - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; - $rslt=mysql_query($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VAC_cc_ct = mysql_num_rows($rslt); - if ($VAC_cc_ct > 0) + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) { - $row=mysql_fetch_row($rslt); - $agent_complete = $row[0]; - } - if ($agent_complete < 1) - { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } } } } @@ -2142,7 +2369,7 @@ if ($stage == "end") ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel - if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) ) + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) { $loop_count=0; while($loop_count < $total_hangup) @@ -2374,7 +2601,7 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2542,7 +2769,7 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_default_xfer_group = $row[6]; if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2606,7 +2833,7 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_front_VDlog =$row[0]; } - $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2616,7 +2843,7 @@ if ($ACTION == 'VDADcheckINCOMING') $row=mysql_fetch_row($rslt); $VDCL_group_name = $row[0]; $VDCL_group_color = $row[1]; - $VDCL_group_web = $row[2]; + $VDCL_group_web = stripslashes($row[2]); $VDCL_fronter_display = $row[3]; $VDCL_ingroup_script = $row[4]; $VDCL_get_call_launch = $row[5]; @@ -2627,9 +2854,10 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_default_xfer_group = $row[10]; $VDCL_ingroup_recording_override = $row[11]; $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; - $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2647,6 +2875,33 @@ if ($ACTION == 'VDADcheckINCOMING') {$VDCL_xferconf_b_dtmf = $row[3];} if (strlen($VDCL_xferconf_b_number) < 1) {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } } ### update the comments in vicidial_live_agents record @@ -2659,7 +2914,7 @@ if ($ACTION == 'VDADcheckINCOMING') } else { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2673,12 +2928,39 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; } } ### if web form is set then send su to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} - else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -3109,19 +3391,23 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; -# if ($DB) {echo "$stmt\n";} -# $rslt=mysql_query($stmt, $link); -# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} -# $affected_rows = mysql_affected_rows($link); -# $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### CHIAMATABACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); $comments = eregi_replace("'",'',$comments); - $comments = eregi_replace("\\",' ',$comments); $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); diff --git a/LANG_www/agc_it/vicidial.php b/LANG_www/agc_it/vicidial.php index 12de61b6..abe62e6b 100644 --- a/LANG_www/agc_it/vicidial.php +++ b/LANG_www/agc_it/vicidial.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database @@ -207,12 +207,27 @@ # 81106-0411 - Changedthe campaign login list behaviour # 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause # 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.5-186'; -$build = '81110-1514'; +$version = '2.0.5-201'; +$build = '90307-1736'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=51; +$mysql_log_count=60; $one_mysql_log=0; require("dbconnect.php"); @@ -231,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -274,6 +291,7 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -285,7 +303,7 @@ $random = (rand(1000000, 9999999) + 10000000); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable FROM system_settings;"; +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -299,6 +317,10 @@ while ($i < $qm_conf_ct) $vdc_customer_date_format = $row[2]; $vdc_header_phone_format = $row[3]; $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; $i++; } @@ -333,12 +355,15 @@ $hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved chann $LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout $TelefonoSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login $DefaulTAlTDiaL = '0'; # set to 1 to enable ALT CHIAMA by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -424,6 +449,41 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='Sovrascrive MANAGER 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -525,13 +585,13 @@ if ($relogin == 'YES') echo "VICIDIAL web client: Re-Login\n"; echo "\n"; echo "\n"; -echo " Timeclock
\n"; +echo "Orologio
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Italiano
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -563,7 +623,7 @@ if ($user_login_first == 1) echo "VICIDIAL web client: Login Campagna\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "
Re-Login
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -572,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Login Utente

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -596,7 +656,7 @@ echo "
Login Campagna
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -607,13 +667,13 @@ echo "VICIDIAL web client: Login\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -646,13 +706,13 @@ if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) echo "VICIDIAL web client: Login Telefono\n"; echo "\n"; echo "\n"; -echo " Timeclock
\n"; +echo "Orologio
\n"; echo "
Login
\n"; echo "\n"; echo "\n";echo "\n";echo "
English Italiano
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -682,7 +742,7 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -694,23 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; - $VU_alter_custphone_override=$row[12]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "È necessario accedere al orologio LA PRIMA
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("INIZIO|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("INIZIO|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERRORE: Non ci sono cambiamenti abilitati per il tuo gruppo di utenti
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERRORE: Non ti è consentito di accedere al di fuori del proprio turno
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

Sovrascrive MANAGER:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Password:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -732,7 +930,7 @@ $VDloginDISPLAY=0; echo "VICIDIAL web client: VICIDIAL Login Campagna\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "
Login Telefono
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -835,14 +1033,14 @@ echo "
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -881,6 +1079,36 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -904,7 +1132,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; $rslt=mysql_query($stmt, $link); @@ -1014,7 +1269,7 @@ echo "VICIDIAL web client: Login Campagna\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -1023,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -1102,7 +1357,7 @@ if (!$authphone) echo "VICIDIAL web client: Login Telefono Error\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "
Login Campagna
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -1111,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -1441,8 +1696,7 @@ else if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1453,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1579,7 +1832,7 @@ else echo "VICIDIAL web client: VICIDIAL Login Campagna\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "
Login Error
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -1603,7 +1856,7 @@ echo "
VICIDIAL web client: VICIDIAL Login Campagna\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Orologio
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; @@ -1645,6 +1898,12 @@ echo "
\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1837,6 +2096,15 @@ $CCAL_OUT .= "
"; var CallBackCommenTs = ''; var scheduled_callbacks = ''; var dispo_check_all_pause = ''; + var api_check_all_pause = ''; + VARgroup_alias_ids = new Array(); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1946,7 +2214,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; @@ -1963,6 +2231,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var campaign_rec_filename = ''; var LIVE_campaign_recording = ''; var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -2053,6 +2325,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var three_way_call_cid = ''; var outbound_cid = ''; var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -2096,12 +2372,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var agentphonelive = 0; var conf_dialed = 0; var leaving_threeway = 0; + var blind_transfer = 0; var hangup_all_non_reserved = ''; var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; var DiaLControl_auto_HTML = "\"
\"Riprendi\""; var DiaLControl_auto_HTML_ready = "\"\"Riprendi\""; var DiaLControl_auto_HTML_OFF = "\"\"Riprendi\""; - var DiaLControl_manual_HTML = "\"Chiama"; + var DiaLControl_manual_HTML = "\"Chiama"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -2260,6 +2546,60 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() @@ -2298,8 +2638,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function SendManualDial(taskFromConf) { conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + document.getElementById("DialWithCustomer").innerHTML ="\"Chiama"; document.getElementById("ParkCustomerDial").innerHTML ="\"Metti"; @@ -2314,6 +2658,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {threeway_cid = outbound_cid;} if (three_way_call_cid == 'CLIENTEER') {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2334,22 +2684,25 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (omit_phone_code == 'Y') {var temp_phone_code = '';} else {var temp_phone_code = document.vicidial_form.phone_code.value;} - if (manual_string.length > 9) + if (manual_string.length > 7) {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO','','','','1');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2400,14 +2753,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else @@ -2430,12 +2788,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var queryCID = "DCagcW" + epoch_sec + user_abb;} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - if (taskcid.length > 3) - {var call_cid = taskcid;} - else - {var call_cid = campaign_cid;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2443,6 +2810,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + // alert(VMCoriginate_query); // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) @@ -2456,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2600,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_LOGOUT') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Stato: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2619,6 +3000,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var APIHanguP = APIHanguP_array[1]; var APIStatuS_array = check_time_array[7].split("APIStatuS: "); var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; if ( (APIHanguP==1) && (VD_live_customer_call==1) ) { hideDiv('CustomerGoneBox'); @@ -2632,7 +3017,78 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.DispoSelection.value = APIStatuS; DispoSelect_submit(); } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause su next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus su vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working su API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2901,6 +3357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, ATTESA, FROMATTESA, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { + blind_transfer=1; // conf_dialed=1; if (auto_dial_level == 0) {RedirecTxFEr = 1;} var xmlhttpXF=false; @@ -2956,7 +3413,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (omit_phone_code == 'Y') {var temp_phone_code = '';} else {var temp_phone_code = document.vicidial_form.phone_code.value;} - if (blindxferdialstring.length > 9) + if (blindxferdialstring.length > 7) {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } @@ -2986,8 +3443,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } @@ -3040,6 +3497,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -3051,6 +3509,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -3223,7 +3682,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -3419,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3451,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Gruppo Alias: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Clicca qui per scegliere un gruppo Alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3459,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3496,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3507,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3515,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3686,7 +4177,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Chiama il prossimo numero request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { inOUT = 'OUT'; all_record = 'NO'; @@ -3737,9 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter; - // alert(manual_dial_filter + "\n" +manDiaLnext_query); - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3769,13 +4269,13 @@ 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("This phone number is not in the campaign lists:\n" + mdnPhonENumbeR); alert_displayed=1;} + {alert("Questo numero di telefono non si trova nella campagna di elenchi:\n" + mdnPhonENumbeR); alert_displayed=1;} if (alert_displayed==0) - {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + {alert("Errore non specificato:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} if (starting_dial_level == 0) { - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; } else { @@ -3783,7 +4283,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; } else { @@ -3856,65 +4356,81 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var genderValue = document.getElementById('gender_list').options[genderIndex].value; document.vicidial_form.gender.value = genderValue; - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; -// $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - VDIC_web_form_address = VICIDiaL_web_form_address; + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3927,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3967,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3979,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -4086,16 +4603,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; } else { - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -4109,6 +4631,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefonoE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -4144,17 +4667,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dialed_label.match(REGalt_dial)) { document.getElementById("CusTInfOSpaN").innerHTML = " ALT CHIAMA NUMERO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefono Code and Number: " + EAphone_code + " " + EAphone_number; + document.getElementById("EAcommentsBoxA").innerHTML = "Codice e Numero di telefono: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Cambia il numero di telefono a INACTIVE";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Cambia il numero di telefono per ATTIVO";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; - document.getElementById("EAcommentsBoxD").innerHTML = "Note:
" + EAalt_phone_notes; + document.getElementById("EAcommentsBoxB").innerHTML = "Attivo:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Conte:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Note:
" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -4179,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -4188,6 +4723,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; @@ -4236,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -4268,7 +4809,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; } else { @@ -4284,7 +4825,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; } else { @@ -4410,11 +4951,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var EAactive_link = ''; if (APCactive == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Cambia il numero di telefono a INACTIVE";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Cambia il numero di telefono per ATTIVO";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxB").innerHTML = "Attivo:" + EAalt_phone_active + "
" + EAactive_link; var xmlhttp=false; /*@cc_on @*/ @@ -4498,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -4533,6 +5074,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_campaign_rec_filename = campaign_rec_filename;} + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -4635,17 +5191,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dialed_label.match(REGalt_dial)) { document.getElementById("CusTInfOSpaN").innerHTML = " ALT CHIAMA NUMERO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefono Code and Number: " + EAphone_code + " " + EAphone_number; + document.getElementById("EAcommentsBoxA").innerHTML = "Codice e Numero di telefono: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Cambia il numero di telefono a INACTIVE";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Cambia il numero di telefono per ATTIVO";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; - document.getElementById("EAcommentsBoxD").innerHTML = "Note: " + EAalt_phone_notes; + document.getElementById("EAcommentsBoxB").innerHTML = "Attivo:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Conte:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Note:" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -4700,69 +5256,82 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.gender.value = genderValue; - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} @@ -4788,7 +5357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) @@ -4797,6 +5366,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} window.clipboardData.setData('Text', tmp_clip.value) } + if (alert_enabled=='ON') + { + alert(" In entrata: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4827,76 +5400,88 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.gender.value = genderValue; } - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -4998,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "campaign" + group; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLRIAGGANCIA"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -5123,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; } reselect_alt_dial = 0; } @@ -5454,11 +6039,44 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } +// ################################################################################ +// Generate the Gruppo Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "CLIENTEER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Torna Indietro"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { leaving_threeway=0; + blind_transfer=0; document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; @@ -5478,7 +6096,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -5494,6 +6114,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var group = campaign;} leaving_threeway=0; + blind_transfer=0; document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; @@ -5539,16 +6160,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { - // var check_dispo = null; - // check_dispo = xmlhttp.responseText; - // var check_DS_array=check_dispo.split("\n"); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); - // if (check_DS_array[1] == 'Next agent_log_id:') - // { - // agent_log_id = check_DS_array[2]; - // } + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -5607,41 +6228,48 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NEW_ID"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } @@ -5692,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Gruppo Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Gruppo Alias: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Gruppo Alias: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -5710,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -5963,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5971,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Non puoi disconnetterti durante un tentativo di chiamata. \nAttende 50 secondi prima di fallire se non c`e` risposta");} @@ -6020,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('MainPanel'); showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Il tuo Shift è finita o è cambiato, è stato disconnesso dal tuo sessione

';} - document.getElementById("LogouTBoxLink").innerHTML = "FAI CLICK QUI PER AUTENTICARTI DI NUOVO\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "FAI CLICK QUI PER AUTENTICARTI DI NUOVO\n"; logout_stop_timeouts = 1; @@ -6205,6 +6852,7 @@ encoded=utf8_decode(xtest); var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -6247,6 +6895,7 @@ encoded=utf8_decode(xtest); SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -6290,6 +6939,7 @@ encoded=utf8_decode(xtest); var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -6332,6 +6982,7 @@ encoded=utf8_decode(xtest); encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } decoded=encoded; // simple no ? decoded = decoded.replace(RGnl, "
"); @@ -6645,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -6657,6 +7309,7 @@ else hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) @@ -6711,6 +7364,11 @@ else document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; } } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + + } VICIDiaL_closer_login_checked = 1; } else @@ -6743,7 +7401,7 @@ else if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -6864,6 +7522,7 @@ else if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -7221,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Trasferimento"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Gruppo Alias: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Clicca qui per scegliere un gruppo Alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -7233,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -7261,7 +7935,7 @@ else { if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"\"Riprendi\"
\"Chiama"; if (manual_dial_preview == 1) {buildDiv('DiaLLeaDPrevieW');} } @@ -7272,16 +7946,16 @@ else } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -7332,7 +8006,7 @@ echo "\n";    
0) {echo "GROUPS     \n";} ?> -LOGOUT\n"; ?> +LOGOUT\n"; ?>
@@ -7382,7 +8056,7 @@ echo "\n";
- + height=460>
RICHIAMI PER L`OPERATORE :
Selezionare una callback per chiamare il cliente ora. Una volta fatto click, il record sara` rimosso dalla lista.
@@ -7393,7 +8067,7 @@ echo "\n";
- + height=460> - +
NUOVA CHIAMATA MANUALE PER IL CONTATTO :

Inserisci le informazioni per il nuovo contatto da chiamare.
\n";
  (Questa opzione tentera` di trovare il numero di telefono nel sistema prima di inserire un nuovo contatto)


If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Chiamata automatica field below. To hangup this call you will have to open the CHIAMATAS IN THIS SESSION link at the bottom of the screen and hang it up by clicking su its channel link there.
 
+

+     +
+

If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Chiamata automatica field below. To hangup this call you will have to open the CHIAMATAS IN THIS SESSION link at the bottom of the screen and hang it up by clicking su its channel link there.
 
Chiamata automatica:   (solo digit per favore)

- Chiama Ora + Chiama Ora +                 + Anteprima invito                 Torna Indietro
@@ -7447,7 +8127,7 @@ Il tuo stato:
Calls Dialing: - Trasferimento - Conferenza
+ Trasferimento - Conferenza            
LOCAL CLOSER @@ -7522,7 +8202,7 @@ Il tuo stato:
Calls Dialing: px;z-index:26;" id="EAcommentsBox"> height=70> - +
Extended Alt Telefono Information: Estensione Alt Telefono informazioni: minimizza
@@ -7570,27 +8250,32 @@ Il tuo stato:
Calls Dialing: - height=500>
La tua sessione e` stata disabilitata
LOGOUT

Torna Indietro + height=500>
La tua sessione e` stata disabilitata
LOGOUT

Torna Indietro
- + + height=500>
Cè un problema di sincronizzazione con il tempo il vostro sistema, si prega di informare lamministratore di sistema


Torna Indietro +
+
+ + height=500>

LOGOUT
- +
- +
 
- + height=47>
Tutti i cambiamenti eseguiti sui dati del cliente non saranno salvati, bisogna effettuare le modifiche prima di riagganciare.
- + height=460>
ESITO CHIAMATA :       Aggancia di nuovo       minimizza
Selezione Esito di fine chiamata
@@ -7603,7 +8288,7 @@ Il tuo stato:
Calls Dialing: + height=460>
SELEZIONARE UN CODICE PAUSA:
Pausa Code Selection @@ -7611,10 +8296,18 @@ Il tuo stato:
Calls Dialing: + + height=460>
SCEGLI UN GRUPPO ALIAS :
+ Gruppo Alias selezione + +

  +
+
+ + - + height=460>
Selezionare una data di richiamo! :
@@ -7659,7 +8352,7 @@ Il tuo stato:
Calls Dialing: CHIAMATABACK PERSONALE (nessun altro potra` richiamarlo)
";} ?> - Note Richiamo:

+ Note Richiamo:

INVIA

@@ -7667,30 +8360,39 @@ Il tuo stato:
Calls Dialing: + height=460>
SELEZIONE del CLOSER INBOUND GROUP
Selezione del Closer Inbound Group
- CHIAMATA MISTA(outbound attivato)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + CHIAMATA MISTA(outbound attivato)
+ RESET | INVIA



 
- + Canale Canale CHIAMATABACK PERSONALE (nessun altro potra` richiamarlo)
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " CHIAMATA MISTA
";} ?>
- height=>
VICIDIAL SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -7700,11 +8402,19 @@ Il tuo stato:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> -> - + @@ -2837,7 +2837,7 @@ echo "\n";
Versione di VICIDIAL web-client:     BUILD:               Server:              
+> +"; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
Versione di VICIDIAL web-client:     BUILD:               Server:              
Mostra le informazioni relative al canale della conferenza

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
@@ -7716,12 +8426,12 @@ Il tuo stato:
Calls Dialing: - id="MainTable"> +
id="MainTable"> "; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
STATO:
-Chiama il prossimo numero
+Chiama il prossimo numero
LEAD PREVIEW
CHIAMA ALT NUM
@@ -7767,24 +8477,38 @@ ID Registrazione:
- + +
  Cust Time:   Canale:   Customer Time:   Canale:
Dati Cliente:
+ + + - + - + - + + + - + + + + + - + + + + + + + + + + - + + + - + + +
Titolo:   Nome:   MI:   Cognome:   Nome:   MI:   Cognome:
Indirizzo1:
Indirizzo2:   Indirizzo3: Indirizzo3:
Citta`:   Stato:   CAP: Stato: CAP:
Provincia:   Vendor ID:   Sesso: Vendor ID: Sesso:
Telefono: @@ -7796,27 +8520,35 @@ if ($disable_alter_custphone=='Y') } else { - echo ""; + echo ""; } ?> - -  Prefisso:   Num. Alternativo: Prefisso: Num. Alternativo:
Mostra:   Email: Email:
Note: + \n";} + {echo "\n";} else {echo "\n";} ?>
diff --git a/LANG_www/agc_pl/active_list_refresh.php b/LANG_www/agc_pl/active_list_refresh.php index 542f49d5..59562a68 100644 --- a/LANG_www/agc_pl/active_list_refresh.php +++ b/LANG_www/agc_pl/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_pl/astguiclient.php b/LANG_www/agc_pl/astguiclient.php index f3634f2c..6a54918a 100644 --- a/LANG_www/agc_pl/astguiclient.php +++ b/LANG_www/agc_pl/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -185,7 +185,7 @@ echo "
0) { - fwrite ($fp, "VICIWYBIERZ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICIWYBIERZ|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + "
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " WYBIERZ
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL
"; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " WYBIERZ
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL
"; @@ -2794,7 +2794,7 @@ echo "\n";
POCZTAGŁOSOWA     NOWY:     STARY:             WYBIERANIE RĘCZNE       WYBIERZ
POCZTAGŁOSOWA     NOWY:     STARY:             WYBIERANIE RĘCZNE       DIAL
ZAWIESZONE ROZMOWY: 0                NUMERY WEWNĘTRZNE
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-PRZERWA | START     Szybkość odswieżania: 1000 ms Szybciej | Wolniej

+BATENTE | START     Szybkość odswieżania: 1000 ms Szybciej | Wolniej

Inicjalizuje..
Aktywne numery wewnętrzne
diff --git a/LANG_www/agc_pl/call_log_display.php b/LANG_www/agc_pl/call_log_display.php index 7b4f7786..ec85b3a1 100644 --- a/LANG_www/agc_pl/call_log_display.php +++ b/LANG_www/agc_pl/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_pl/conf_exten_check.php b/LANG_www/agc_pl/conf_exten_check.php index a27ec4cf..ea606f21 100644 --- a/LANG_www/agc_pl/conf_exten_check.php +++ b/LANG_www/agc_pl/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Wzywa w kolejce: $RingCalls";} + else {$RingCalls = "Wzywa w kolejce: $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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|START",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_WYLOGUJ';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Konferencja $conf_exten został zarejestrowany $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_pl/inbound_popup.php b/LANG_www/agc_pl/inbound_popup.php index f94639af..a59cad88 100644 --- a/LANG_www/agc_pl/inbound_popup.php +++ b/LANG_www/agc_pl/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Wybierany numer: $row[8]
Notatki: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Uwagi:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "ROZŁĄCZ - \n"; echo "PRZEŚLIJ DO MOJEJ POCZTY GŁOSOWEJ\n"; diff --git a/LANG_www/agc_pl/live_exten_check.php b/LANG_www/agc_pl/live_exten_check.php index 441f8eca..5ad4d3c9 100644 --- a/LANG_www/agc_pl/live_exten_check.php +++ b/LANG_www/agc_pl/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_pl/manager_send.php b/LANG_www/agc_pl/manager_send.php index 8932ad9b..671667ae 100644 --- a/LANG_www/agc_pl/manager_send.php +++ b/LANG_www/agc_pl/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate komenda wysłana do Exten $exten Kanał $channel na $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate komenda wysłana do Exten $exten Kanał $channel na $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate komenda wysłana do Exten $exten Kanał $channel na $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Hangup komenda nie wstawiona\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel nie jest aktywna na $call_server_ip, Checking Live Kanał...\n"; + { + echo "Call $CalLCID $channel nie jest aktywna na $call_server_ip, Checking Live Kanał...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Hangup komenda nie wstawiona $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Kanał $channel nie jest aktywna na $call_server_ip, Hangup komenda nie wstawiona $rowx[0]\n$stmt\n"; + echo "Kanał $channel in use by another agent na $call_server_ip, Hangup komenda nie wstawiona $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup komenda wysłana do Kanał $channel na $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup komenda wysłana do Kanał $channel na $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Jedna z tych zmiennych nie jest prawidłowy:\n"; + echo "Kanał $channel musi mieć więcej niż 2 znaki\n"; + echo "ExtraKanał $extrachannel musi mieć więcej niż 2 znaki\n"; + echo "queryCID $queryCID musi mieć więcje niż 14 znaków\n"; + echo "exten $exten musi być ustawiony\n"; + echo "ext_context $ext_context musi być ustawiony\n"; + echo "ext_priority $ext_priority musi być ustawiony\n"; + echo "\nRedirect Action nie wysłano\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference na $server_ip, Redirect komenda nie wstawiona\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Nie mogę znaleźć wolnej konferencji na $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wstawiona\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel nie jest aktywna na $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wstawiona\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel nie jest aktywna na $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect komenda nie wstawiona\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX komenda wysłana do Kanał $channel na $call_server_ip and \nHungup $extrachannel na $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel na $call_server_ip, Hungup $extrachannel na $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel na $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Jedna z tych zmiennych nie jest prawidłowy:\n"; + echo "Kanał $channel musi mieć więcej niż 2 znaki\n"; + echo "ExtraKanał $extrachannel musi mieć więcej niż 2 znaki\n"; + echo "queryCID $queryCID musi mieć więcje niż 14 znaków\n"; + echo "exten $exten musi być ustawiony\n"; + echo "ext_context $ext_context musi być ustawiony\n"; + echo "ext_priority $ext_priority musi być ustawiony\n"; + echo "session_id $session_id musi być ustawiony\n"; + echo "\nRedirect Action nie wysłano\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference na $server_ip, Redirect komenda nie wstawiona\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Nie mogę znaleźć wolnej konferencji na $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wstawiona\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel nie jest aktywna na $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wstawiona\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel nie jest aktywna na $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra komenda wysłana do Kanał $channel and \nExtraKanał $extrachannel\n to $exten na $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten na $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra komenda wysłana do Kanał $channel na $call_server_ip and \nExtraKanał $extrachannel\n to $exten na $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect komenda wysłana do Kanał $channel na $server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going na in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 komenda wysłana do Konferencja $exten, Stage $stage Kanał $channel na $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_pl/park_calls_display.php b/LANG_www/agc_pl/park_calls_display.php index ff697873..c80e5901 100644 --- a/LANG_www/agc_pl/park_calls_display.php +++ b/LANG_www/agc_pl/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_pl/timeclock.php b/LANG_www/agc_pl/timeclock.php new file mode 100644 index 00000000..2b08079b --- /dev/null +++ b/LANG_www/agc_pl/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "Użytkownika i hasło podane nie są aktywne w systemie
Please try again:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login użytkownika:
Hasło użytkownika:
 

WERSJA: $version       KOMPILACJA: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + 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 "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'START') ) + { + ### You cannot log in or out within 30 sekundy of your last login/logout + $VDdisplayMESSAGE = "Nie można zalogować się w ciągu 30 sekund od ostatniego logowania lub wylogowywania"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login użytkownika:
Hasło użytkownika:
 

WERSJA: $version       KOMPILACJA: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOWYLOGUJ') or ($status=='START') or ($status=='WYLOGUJ') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Musisz się zalogować-out"; + $LOGtimeMESSAGE = "Możesz zalogować się na$NOW_TIME
Czas był zalogowany w:$totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='WYLOGUJ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='WYLOGUJ', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='WYLOGUJ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOWYLOGUJ') or ($status=='START') or ($status=='WYLOGUJ') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERROR: timeclock wpisu już wykonane:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "POWRÓT pełnomocnika do ekranu logowania";} + if ($referrer=='admin') + {$BACKlink = "POWRÓT do administracji";} + if ($referrer=='welcome') + {$BACKlink = "Powrót do ekranu powitalnego";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

WERSJA: $version       KOMPILACJA: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOWYLOGUJ') or ($status=='START') or ($status=='WYLOGUJ') ) + { + $VDdisplayMESSAGE = "Czas od twojego ostatniego logowania w:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Ostatniego zalogowanego obecnie pod adresem:$last_action_date

Kliknij poniżej, aby LOGOWANIE log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Kwota czas były rejestrowane w:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'WYLOGUJ'; + $LOGtimeMESSAGE = "Możesz zalogować się na stronie: $last_action_date
Kwota czas były rejestrowane w:$totTIME_HMS

Kliknij poniżej, aby zalogować WYLOGUJ-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

WERSJA: $version       KOMPILACJA: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Login użytkownika:
Hasło użytkownika:
 

WERSJA: $version       KOMPILACJA: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_pl/vdc_db_query.php b/LANG_www/agc_pl/vdc_db_query.php index 5c66d12a..075e3051 100644 --- a/LANG_www/agc_pl/vdc_db_query.php +++ b/LANG_www/agc_pl/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Hasło:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NUMER\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NUMER NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "NUMER ALT. NUMER STATUS NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count nie jest prawidłowy\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "NUMER ALT. NUMER STATUS CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage nie jest prawidłowy\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "Dziennik nie zapisany\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign nie jest prawidłowy\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "Dziennik nie zapisany\n"; echo "uniqueid $uniqueid or lead_id: $lead_id nie jest prawidłowy\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PRZERWAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PRZERWAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Wstawiony: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "Dziennik nie zapisany\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "Dziennik nie zapisany\n\n"; + } } else { - echo "Dziennik nie zapisany\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_BATENTE|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|NAGRYWAJ_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send na to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send na to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If RozmowaBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','WYLOGUJ','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1998,15 +3237,15 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PRZERWA',serverid='1';"; + # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### RozmowaBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('PRZERWA',$stage)) {$QMstatus='PRZERWAALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} + if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' ma statusie ' . $stage . "\n"; + echo 'Agent ' . $user . ' ma statusie ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2405,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'PrzerwaCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -2418,14 +3809,15 @@ if ($ACTION == 'PrzerwaCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2453,17 +3845,17 @@ if ($ACTION == 'PrzerwaCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PRZERWAREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Przerwa Code has been updated to $status for $agent_log_id\n"; +echo " Przerwa Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_pl/vicidial.php b/LANG_www/agc_pl/vicidial.php index 82d9ef8d..118cbaa2 100644 --- a/LANG_www/agc_pl/vicidial.php +++ b/LANG_www/agc_pl/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of sekundy for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls na hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of sekundy for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name na login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST na server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a WYBIERZ link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a WYBIERZ link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups na campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Odłącz kilenta +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TelefonSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT WYBIERZ by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call sekundy counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='KIEROWNIK nadrzędne 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,15 +582,16 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "klient VICIWYBIERZ: Powtórne zalogowanie\n"; +echo "klient VICIDIAL: Powtórne zalogowanie\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Polski
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Powtórne zalogowanie
Hasło użytkownika:
Kampania: $camp_form_code
$camp_form_code
  \n"; +echo "

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "klient VICIWYBIERZ: Logowanie do kampani\n"; + echo "klient VICIDIAL: Logowanie do kampani\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Login użytkownika

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,23 +656,24 @@ echo "
Logowanie do kampani
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "klient VICIWYBIERZ: Login\n"; + echo "klient VICIDIAL: Login\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -553,15 +703,16 @@ echo "
Login
klient VICIWYBIERZ: Login telefonu\n"; +echo "klient VICIDIAL: Login telefonu\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Polski
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('WYLOGUJ',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "Należy zalogować się do TIMECLOCK PIERWSZEJ
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("START|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("START|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "BŁĄD: Brak Przesuwa aktywny dla grupy użytkowników
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "BŁĄD: Nie masz uprawnień, aby zalogować się poza swoim zmiany
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

KIEROWNIK nadrzędne:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Login:
\n"; + $VDdisplayMESSAGE.= "Manager Hasło:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; + echo "klient VICIDIAL: VICIDIAL Logowanie do kampani\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Login telefonu
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "klient VICIWYBIERZ: Logowanie do kampani\n"; + echo "klient VICIDIAL: Logowanie do kampani\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Logowanie do kampani
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "klient VICIWYBIERZ: Login telefonu Error\n"; + echo "klient VICIDIAL: Login telefonu Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Login Error
klient VICIWYBIERZ\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "klient VICIDIAL\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TelefonSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TelefonSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NOWY record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today na that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,19 +1768,19 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PRZERWAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,17 +1810,17 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PRZERWAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1333,9 +1829,10 @@ else } else { - echo "klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; + echo "klient VICIDIAL: VICIDIAL Logowanie do kampani\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -1356,9 +1853,10 @@ echo "
klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; + echo "klient VICIDIAL: VICIDIAL Logowanie do kampani\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_sekundy = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1808,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var PrzerwaCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -1819,14 +2351,43 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Przerwa\"\"Ponów\""; - var DiaLControl_auto_HTML_ready = "\"Przerwa\"\"Ponów\""; - var DiaLControl_auto_HTML_OFF = "\"Przerwa\"\"Ponów\""; - var DiaLControl_manual_HTML = "\"Wybierz"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Ponów\""; + var DiaLControl_auto_HTML_ready = "\"\"Ponów\""; + var DiaLControl_auto_HTML_OFF = "\"\"Ponów\""; + var DiaLControl_manual_HTML = "\"Wybierz"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass na to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Zawieś"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'UŻYTKOWNIKAER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_WYLOGUJ') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Status: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause na next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus na vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working na API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "AKTYWNE ROZMOWY W TWOJEJ SESJI:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#KANAŁ ZDALNYROZŁĄCZVOLUME
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ          
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Zakończ"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Rozpocznij"; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Rozpocznij"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Rozpocznij"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Przejmij"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Zawieś"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Wybierz kolejny numer"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Zadzwoń pod numer alt.: NUMER PODSTAWOWY or NUMER ALT. or ADRES3 or ZAKOŃCZ WPROWADZANIE DANYCH"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICIWYBIERZ Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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 = "\"Rozpocznij"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Rozpocznij"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2956,7 +3832,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 = "
# RozmowaBACK DATE/TIMENUMERNAMESTATUSCAMPAIGNLAST POŁĄCZENIE DATA/CZAS COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Nazwa grupy: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Kliknij tutaj, aby wybrać grupy Alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + CIDcheck + "   Czeka na dzwonek... " + MD_ring_secondS + " sekundy"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + CIDcheck + "   Czeka na dzwonek... " + MD_ring_secondS + " sekundy"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Zadzwoniono: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3240,7 +4154,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS Rozmowa PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Wybierz kolejny numer request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Podejżyj dane połączenia i WYBIERZ POŁĄCZENIE or POMIŃ POŁĄCZENIE"; + var man_status = "Podejżyj dane połączenia i WYBIERZ POŁĄCZENIE or POMIŃ POŁĄCZENIE"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "Zasobnik pusty") || (MDnextCID == "DNC NUMER") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "Zasobnik pusty") - {alert("W zasobniku nie ma już więcej konaktów do wykonania połączeń dla tej kampanii:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("W zasobniku nie ma już więcej konaktów do wykonania połączeń dla tej kampanii:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("Ten telefon nie jest w kampanii list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Nieokreślony błąd:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIWYBIERZ_web_QUERY_STRING =~ s/ /+/gi; -// $VICIWYBIERZ_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Odłącz"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go na to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefonE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: ADRES3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefon Kod i numer: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Zmień to numer telefonu do nieaktywne";} + else + {EAactive_link = "Zmień to numer telefonu do CZYNNEJ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktywne:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Uwagi:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " Rozmowa NOT PLACED") { alert("nie wykonano połączenia, wystąpił błąd:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + MDnextCID + "   Czeka na dzwonek..."; - - document.getElementById("HangupControl").innerHTML = "\"Odłącz"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + MDnextCID + "   Czeka na dzwonek..."; + + document.getElementById("HangupControl").innerHTML = "\"Odłącz"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Zmień to numer telefonu do nieaktywne";} + else + {EAactive_link = "Zmień to numer telefonu do CZYNNEJ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktywne:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS Rozmowa PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Komentarz:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: ADRES3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT WYBIERZ NUMER: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefon Kod i numer: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Zmień to numer telefonu do nieaktywne";} + else + {EAactive_link = "Zmień to numer telefonu do CZYNNEJ";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Aktywne:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Uwagi:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Przychodząca: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLROZŁĄCZ"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS Rozmowa PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"WYJDŹ"; + // document.getElementById("Leave3WayCall").innerHTML ="\"WYJDŹ"; document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4703,29 +6014,76 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - showDiv('PrzerwaCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - PrzerwaCode_HTML = ''; - document.vicidial_form.PrzerwaCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - PrzerwaCode_HTML = "
# RozmowaBACK DATE/TIMENUMERNAME STATUSCAMPAIGNLAST POŁĄCZENIE DATA/CZAS COMMENTS
PRZERWA CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - PrzerwaCode_HTML = PrzerwaCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {PrzerwaCode_HTML = PrzerwaCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - PrzerwaCode_HTML = PrzerwaCode_HTML + "


Wróć"; - document.getElementById("PrzerwaCodeSelectContent").innerHTML = PrzerwaCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Wróć";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Nazwa grupy Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "UŻYTKOWNIKAER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Wróć"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Zawieś"; + document.getElementById("HangupBothLines").innerHTML ="\"Rozłącz"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Musisz wybrać rezultat rozmowy");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Zawieś"; + document.getElementById("HangupBothLines").innerHTML ="\"Rozłącz"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Musisz wybrać rezultat rozmowy");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimalizuj"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimalizuj "; document.getElementById("DispoSelectHAspan").innerHTML = "Rozłącz się ponownie"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4891,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Przerwa Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('PrzerwaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -4915,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PrzerwaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Nazwa grupy + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Nazwa grupy: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Nazwa grupy: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Pokaż message that there are no voice channels in the VICIWYBIERZ session +// Pokaż message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE WYLOGUJ LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Nie możesz wylogować się w trakcie dokonywania połączenia. \nPoczekaj 50 sekund aby, w przypadku nieodebrania, połączenie nie doszło do skutku");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,56 +6982,154 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + // ################################################################################ -// Move the Dispo frame out of the way and change the link to maksymalizuj +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + + +// ################################################################################ +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maksymalizuj"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maksymalizuj "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to minimalizuj +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimalizuj"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimalizuj "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Pokaż the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("Musisz być Paused ZMIANA DO GRUPY"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Pokaż the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5766,32 +7308,38 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('PrzerwaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatusSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PrzerwaCodeLinkSpan").innerHTML = "WCHODZĄ SZYFR PRZERWY"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "WCHODZĄ SZYFR PRZERWY"; } if (VICIDiaL_allow_closers < 1) { document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Rozpocznij"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; + document.getElementById("DiaLControl").innerHTML = "\"Wybierz"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "STY";} + if (mon == 2) {statusmon = "LUT";} + if (mon == 3) {statusmon = "MAR";} + if (mon == 4) {statusmon = "KWI";} + if (mon == 5) {statusmon = "MAJ";} + if (mon == 6) {statusmon = "CZE";} + if (mon == 7) {statusmon = "LIP";} + if (mon == 8) {statusmon = "SIE";} + if (mon == 9) {statusmon = "WRZ";} + if (mon == 10) {statusmon = "PAŹ";} + if (mon == 11) {statusmon = "LIS";} + if (mon == 12) {statusmon = "GRU";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "STY";} - if (Cmon == 1) {Cmon = "LUT";} - if (Cmon == 2) {Cmon = "MAR";} - if (Cmon == 3) {Cmon = "KWI";} - if (Cmon == 4) {Cmon = "MAJ";} - if (Cmon == 5) {Cmon = "CZE";} - if (Cmon == 6) {Cmon = "LIP";} - if (Cmon == 7) {Cmon = "SIE";} - if (Cmon == 8) {Cmon = "WRZ";} - if (Cmon == 9) {Cmon = "PAŹ";} - if (Cmon == 10) {Cmon = "LIS";} - if (Cmon == 11) {Cmon = "GRU";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "STY";} + if (Cmon == 2) {customermon = "LUT";} + if (Cmon == 3) {customermon = "MAR";} + if (Cmon == 4) {customermon = "KWI";} + if (Cmon == 5) {customermon = "MAJ";} + if (Cmon == 6) {customermon = "CZE";} + if (Cmon == 7) {customermon = "LIP";} + if (Cmon == 8) {customermon = "SIE";} + if (Cmon == 9) {customermon = "WRZ";} + if (Cmon == 10) {customermon = "PAŹ";} + if (Cmon == 11) {customermon = "LIS";} + if (Cmon == 12) {customermon = "GRU";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6134,9 +7776,11 @@ else } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " WYBIERANIE DRUGIEGO NUMERU
"; + var buildDivHTML = " WYBIERANIE ALT NUM
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6155,10 +7799,12 @@ else if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " WYBIERANIE DRUGIEGO NUMERU
"; + var buildDivHTML = " WYBIERANIE ALT NUM
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Transfer"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Nazwa grupy: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Kliknij tutaj, aby wybrać grupy Alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Ponów\"
\"Wybierz"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,18 +8001,21 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -WYLOGUJ\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +WYLOGUJ\n"; ?>
height=30> - + - +
VICIWYBIERZVICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     ID sesji: VALIGN=MIDDLE ALIGN=CENTER>   LIVE     ID sesji:     Aktywna rozmowa
@@ -6346,7 +8023,7 @@ echo "\n"; - height=>

VICIWYBIERZ
+ height=>

VICIDIAL
@@ -6357,8 +8034,12 @@ echo "\n"; X AKTYWNE INNE TERMINY
- -
+ +
+
+ + sekundy: +     @@ -6375,7 +8056,7 @@ echo "\n";
- + height=460>
INNE TERMINY DLA AGENTA :
Kliknij poniżej na Inne terminy żeby teraz zadzwonić do klienta. Jeżeli klikniesz na rekordzie by zadzwonić, rekord zostanie usunięty z listy.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
NOWE RĘCZNE WYBIERANIE NUMERU DLA :

Wpisz poniżej informacje o kontakcie do którego chcesz wykonać połączenie.
\n";
  (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


Jeżeli chcesz wybrać numer tak aby NIE został dodany jako nowy kontakt, wpisz dokładny numer telefonu w polu Wybierz ten numer poniżej. By zakończyć połączenie musisz otworzyć ROZMOWY W TEJ SESJI (w dole ekranu), i zakończyć połączenie klinając na link jego kanału..
 
+

+     +
+

Jeżeli chcesz wybrać numer tak aby NIE został dodany jako nowy kontakt, wpisz dokładny numer telefonu w polu Wybierz ten numer poniżej. By zakończyć połączenie musisz otworzyć ROZMOWY W TEJ SESJI (w dole ekranu), i zakończyć połączenie klinając na link jego kanału..
 
Wybierz ten numer:   (tylko cyfry)

- Wybierz teraz + Wybierz teraz +                 + Podgląd połączeń                 Wróć
@@ -6430,7 +8117,7 @@ echo "\n"; -Twój Status:
Calls Dialing: +Twój Status:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Twój Status:
Calls Dialing: - Transfer - Konferencja
+ Transfer - Konferencja            
LOKALNY FINALIZUJĄCYCH @@ -6451,8 +8138,8 @@ Twój Status:
Calls Dialing:   - WYBIERZ TEN NUMER   - WYJDŹ Z ROZMOWY 3-STRONNEJ + WYBIERZ TEN NUMER   +
WYJDŹ Z ROZMOWY 3-STRONNEJ Wybierz numer do nieweryfikowanego transferu D1 D2 @@ -6512,7 +8199,31 @@ Twój Status:
Calls Dialing: + + height=70> + + + + + + +
Rozszerzony Alt telefonu: minimalizuj
+
+
+
+
+ +
+
+ + + + + +
maksymalizuj
Alt Telefon Info
+
+ + height=500>
Nikt nie uczestniczy w Twojej sesji:
Wróć

@@ -6520,7 +8231,7 @@ Twój Status:
Calls Dialing: + height=500>
Klient sie rozłączył:
Wróć

@@ -6529,7 +8240,7 @@ Twój Status:
Calls Dialing: + height=550>
Call Wrapup sekundy remaining in wrapup



@@ -6538,29 +8249,34 @@ Twój Status:
Calls Dialing: - height=500>
Wasza sesja była uszkadzana
WYLOGUJ

Wróć + + height=500>
Wasza sesja była uszkadzana
WYLOGUJ

Wróć
- + + height=500>
Istnieje problem synchronizacji czasu z systemem, należy powiadomić administratora systemu


Wróć +
+
+ + height=500>

WYLOGUJ
- +
- +
 
- + height=47>
Zmiany wprowadzone w informacjach o kliencie będą zapisane tylko podczas trwania połączenia. Nie po rozłączaniu!.
- - height=460> - + @@ -2837,7 +2837,7 @@ echo "\n";
REZULTAT ROZMOWY :       Rozłącz się ponownie       minimalizuj
+ + height=460>"; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
REZULTAT ROZMOWY :       Rozłącz się ponownie       minimalizuj
Koniec rozmowy, wybierz rezultat
ZATRZYMAJ DZWONIENIE
@@ -6572,15 +8288,26 @@ Twój Status:
Calls Dialing: + height=460>
WYBÓR SZYFR PRZERWY :
- Przerwa Code Selection - + Przerwa Code Selection +

 
- + + height=460>
Wybierz grupę Alias :
+ Wybór grupy Alias + +

  +
+
+ + + + + height=460>"; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
Wybierz datę oddzwonienia :
@@ -6604,7 +8331,17 @@ Twój Status:
Calls Dialing: + + + + + + + + + +  

+ Notatki:

ZATWIERDŹ

@@ -6623,30 +8360,39 @@ Twój Status:
Calls Dialing: + height=460>
SELEKCJA GRUPY ZAWNĘTRZNYCH FINALIZUJĄCYCH
Selekcja grupy zawnętrznych finalizujących
- KOMBINOWANE POŁĄCZENIA(wychodzące aktywowane)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + KOMBINOWANE POŁĄCZENIA(wychodzące aktywowane)
+ RESET | ZATWIERDŹ



 
- + Kanał Kanał TYLKO MOJE INNE TERMINY
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " KOMBINOWANE POŁĄCZENIA
";} ?>
- height=>
VICIWYBIERZ SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,37 +8402,45 @@ Twój Status:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> -> - +
wersja klienta VICIWYBIERZ:     KOMPILACJA:               Serwer:              
+> +
wersja klienta VICIDIAL:     KOMPILACJA:               Serwer:              
Pokaż informacje o kanałach konferencyjnych

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ NUMER NAGRANIA:
+
STATUS:
-Wybierz kolejny numer
+Wybierz kolejny numer
PODGLĄD POŁĄCZEŃ
- WYBIERANIE DRUGIEGO NUMERU
+ WYBIERANIE ALT NUM
@@ -6696,7 +8450,7 @@ PLIK NAGRANIA:
NUMER NAGRANIA:
-Rozpocznij nagrywanie
+Rozpocznij nagrywanie

Web Formularz

@@ -6705,7 +8459,7 @@ NUMER NAGRANIA:

Odłącz kilenta

-
Wyślij tonowo

+
Wyślij tonowo

- - + + +
sekundy:   Kanał:   Ustawiony Czas:   Customer Time:   Kanał:
Informacje o kliencie:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Tytuł:   Imię:   2 Imię:   Nazwisko:   Imię:   2 Imię:   Nazwisko:
Adres1:
Adres2:   Adres3: Adres3:
Miasto:   Stan:   KodPocztowy: Stan: KodPocztowy:
Powiat:   Vendedor ID: Vendedor ID: Płeć:
Telefon:   Prefiks:   Drugi telefon: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +Prefiks: Drugi telefon:
Pokaż:   Email: Email:
Komentarz: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_pl/voicemail_check.php b/LANG_www/agc_pl/voicemail_check.php index ffdc3ed9..60408a8e 100644 --- a/LANG_www/agc_pl/voicemail_check.php +++ b/LANG_www/agc_pl/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_pt/active_list_refresh.php b/LANG_www/agc_pt/active_list_refresh.php index 0b915374..0354379d 100644 --- a/LANG_www/agc_pt/active_list_refresh.php +++ b/LANG_www/agc_pt/active_list_refresh.php @@ -1,33 +1,33 @@ LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - +# active_list_refresh.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to serve updates of the live data to the display scripts +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $ADD - ('1','2','3','4','5') +# - $order - ('asc','desc') +# - $format - ('text','table','menu','selectlist','textarea') +# - $bgcolor - ('#123456','white','black','etc...') +# - $txtcolor - ('#654321','black','white','etc...') +# - $txtsize - ('1','2','3','etc...') +# - $selectsize - ('2','3','4','etc...') +# - $selectfontsize - ('8','10','12','etc...') +# - $selectedext - ('cc100') +# - $selectedtrunk - ('Zap/25-1') +# - $selectedlocal - ('SIP/cc100') +# - $textareaheight - ('8','10','12','etc...') +# - $textareawidth - ('8','10','12','etc...') +# - $field_name - ('extension','busyext','extension_xfer','etc...') +# +# # changes # 50323-1147 - First build of script # 50401-1132 - small formatting changes diff --git a/LANG_www/agc_pt/astguiclient.php b/LANG_www/agc_pt/astguiclient.php index 1c6a291f..aa9bb785 100644 --- a/LANG_www/agc_pt/astguiclient.php +++ b/LANG_www/agc_pt/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -185,7 +185,7 @@ echo "
0) { - fwrite ($fp, "VICISELETOR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -193,7 +193,7 @@ echo " 0) { - fwrite ($fp, "VICISELETOR|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); fclose($fp); } } @@ -1545,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + "
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " SELETOR
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " DIAL
"; @@ -1575,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + "
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " SELETOR
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " DIAL
"; @@ -2794,7 +2794,7 @@ echo "\n";
VOICEMAIL     NOVO:     VELHO:             SELETOR MANUAL       SELETOR
VOICEMAIL     NOVO:     VELHO:             SELETOR MANUAL       DIAL
CHAMADAS ESTACIONADAS: 0                EXTENSÕES LOCAIS DO SELETOR
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
-PAUSA | COMEÇO     Refresque a taxa: 1000 ms Mais rapidamente | Mais lento

+BATENTE | COMEÇO     Refresque a taxa: 1000 ms Mais rapidamente | Mais lento

Inicializar..
Extensões Ativas
diff --git a/LANG_www/agc_pt/call_log_display.php b/LANG_www/agc_pt/call_log_display.php index dc59b56f..32890543 100644 --- a/LANG_www/agc_pt/call_log_display.php +++ b/LANG_www/agc_pt/call_log_display.php @@ -1,24 +1,24 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - +# call_log_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the inbound and outbound calls for a specific phone +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# - $in_limit - ('10','20','50','100',...) +# - $out_limit - ('10','20','50','100',...) +# +# # changes # 50406-1013 - First build of script # 50407-1452 - Added definable limits diff --git a/LANG_www/agc_pt/conf_exten_check.php b/LANG_www/agc_pt/conf_exten_check.php index ed42c28f..3f5e3111 100644 --- a/LANG_www/agc_pt/conf_exten_check.php +++ b/LANG_www/agc_pt/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,8 +35,22 @@ # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output +# 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally +# 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -63,16 +77,43 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '2.0.4-12'; -$build = '71122-0205'; +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -81,11 +122,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $random = (rand(1000000, 9999999) + 10000000); - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -105,6 +148,7 @@ $random = (rand(1000000, 9999999) + 10000000); $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -153,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -161,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -177,52 +223,199 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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";} + + ### 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')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + ### grab the API hangup and API dispo fields in vicidial_live_agents + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $external_hangup = $row[0]; + $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; + if (strlen($external_status)<1) {$external_status = '::::::::::';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); + + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|COMEÇO",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_LOGOUT';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -236,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -278,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Conferência $conf_exten foi registado a $exten\n"; } @@ -294,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_pt/inbound_popup.php b/LANG_www/agc_pt/inbound_popup.php index b9ed7470..73b8949c 100644 --- a/LANG_www/agc_pt/inbound_popup.php +++ b/LANG_www/agc_pt/inbound_popup.php @@ -1,28 +1,28 @@ LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - +# inbound_popup.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed to open up when a live_inbound call comes in giving the user +# options of what to do with the call or options to lookup the callerID on various web sites +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $uniqueid - ('1234567890.123456',...) +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $ext_context - ('default','demo',...) +# - $ext_priority - ('1','2',...) +# - $voicemail_dump_exten - ('85026666666666') +# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) +# +# # changes # 50428-1500 - First build of script display only # 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
O Número Marcou: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Notas:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "HANGUP - \n"; echo "EMITA A MEU VOICEMAIL\n"; diff --git a/LANG_www/agc_pt/live_exten_check.php b/LANG_www/agc_pt/live_exten_check.php index 5a7a69d6..78898d3e 100644 --- a/LANG_www/agc_pt/live_exten_check.php +++ b/LANG_www/agc_pt/live_exten_check.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# live_exten_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send whether the client channel is live and to what channel it is connected +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50404-1249 - First build of script # 50406-1402 - added connected trunk lookup diff --git a/LANG_www/agc_pt/manager_send.php b/LANG_www/agc_pt/manager_send.php index 0823f931..9d4bcb03 100644 --- a/LANG_www/agc_pt/manager_send.php +++ b/LANG_www/agc_pt/manager_send.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 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 @@ -32,9 +32,15 @@ # - $agent_log_id - ('123456',...) # - $call_server_ip - ('10.10.10.15',...) # - $CalLCID - ('VD01234567890123456',...) -# - $stage - ('UP','DOWN') -# - +# - $stage - ('UP','DOWN','2NDXfeR') +# - $session_id - ('8600051') +# - $FROMvdc - ('YES','NO') +# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -68,8 +74,25 @@ # 70226-1251 - Added Mute/UnMute to conference volume control # 70320-1502 - Added option to allow retry of leave-3way-call and debug logging # 70322-1636 - Added sipsak display ability +# 80331-1433 - Added second transfer try for VICIDIAL transfers on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80424-0442 - Added non_latin lookup from system_settings +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80915-1755 - Rewrote leave-3way functions for external calling +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -127,38 +150,78 @@ if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} + elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} 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["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} + elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + +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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ $user=ereg_replace("[^0-9a-zA-Z]","",$user); $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $secondS = ereg_replace("[^0-9]","",$secondS); +} # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.29'; -$build = '70320-1502'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} +$row=mysql_fetch_row($rslt); +$auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { @@ -178,6 +241,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -227,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; } } @@ -254,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -283,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -320,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -350,16 +434,18 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); + $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... } } } @@ -371,15 +457,20 @@ if ($ACTION=="HangupConfDial") ###################### if ($ACTION=="Hangup") { +$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { + { $channel_live=0; echo "Canaleta $channel é inválido or queryCID $queryCID é inválido, Hangup comando não introduzido\n"; - } + } else - { + { if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} # $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; @@ -398,39 +489,176 @@ if ($ACTION=="Hangup") # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; # } # } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { + if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) + { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { - echo "Call $CalLCID $channel não está vivo em $call_server_ip, Checking Live Canaleta...\n"; + { + echo "Call $CalLCID $channel não está vivo em $call_server_ip, Checking Live Canaleta...\n"; $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) + { + $channel_live=0; + echo "Canaleta $channel não está vivo em $call_server_ip, Hangup comando não introduzido $rowx[0]\n$stmt\n"; + } + else + { + echo "$stmt\n"; + } + } + } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $channel_live=0; - echo "Canaleta $channel não está vivo em $call_server_ip, Hangup comando não introduzido $rowx[0]\n$stmt\n"; + echo "Canaleta $channel in use by another agent em $call_server_ip, Hangup comando não introduzido $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } } - else + else { echo "$stmt\n"; } - } - } + } + if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando emitido para Canaleta $channel em $call_server_ip\n"; + { + if ( (strlen($CalLCID)>15) and ($secondS > 0)) + { + $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($format=='debug') {echo "\n";} + if ($rowx[0] > 0) + { + ############################################# + ##### COMEÇO 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} + if ($format=='debug') {echo "\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $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]; + $i++; + } + ##### 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); + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cn_ct = mysql_num_rows($rslt); + if ($VAC_cn_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_connect = $row[0]; + } + if ($format=='debug') {echo "\n";} + if ($caller_connect > 0) + { + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $auto_call_id = $row[0]; + $CLlead_id = $row[1]; + $CLphone_number = $row[2]; + $CLstatus = $row[3]; + $CLcampaign_id = $row[4]; + $CLphone_code = $row[5]; + $CLalt_dial = $row[6]; + $CLstage = $row[7]; + $CLcallerid = $row[8]; + $CLuniqueid = $row[9]; + } + if ($format=='debug') {echo "\n";} + + $CLstage = preg_replace("/.*-/",'',$CLstage); + if (strlen($CLstage) < 1) {$CLstage=0;} + + $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_complete = $row[0]; + } + if ($format=='debug') {echo "\n";} + + if ($caller_complete < 1) + { + $time_id=0; + $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_eq_ct = mysql_num_rows($rslt); + if ($VAC_eq_ct > 0) + { + $row=mysql_fetch_row($rslt); + $time_id = $row[0]; + } + $StarTtime = date("U"); + if ($time_id > 100000) + {$secondS = ($StarTtime - $time_id);} + + if ($format=='debug') {echo "\n";} + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + if ($format=='debug') {echo "\n";} + } + } + } + } + } + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Hangup comando emitido para Canaleta $channel em $call_server_ip\n"; + } } - } } @@ -459,29 +687,32 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ($auto_dial_level < 1) + { + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + { + $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; + if ($format=='debug') {echo "\n";} + $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);} + } $ACTION="Redirect"; } } @@ -507,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -530,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -552,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -581,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -591,6 +826,441 @@ if ($ACTION=="RedirectNameVmail") } } + + + + + +if ($ACTION=="RedirectXtraCXNeW") +{ + $DBout=''; + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma destas variáveis é inválido:\n"; + echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; + echo "ExtraCanaleta $extrachannel deve ser mais grande de 2 caráteres\n"; + echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; + echo "exten $exten deve ser ajustado\n"; + echo "ext_context $ext_context deve ser ajustado\n"; + echo "ext_priority $ext_priority deve ser ajustado\n"; + echo "\nRedirect Action não emitido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR24$NOWnum"; + $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} + } + + // $fp = fopen ("./vicidial_debug_3way.txt", "a"); + // fwrite ($fp, "$NOW_TIME|$filename|\n|$stmtA|\n|$stmtB|\n|$stmtC|\n|$stmtD|\n|$stmtE|\n|$stmtF|\n|$stmtG|\n|$stmtH|\n\n"); + // fclose($fp); + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtG|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference em $server_ip, Redirect comando não introduzido\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Não pode encontrar a conferência vazia em $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canaleta $channel não está vivo em $call_server_ip, Redirect comando não introduzido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está vivo em $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está vivo em $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando não introduzido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtraCX comando emitido para Canaleta $channel em $call_server_ip and \nHungup $extrachannel em $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel em $call_server_ip, Hungup $extrachannel em $server_ip";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel em $server_ip";} + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } +} + + + + + + + + + + +if ($ACTION=="RedirectXtraNeW") +{ + if ($channel=="$extrachannel") + {$ACTION="Redirect";} + else + { + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma destas variáveis é inválido:\n"; + echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; + echo "ExtraCanaleta $extrachannel deve ser mais grande de 2 caráteres\n"; + echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; + echo "exten $exten deve ser ajustado\n"; + echo "ext_context $ext_context deve ser ajustado\n"; + echo "ext_priority $ext_priority deve ser ajustado\n"; + echo "session_id $session_id deve ser ajustado\n"; + echo "\nRedirect Action não emitido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fclose($fp); + } + } + } + else + { + if (ereg("NEXTAVAILABLE",$exten)) + { + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 1) + { + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference em $server_ip, Redirect comando não introduzido\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Não pode encontrar a conferência vazia em $server_ip";} + } + } + + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canaleta $channel não está vivo em $call_server_ip, Redirect comando não introduzido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está vivo em $call_server_ip";} + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel não está vivo em $server_ip";} + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando emitido para Canaleta $channel and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten em $server_ip";} + } + else + { + $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]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "RedirectXtra comando emitido para Canaleta $channel em $call_server_ip and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + + if (ereg("SECOND|FIRST|DEBUG",$filename)) + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } + } + + } + } +} + + + + + + + +/* if ($ACTION=="RedirectXtraCX") { $DBout=''; @@ -725,6 +1395,9 @@ if ($ACTION=="RedirectXtraCX") } } + + +###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") @@ -758,7 +1431,7 @@ if ($ACTION=="RedirectXtra") } else { - if ($exten == "NEXTAVAILABLE") + if (ereg("NEXTAVAILABLE",$exten)) { $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} @@ -874,10 +1547,36 @@ if ($ACTION=="RedirectXtra") } } } - +###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### +*/ if ($ACTION=="Redirect") { + ### for manual dial VICIDIAL calls send the second attempt to transfer the call + if ($stage=="2NDXfeR") + { + $local_DEF = 'Local/'; + $local_AMP = '@'; + $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; + + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row > 0) + { + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + $channel=$rowx[0]; + $channel = eregi_replace("1$","2",$channel); + $queryCID = eregi_replace("^.","Q",$queryCID); + } + } + $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -897,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -915,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect comando emitido para Canaleta $channel em $server_ip\n"; } @@ -945,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -963,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -980,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -994,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1014,6 +1723,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) { $row=''; $rowx=''; $channel_live=1; + $uniqueidSQL=''; + if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; @@ -1022,26 +1733,95 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) else { + $VDvicidial_id=''; + if ($ACTION=="MonitorConf") { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } + + ##### StopMonitorConf steps ##### else { + if ($uniqueid=='IN') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } + } + else + { + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} + } + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1053,15 +1833,17 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going em in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1077,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1112,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 emitido para Conferência $exten, Stage $stage Canaleta $channel em $server_ip\n"; } } @@ -1134,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_pt/park_calls_display.php b/LANG_www/agc_pt/park_calls_display.php index 40317dfd..f3c19d75 100644 --- a/LANG_www/agc_pt/park_calls_display.php +++ b/LANG_www/agc_pt/park_calls_display.php @@ -1,22 +1,22 @@ LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - +# park_calls_display.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to send the details on the parked calls on the server +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $exten - ('cc101','testphone','49-1','1234','913125551212',...) +# - $protocol - ('SIP','Zap','IAX2',...) +# +# # changes # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars diff --git a/LANG_www/agc_pt/timeclock.php b/LANG_www/agc_pt/timeclock.php new file mode 100644 index 00000000..f3661a55 --- /dev/null +++ b/LANG_www/agc_pt/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + 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:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='COMEÇO', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='COMEÇO'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'COMEÇO') ) + { + ### 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"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOLOGOUT') or ($status=='COMEÇO') or ($status=='LOGOUT') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + 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"; + + ### 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';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOLOGOUT') or ($status=='COMEÇO') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERRO: timeclock entrada do log já realizados:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "BACK TO Agent Início de uma sessão Screen";} + if ($referrer=='admin') + {$BACKlink = "Retornar para Administração";} + if ($referrer=='welcome') + {$BACKlink = "ANTERIOR a tela Bem-vindo";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOLOGOUT') or ($status=='COMEÇO') or ($status=='LOGOUT') ) + { + $VDdisplayMESSAGE = "Vez desde que foi registrado em:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Você última autenticado-out em:$last_action_date

LOGIN Clique abaixo para log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Quantidade de tempo que tem sido registrado em:$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

LOGOUT Clique abaixo para log-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
 

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_pt/vdc_db_query.php b/LANG_www/agc_pt/vdc_db_query.php index 26896576..af8986d9 100644 --- a/LANG_www/agc_pt/vdc_db_query.php +++ b/LANG_www/agc_pt/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -54,7 +54,7 @@ # - $comments - ('Good Customer',...) # - $auto_dial_level - ('0','1','1.2',...) # - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) +# - $conf_silent_prefix - ('7','8','5',...) # - $extension - ('123','user123','25-1',...) # - $protocol - ('Zap','SIP','IAX2',...) # - $user_abb - ('1234','6666',...) @@ -67,9 +67,22 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $use_campaign_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') - +# - $LogouTKicKAlL - ('0','1'); +# - $closer_blended = ('0','1'); +# - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC') +# - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) +# - $conf_dialed = ('0','1') +# - $leaving_threeway = ('0','1') +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -138,10 +151,52 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80116-1032 - added user_closer_log logging in regCLOSER +# 80125-1213 - fixed vicidial_log bug when call is from closer +# 80317-2051 - Added in-group recording settings +# 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag +# 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls +# 80703-0139 - Added alter customer phone permissions +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80713-0624 - Added vicidial_list.last_local_call_time field +# 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log +# 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support +# 80909-1710 - Added support for campaign-specific DNC lists +# 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call +# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call +# 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -266,6 +321,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} 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["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["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} @@ -274,29 +331,81 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} +if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} + elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} +if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} + elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +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["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} +if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} + elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} + elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} +if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} + elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} +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 -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - +$txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) +{ +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); +$phone_code = ereg_replace("[^0-9]","",$phone_code); +$phone_number = ereg_replace("[^0-9]","",$phone_number); +} + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -305,7 +414,9 @@ else { $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -326,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -359,54 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Início de uma sessão:
\n"; + $VDdisplayMESSAGE.= "Manager Senha:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -430,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -437,18 +679,31 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } + $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} + $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); @@ -459,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -475,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -507,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -527,15 +785,28 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] > 0) + { + echo "DNC NÚMERO\n"; + exit; + } + $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -545,12 +816,55 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NÚMERO NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -561,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -572,9 +887,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -583,9 +899,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -597,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -609,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -621,8 +940,10 @@ if ($ACTION == 'manDiaLnextCaLL') $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); + $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -640,7 +961,7 @@ if ($ACTION == 'manDiaLnextCaLL') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -649,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -659,10 +981,16 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { + # generate callerID for unique identifier in xfer_log file + $PADlead_id = sprintf("%09s", $lead_id); + while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL + $MqueryCID = "M$CIDdate$PADlead_id"; + # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID|\n"); fclose($fp); } @@ -675,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -687,10 +1016,32 @@ if ($ACTION == 'manDiaLnextCaLL') } } + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $server_ct = mysql_num_rows($rslt); + if ($server_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + } + $LLCT_DATE_offset = ($local_gmt - $gmt_offset_now); + $LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if (ereg('Y',$called_since_last_reset)) + { + $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset); + if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;} + $called_since_last_reset++; + $called_since_last_reset = "Y$called_since_last_reset"; + } + else {$called_since_last_reset = 'Y';} ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; + $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -698,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -713,7 +1066,8 @@ if ($ACTION == 'manDiaLnextCaLL') $local_AMP = '@'; $Local_out_prefix = '9'; $Local_dial_timeout = '60'; - $Local_persist = '/n'; + # $Local_persist = '/n'; + $Local_persist = ''; if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} @@ -733,25 +1087,98 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# + ##### COMEÇO 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -804,6 +1231,62 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "ALT DEL TELEFONO NÚMERO STATUS NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count é inválido\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $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 "ALT DEL TELEFONO NÚMERO STATUS CHANGED\n"; + } +} + + +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage é inválido\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -827,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -855,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -887,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -894,24 +1388,97 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + + ############################################# + ##### COMEÇO 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 ($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) + { + $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]; + $i++; + } + ##### 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); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -933,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -948,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -957,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -975,11 +1550,17 @@ if ($ACTION == 'manDiaLlogCaLL') { $MT[0]=''; $row=''; $rowx=''; + $vidSQL=''; + $VDterm_reason=''; if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "REGISTRO NÃO ENTRADO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign é inválido\n"; exit; @@ -989,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -997,9 +1579,10 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1015,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1035,7 +1619,27 @@ if ($stage == "start") if ($stage == "end") { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + + if ( (strlen($uniqueid)<1) and ($VLA_inOUT == 'INBOUND') ) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_0|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + $uniqueid='6666.1'; + } + if ( (strlen($uniqueid)<1) or (strlen($lead_id)<1) ) { echo "REGISTRO NÃO ENTRADO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id é inválido\n"; @@ -1043,50 +1647,59 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($VLA_inOUT == 'INBOUND') { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDvicidial_id = $row[2]; + $VDcampaign_id = $row[3]; $length_in_sec = ($StarTtime - $start_epoch); } else { $length_in_sec = 0; } - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($length_in_sec < 1) and ($row[0] > 0) ) + + if ( ($length_in_sec < 1) and ($VLA_inOUT == 'INBOUND') ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_1|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; + $VDcampaign_id = $row[2]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1097,26 +1710,38 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_2|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|\n"); + fclose($fp); + } } ############################################# ##### COMEÇO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$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]; @@ -1125,7 +1750,12 @@ if ($stage == "end") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; + + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + } } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1135,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1143,24 +1774,17 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1174,16 +1798,56 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1197,19 +1861,154 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if (ereg("Y",$use_campaign_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLAP_cdnc_ct = mysql_num_rows($rslt); + if ($VLAP_cdnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]); + } + } + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} + $Xlast=9999999999; + } + } } } } if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + ### grab call lead information needed for QM logging + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1230,11 +2029,9 @@ if ($stage == "end") $CLstage = preg_replace("/.*-/",'',$CLstage); if (strlen($CLstage) < 1) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER';"; + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1245,40 +2042,45 @@ if ($stage == "end") if ($caller_complete < 1) { - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; - if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $linkB); - $affected_rows = mysql_affected_rows($linkB); + $term_reason='AGENT'; } - mysql_close($linkB); + else + { + $term_reason='CALLER'; + } + } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} - - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } @@ -1287,8 +2089,9 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { ### check to see if lead should be alt_dialed - $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1306,60 +2109,188 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { if ($enable_queuemetrics_logging > 0) { - $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - mysql_select_db("$queuemetrics_dbname", $linkB); - - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - - mysql_close($linkB); } } } - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) + if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { - echo "$uniqueid\n$channel\n"; + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Introduzido: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "REGISTRO NÃO ENTRADO\n"; + } + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "$uniqueid\n$channel\n"; + } + else + { + echo "REGISTRO NÃO ENTRADO\n\n"; + } } else { - echo "REGISTRO NÃO ENTRADO\n\n"; + $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + $VDvicidial_id = $row[1]; + $VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago"; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; + } + } + + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1373,10 +2304,12 @@ if ($stage == "end") $local_DEF = 'Local/'; $local_AMP = '@'; $total_rec=0; + $total_hangup=0; $loop_count=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1386,16 +2319,79 @@ if ($stage == "end") $rec_channels[$total_rec] = "$row[0]"; $total_rec++; } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } if ($format=='debug') {echo "\n";} $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) + { + $loop_count=0; + while($loop_count < $total_hangup) + { + if (strlen($hangup_channels[$loop_count])>5) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} + } + $loop_count++; + } + } + $total_recFN=0; $loop_count=0; $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1414,29 +2410,54 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; + echo "REC_BATENTE|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; + $start_time = $row[1]; + $vicidial_id = $row[2]; + $RClead_id = $row[3]; + if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') ) + {$lidSQL = ",lead_id='$lead_id'";} + if (strlen($vicidial_id)<1) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + else + { + if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') ) + { + if (!ereg('.',$VDvicidial_id)) + {$vidSQL = ",vicidial_id='$VDvicidial_id'";} + + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } + } $length_in_sec = ($StarTtime - $start_time); $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; + + # $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); + # fwrite ($fp, "$NOW_TIME|REGISTRO_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); + # fclose($fp); } else {echo "||";} } @@ -1449,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1490,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1514,10 +2544,18 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $VDCL_ingroup_recording_override = ''; + $VDCL_ingroup_rec_filename = ''; $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1528,9 +2566,10 @@ if ($ACTION == 'VDADcheckINCOMING') else { ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -1541,12 +2580,15 @@ if ($ACTION == 'VDADcheckINCOMING') $callerid =$row[2]; $channel =$row[3]; $call_server_ip =$row[4]; + $VLAcomments=$row[5]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1559,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -1601,7 +2655,7 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone = trim("$row[26]"); $email = trim("$row[27]"); $security = trim("$row[28]"); - $comments = trim("$row[29]"); + $comments = stripslashes(trim("$row[29]")); $called_count = trim("$row[30]"); } @@ -1614,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -1630,129 +2685,77 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $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,'00111',$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); + $user_group = trim("$row[0]"); + } + + + $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} + $VDAC_cid_ct = mysql_num_rows($rslt); + if ($VDAC_cid_ct > 0) { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id,phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($VDAC_cid_ct > 0) + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + $dialed_number =$row[1]; + $dialed_label =$row[2]; + $call_type =$row[3]; + } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - $dialed_number =$row[1]; - $dialed_label =$row[2]; + $call_type = 'OUT'; + $VDADchannel_group = $campaign; } else { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); - fclose($fp); - } - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - $VDCL_default_xfer_group= $row[28]; - - ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - - $Ctype = 'I'; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; + $VDADchannel_group =$row[0]; } } - - ### if web form is set then send em to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) + if ($WeBRooTWritablE > 0) { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); + fclose($fp); } - else {echo '|' . $tsr . "\n";} } - else + + if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') ) { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -1763,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -1776,6 +2782,198 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } + } + else + { + ### update the vicidial_closer_log user to INCALL + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} + $VDL_cid_ct = mysql_num_rows($rslt); + if ($VDL_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_front_VDlog =$row[0]; + } + + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_name = $row[0]; + $VDCL_group_color = $row[1]; + $VDCL_group_web = stripslashes($row[2]); + $VDCL_fronter_display = $row[3]; + $VDCL_ingroup_script = $row[4]; + $VDCL_get_call_launch = $row[5]; + $VDCL_xferconf_a_dtmf = $row[6]; + $VDCL_xferconf_a_number = $row[7]; + $VDCL_xferconf_b_dtmf = $row[8]; + $VDCL_xferconf_b_number = $row[9]; + $VDCL_default_xfer_group = $row[10]; + $VDCL_ingroup_recording_override = $row[11]; + $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} + + $Ctype = 'I'; + } + else + { + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cid_ct = mysql_num_rows($rslt); + if ($VDIG_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_ingroup_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; + } + } + + ### if web form is set then send em to vicidial.php for override of WEB_FORM address + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + + $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} + $VDU_cid_ct = mysql_num_rows($rslt); + if ($VDU_cid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $fronter_full_name = $row[0]; + echo $fronter_full_name . '|' . $tsr . "\n"; + } + else {echo '|' . $tsr . "\n";} } $comments = eregi_replace("\r",'',$comments); @@ -1816,6 +3014,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; @@ -1826,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1835,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If CHAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -1842,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -1860,7 +3067,7 @@ if ($ACTION == 'VDADcheckINCOMING') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid\n"); fclose($fp); } @@ -1894,6 +3101,7 @@ else $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,'00127',$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) @@ -1905,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -1913,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -1920,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -1946,12 +3169,27 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($LogouTKicKAlL > 0) + { + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -1961,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -1968,8 +3207,8 @@ else ############################################# ##### COMEÇO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1998,15 +3237,15 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSA',serverid='1';"; + # $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSE',serverid='1';"; # if ($DB) {echo "$stmt\n";} - # if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + # # $rslt=mysql_query($stmt, $linkB); # $affected_rows = mysql_affected_rows($linkB); $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2021,10 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2051,23 +3290,44 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} + } + else + { + $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2075,31 +3335,54 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + } + if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) + { + $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2108,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### CHAMADABACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2131,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2138,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2145,13 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### COMEÇO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2173,10 +3469,13 @@ if ($ACTION == 'updateDISPO') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$campaign',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; + if (strlen($stage) < 2) + {$stage = $campaign;} + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2203,9 +3502,9 @@ if ($ACTION == 'updateLEAD') else { - $stmt = "SELECT disable_alter_custdata FROM vicidial_campaigns where campaign_id='$campaign'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2213,15 +3512,23 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $disable_alter_custdata = $row[0]; + $disable_alter_custphone = $row[1]; $i++; } - if (ereg('Y',$disable_alter_custdata)) + if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) ) { - $DO_NOT_UPDATE=1; - $DO_NOT_UPDATE_text=' NOT'; - $stmt = "SELECT alter_custdata_override FROM vicidial_users where user='$user'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + if (ereg('Y',$disable_alter_custdata)) + { + $DO_NOT_UPDATE=1; + $DO_NOT_UPDATE_text=' NOT'; + } + if (ereg('Y',$disable_alter_custphone)) + { + $DO_NOT_UPDATEphone=1; + } + $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2229,6 +3536,7 @@ if ($ACTION == 'updateLEAD') { $row=mysql_fetch_row($rslt); $alter_custdata_override = $row[0]; + $alter_custphone_override = $row[1]; $i++; } if (ereg('ALLOW_ALTER',$alter_custdata_override)) @@ -2236,6 +3544,10 @@ if ($ACTION == 'updateLEAD') $DO_NOT_UPDATE=0; $DO_NOT_UPDATE_text=''; } + if (ereg('ALLOW_ALTER',$alter_custphone_override)) + { + $DO_NOT_UPDATEphone=0; + } } if ($DO_NOT_UPDATE < 1) @@ -2246,15 +3558,30 @@ if ($ACTION == 'updateLEAD') $comments = eregi_replace("--QUES--",'?',$comments); $comments = eregi_replace("--POUND--",'#',$comments); - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; + $phoneSQL=''; + if ($DO_NOT_UPDATEphone < 1) + {$phoneSQL = ",phone_number='$phone_number'";} + + $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2277,21 +3604,41 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### COMEÇO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2310,59 +3657,100 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} - if (ereg('PAUSA',$stage)) {$QMstatus='PAUSAALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} + if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' está agora no status ' . $stage . "\n"; + echo 'Agent ' . $user . ' está agora no status ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -2383,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2390,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -2405,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'PausaCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -2418,14 +3809,15 @@ if ($ACTION == 'PausaCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { ############################################# ##### COMEÇO QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2453,17 +3845,17 @@ if ($ACTION == 'PausaCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSAREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pausa Code has been updated to $status for $agent_log_id\n"; +echo " Pausa Code has been updated to $status for $agent_log_id\n"; } @@ -2475,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -2496,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -2513,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -2532,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_pt/vicidial.php b/LANG_www/agc_pt/vicidial.php index fea99d54..35900fed 100644 --- a/LANG_www/agc_pt/vicidial.php +++ b/LANG_www/agc_pt/vicidial.php @@ -1,19 +1,12 @@ LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -171,10 +164,71 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71223-0318 - changed logging of closer calls +# 71226-1117 - added option to kick all calls from conference upon logout +# 80109-1510 - added gender select list +# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused +# 80317-2106 - added recording override options for inbound group calls +# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls +# 80402-0121 - Fixes for manual dial transfers on some systems +# 80407-2112 - Work on adding phone login load balancing across servers +# 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable +# 80428-0413 - UTF8 changes and testing +# 80505-0054 - Added multi-phones load-balanced alias option +# 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display +# 80523-1630 - Added Timeclock links +# 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial +# 80703-0139 - Added alter customer phone permissions +# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count +# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording +# 80709-0358 - Added Default alt phone dial hard-code option +# 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls +# 80909-1717 - Added support for campaign-specific DNC lists +# 80915-1754 - Rewrote leave-3way functions for external calling +# 81002-1908 - Fixed double-login bug in some conditions +# 81007-0945 - Added three_way_call_cid option for outbound 3way calls +# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements +# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call +# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls +# 81013-1644 - Fixed bug in leave 3way for manual dial fronters +# 81015-0405 - Fixed bug related to hangups on 3way calls +# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available +# 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -192,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -207,14 +263,19 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $VD_campaign = strtoupper($VD_campaign); $VD_campaign = eregi_replace(" ",'',$VD_campaign); } + if (!isset($flag_channels)) + { + $flag_channels=0; + $flag_string=''; + } ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -230,14 +291,47 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); + $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $random = (rand(1000000, 9999999) + 10000000); -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$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) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $vdc_header_date_format = $row[1]; + $vdc_customer_date_format = $row[2]; + $vdc_header_phone_format = $row[3]; + $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; + + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +##### DEFINABLE SETTINGS AND OPTIONS +########################################### +$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording +$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial @@ -245,23 +339,31 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls em hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of segundos for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name em login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST em server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '1'; # set to 1 to show a SELETOR link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups +$PreseT_DiaL_LinKs = '0'; # set to 1 to show a SELETOR link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups em campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Cliente Do Hangup +$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout +$TelefoneSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login +$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT SELETOR by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -281,6 +383,7 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SCwidth = ($MASTERwidth + 230); # 670 - live call segundos counter $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button @@ -330,12 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -345,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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';"; + 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -363,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -436,15 +582,16 @@ if ($LogiNAJAX > 0) if ($relogin == 'YES') { -echo "Web client de VICISELETOR: Re-Início de uma sessão\n"; +echo "Web client de VICIDIAL: Re-Início de uma sessão\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Português
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -458,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Re-Início de uma sessão
Senha Do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; +echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -472,9 +620,10 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; + echo "Web client de VICIDIAL: Início de uma sessão Da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -483,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Início de uma sessão Do Usuário

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -507,23 +656,24 @@ echo "
Início de uma sessão Da Campanha
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; - echo "Web client de VICISELETOR: Início de uma sessão\n"; + echo "Web client de VICIDIAL: Início de uma sessão\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -553,15 +703,16 @@ echo "
Início de uma sessão
Web client de VICISELETOR: Início de uma sessão Do Telefone\n"; +echo "Web client de VICIDIAL: Início de uma sessão Do Telefone\n"; echo "\n"; echo "\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Português
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -591,10 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -603,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "É necessário efetuar login AO PRIMEIRO TIMECLOCK
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("COMEÇO|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("COMEÇO|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=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
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + 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
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

GERENTE Override:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Início de uma sessão:
\n"; + $VDdisplayMESSAGE.= "Manager Senha:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -630,16 +920,17 @@ $VDloginDISPLAY=0; {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; + echo "Web client de VICIDIAL: VICIDIAL Início de uma sessão Da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "
Início de uma sessão Do Telefone
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -662,8 +953,8 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -674,8 +965,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -690,9 +981,9 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -712,8 +1003,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -741,15 +1032,15 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + ##### grab the campaign settings + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,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,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -780,6 +1071,44 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -790,20 +1119,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -828,8 +1169,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -852,8 +1193,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -869,10 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -898,9 +1266,10 @@ echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; + echo "Web client de VICIDIAL: Início de uma sessão Da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -909,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -930,18 +1299,65 @@ echo "
Início de uma sessão Da Campanha
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +# code for parsing load-balanced agent phone allocation where agent interface +# will send multiple phones-table logins so that the script can determine the +# server that has the fewest agents logged into it. +# login: ca101,cb101,cc101 + $alias_found=0; +$stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} +$alias_ct = mysql_num_rows($rslt); +if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_found = "$row[0]"; + } +if ($alias_found > 0) + { + $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $alias_ct = mysql_num_rows($rslt); + if ($alias_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alias_name = "$row[0]"; + $phone_login = "$row[1]"; + } + } + +$pa=0; +if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) ) + { + $phoneSQL = "("; + $phones_auto = explode(',',$phone_login); + $phones_auto_ct = count($phones_auto); + while($pa < $phones_auto_ct) + { + if ($pa > 0) + {$phoneSQL .= " or ";} + $desc = ($phones_auto_ct - $pa); # traverse in reverse order + $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; + $pa++; + } + $phoneSQL .= ")"; + } +else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} + +$authphone=0; +$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "Web client de VICISELETOR: Início de uma sessão Do Telefone Error\n"; + echo "Web client de VICIDIAL: Início de uma sessão Do Telefone Error\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -950,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -969,11 +1385,66 @@ echo "
Início de uma sessão Error
Web client de VICISELETOR\n"; +### go through the entered phones to figure out which server has fewest agents +### logged in and use that phone login account + if ($pa > 0) + { + $pb=0; + $pb_login=''; + $pb_server_ip=''; + $pb_count=0; + $pb_log=''; + while($pb < $phones_auto_ct) + { + ### find the server_ip of each phone_login + $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; + if ($DB) {echo "|$stmtx|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowx=mysql_fetch_row($rslt); + + ### get number of agents logged in to each server + $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + + ### find out whether the server is set to active + $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowy=mysql_fetch_row($rslt); + + ### find out whether the server_updater is running + $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $rowz=mysql_fetch_row($rslt); + + $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; + + if ( ($rowy[0] > 0) && ($rowz[0] > 0) ) + { + if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) ) + { + $pb_count=$row[0]; + $pb_server_ip=$rowx[0]; + $phone_login=$phones_auto[$pb]; + } + } + $pb++; + } + echo "\n"; + } + echo "Web client de VICIDIAL\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1035,8 +1506,26 @@ else $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; + $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; + if ($TelefoneSComPIP == '1') + { + if (strlen($computer_ip) < 4) + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } + } + if ($TelefoneSComPIP == '2') + { + $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} + } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); @@ -1047,11 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1104,26 +1598,26 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1138,50 +1632,54 @@ else else { ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - print "\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $session_id = $row[0]; + } + print "\n"; } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1194,12 +1692,11 @@ else ############################################# ##### COMEÇO SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1210,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1224,12 +1720,12 @@ else } ### insert a NOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1237,8 +1733,8 @@ else ##### grab the campaign_weight and number of calls today em that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1254,16 +1750,16 @@ else $calls_today = '0'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1272,19 +1768,19 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1302,8 +1798,8 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1314,17 +1810,17 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSAALL',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); - print "\n"; + print "\n"; mysql_close($linkB); mysql_select_db("$VARDB_database", $link); @@ -1333,9 +1829,10 @@ else } else { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; + echo "Web client de VICIDIAL: VICIDIAL Início de uma sessão Da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -1356,9 +1853,10 @@ echo "
Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; + echo "Web client de VICIDIAL: VICIDIAL Início de uma sessão Da Campanha\n"; echo "\n"; echo "\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; @@ -1394,12 +1892,18 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1414,8 +1918,8 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1423,8 +1927,8 @@ echo "); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1701,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1715,6 +2229,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_exten = ''; var campaign_recording = ''; var campaign_rec_filename = ''; + var LIVE_campaign_recording = ''; + var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1732,6 +2252,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannellive=0; var nochannelinsession=0; var agc_dial_prefix = '91'; + var dtmf_silent_prefix = ''; var conf_silent_prefix = ''; var menuheight = 30; var menuwidth = 30; @@ -1777,6 +2298,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -1785,6 +2307,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; + var alt_dial_status_display = 0; var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; @@ -1792,11 +2315,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_dial_preview = ''; var starting_alt_phone_dialing = ''; var alt_phone_dialing = ''; + var DefaulTAlTDiaL = ''; var wrapup_segundos = ''; var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; var use_internal_dnc = ''; + var use_campaign_dnc = ''; + var three_way_call_cid = ''; + var outbound_cid = ''; + var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1808,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var PausaCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -1819,14 +2351,43 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; var PausENotifYCounTer = 0; + var RedirecTxFEr = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; - var DiaLControl_auto_HTML = "\"Pausa\"\"Resumo\""; - var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Resumo\""; - var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Resumo\""; - var DiaLControl_manual_HTML = "\"Número"; + var LogouTKicKAlL = ''; + var flag_channels = ''; + var flag_string = ''; + var vdc_header_date_format = ''; + var vdc_customer_date_format = ''; + var vdc_header_phone_format = ''; + var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; + var inOUT = 'OUT'; + var useIE = ''; + var random = ''; + var threeway_end = 0; + var agentphonelive = 0; + var conf_dialed = 0; + var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; + var dial_method = ''; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Resumo\""; + var DiaLControl_auto_HTML_ready = "\"\"Resumo\""; + var DiaLControl_auto_HTML_OFF = "\"\"Resumo\""; + var DiaLControl_manual_HTML = "\"Número"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -1985,10 +2546,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() { + conf_dialed=1; + mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip); SendManualDial('YES'); @@ -1998,26 +2615,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // place 3way and customer into other conference and fake-hangup the lines function leave_3way_call(tempvarattempt) { + threeway_end=0; + leaving_threeway=1; + mainxfer_send_redirect('3WAY','','',tempvarattempt); - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - dialedcall_send_hangup(); +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); + if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } // ################################################################################ // filter manual dialstring and pass em to originate call function SendManualDial(taskFromConf) { + conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + + document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; + + document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; + var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); var dial_conf_exten = session_id; + threeway_cid = ''; + if (three_way_call_cid == 'CAMPAIGN') + {threeway_cid = campaign_cid;} + if (three_way_call_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} + if (three_way_call_cid == 'COSTUMEER') + {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2033,32 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else - { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} - else - { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (manual_string.length > 7) + {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2109,23 +2753,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else { var dialnum = tasknum; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -2139,7 +2789,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + campaign_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2147,7 +2810,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert(xmlhttp.responseText); + // alert(VMCoriginate_query); + // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) { @@ -2160,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2193,7 +2862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + conf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2216,7 +2885,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2276,12 +2945,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; @@ -2290,6 +2961,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -2298,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_LOGOUT') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Status: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2313,6 +2996,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else {PausENotifYCounTer=0;} + var APIHanguP_array = check_time_array[6].split("APIHanguP: "); + var APIHanguP = APIHanguP_array[1]; + var APIStatuS_array = check_time_array[7].split("APIStatuS: "); + var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; + if ( (APIHanguP==1) && (VD_live_customer_call==1) ) + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + { + document.vicidial_form.DispoSelection.value = APIStatuS; + DispoSelect_submit(); + } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause em next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus em vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working em API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2325,6 +3101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAalter=0; var LMAcontent_change=0; var LMAcontent_match=0; + agentphonelive=0; var conv_start=-1; var live_conf_HTML = "VIVEM AS CHAMADAS EM SUA SESSÃO:
>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) @@ -2342,7 +3119,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) + var regXFcred = new RegExp(flag_string,"g"); + if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) + { + var chan_name_color = 'log_text_red'; + } + else + { + var chan_name_color = 'log_text'; + } + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; } @@ -2350,11 +3136,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (volumecontrol_active!=1) { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } else { - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -2373,7 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (volumecontrol_active > 0) { - if (protocol != 'EXTERNAL') + if ( (protocol != 'EXTERNAL') && (protocol != 'Local') ) { var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) @@ -2383,7 +3169,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } - else + else { if (agentchannel.length < 3) { @@ -2392,6 +3178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("AgentMuteSpan").innerHTML = ""; } } + // document.getElementById("agentchannelSPAN").innerHTML = agentchannel; } // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; @@ -2410,11 +3197,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (LMAalter > 0) {LMAcount++;} + if (agentchannel == channelfieldA) {agentphonelive++;} + ARY_ct++; } // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + if (agentphonelive < 1) {agentchannel='';} + live_conf_HTML = live_conf_HTML + "
#CANALETA REMOTAHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
" + loop_ct + "" + channelfieldA + "HANGUP          
"; if (LMAcontent_change > 0) @@ -2451,6 +3242,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { + if (inOUT == 'OUT') + { + var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + } + else + { + var tmp_vicidial_id = 'IN'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -2483,7 +3282,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var REGrecTINYDATE = new RegExp("TINYDATE","g"); var REGrecEPOCH = new RegExp("EPOCH","g"); var REGrecAGENT = new RegExp("AGENT","g"); - filename = campaign_rec_filename; + filename = LIVE_campaign_rec_filename; filename = filename.replace(REGrecCAMPAIGN, campaign); filename = filename.replace(REGrecCUSTPHONE, lead_dial_number); filename = filename.replace(REGrecFULLDATE, filedate); @@ -2495,7 +3294,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Pare"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -2510,7 +3309,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Comece"; - if (campaign_recording == 'ALLFORCE') + if (LIVE_campaign_recording == 'ALLFORCE') { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -2519,7 +3318,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; } } - confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1"; + confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(confmonitor_query); @@ -2558,26 +3357,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARQUE, FROMPARQUE, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { - var xmlhttp=false; + blind_transfer=1; + // conf_dialed=1; + if (auto_dial_level == 0) {RedirecTxFEr = 1;} + var xmlhttpXF=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"); + xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { - xmlhttp = false; + xmlhttpXF = false; } } @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (!xmlhttpXF && typeof XMLHttpRequest!='undefined') { - xmlhttp = new XMLHttpRequest(); + xmlhttpXF = new XMLHttpRequest(); } - if (xmlhttp) + if (xmlhttpXF) { var redirectvalue = MDchannel; var redirectserverip = lastcustserverip; @@ -2606,18 +3408,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} - else - { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - } - } + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} + if (omit_phone_code == 'Y') {var temp_phone_code = '';} + else {var temp_phone_code = document.vicidial_form.phone_code.value;} + + if (blindxferdialstring.length > 7) + {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } if (taskvar == 'XfeRVMAIL') @@ -2630,7 +3427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } } if (taskvar == 'XfeRINTERNAL') @@ -2646,28 +3443,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } if (taskvar == 'XfeR') { var queryCID = "LRvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'VMAIL') { var queryCID = "LVvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == 'ENTRY') { var queryCID = "LEvdcW" + epoch_sec + user_abb; var redirectdestination = document.vicidial_form.extension_xfer_entry.value; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; } if (taskvar == '3WAY') { @@ -2680,16 +3477,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - {var redirecttype = 'RedirectXtraCX';} + // {var redirecttype = 'RedirectXtraCX';} + {var redirecttype = 'RedirectXtraCXNeW';} else - {var redirecttype = 'RedirectXtra';} + // {var redirecttype = 'RedirectXtra';} + {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; if (taskdebugnote == 'FIRST') { @@ -2698,17 +3497,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Chamada"; customerparked=1; } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2723,32 +3524,94 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var dest_dialstring = session_id;} } - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id; document.getElementById("ParkControl").innerHTML ="\"Chamada"; customerparked=0; } - - xmlhttp.open('POST', 'manager_send.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(xferredirect_query); - xmlhttp.onreadystatechange = function() + var XFRDop = ''; + xmlhttpXF.open('POST', 'manager_send.php'); + xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF.send(xferredirect_query); + xmlhttpXF.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200) { - Nactiveext = null; - Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); + var XfeRRedirecToutput = null; + XfeRRedirecToutput = xmlhttpXF.responseText; + var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|"); + var XFRDop = XfeRRedirecToutput_array[0]; + if (XFRDop == "NeWSessioN") + { + threeway_end=1; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + dialedcall_send_hangup(); + + document.vicidial_form.xferchannel.value = ''; + xfercall_send_hangup(); + + session_id = XfeRRedirecToutput_array[1]; + document.getElementById("sessionIDspan").innerHTML = session_id; + + // alert("session_id changed to: " + session_id); + } + // alert(xferredirect_query + "\n" + xmlhttpXF.responseText); + // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; } } - delete xmlhttp; + delete xmlhttpXF; } + + // used to send second Redirect for manual dial calls + if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) + { + RedirecTxFEr = 1; + var xmlhttpXF2=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 { + xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttpXF2 = false; + } + } + @end @*/ + if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') + { + xmlhttpXF2 = new XMLHttpRequest(); + } + if (xmlhttpXF2) + { + xmlhttpXF2.open('POST', 'manager_send.php'); + xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); + xmlhttpXF2.onreadystatechange = function() + { + if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttpXF2.responseText; + // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); + } + } + delete xmlhttpXF2; + } + } + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { + if (auto_dial_level == 0) {RedirecTxFEr = 1;} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} + // alert(RedirecTxFEr + "|" + auto_dial_level); dialedcall_send_hangup(); } @@ -2760,6 +3623,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { alt_phone_dialing=starting_alt_phone_dialing; alt_dial_active = 0; + alt_dial_status_display = 0; open_dispo_screen=1; document.getElementById("MainStatuSSpan").innerHTML = "Número Seguinte Do Seletor"; } @@ -2767,7 +3631,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -2776,6 +3649,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 = "Número Alt Do Seletor: TELEFONE PRINCIPAL or ALT DEL TELEFONO or ENDEREÇO3 or REVESTIMENTO"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } @@ -2802,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -2818,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -2829,11 +3703,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICISELETOR Call log entered:\n" + document.vicidial_form.uniqueid.value); + // 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 = "\"Comece"; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -2859,6 +3733,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } delete xmlhttp; } + RedirecTxFEr=0; + conf_dialed=0; } @@ -2914,7 +3790,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("VOCÊ DEVE SER PAUSADO PARA VERIFICAR RECHAMADAS NA MODALIDADE DE AUTO-SELETOR"); + alert("VOCÊ DEVE SER PAUSADO PARA VERIFICAR RECHAMADAS NA MODALIDADE DE AUTO-DIAL"); } else { @@ -2956,7 +3832,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/TIMENÚMERONAMESTATUSCAMPAIGNLAST DATE/TIME DA CHAMADA COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -3002,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3024,7 +3900,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("VOCÊ DEVE SER PAUSADO Ao SELETOR MANUAL Uma LIGAÇÃO NOVA Na MODALIDADE De AUTO-SELETOR"); + alert("VOCÊ DEVE SER PAUSADO Ao SELETOR MANUAL Uma LIGAÇÃO NOVA Na MODALIDADE De AUTO-DIAL"); } else { @@ -3034,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + 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"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3042,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3079,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3090,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3098,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3152,10 +4060,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { MD_ring_secondS++; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); - document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + CIDcheck + "   Anel de espera... " + MD_ring_secondS + " segundos"; - // alert("channel not found yet:\n" + campaign); + var status_display_number = phone_number_format(dispnum); + + if (alt_dial_status_display=='0') + { + // alert(document.getElementById("MainStatuSSpan").innerHTML); + document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + CIDcheck + "   Anel de espera... " + MD_ring_secondS + " segundos"; + // alert("channel not found yet:\n" + campaign); + } } else { @@ -3214,13 +4127,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; MD_channel_look=0; var dispnum = lead_dial_number; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Chamado: " + status_display_number + " UID: " + CIDcheck + "  "; @@ -3240,7 +4154,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; - // INSERT VICISELETOR_LOG ENTRY FOR THIS CHAMADA PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS DialLog("start"); custchannellive=1; @@ -3263,16 +4177,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Número Seguinte Do Seletor request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { + inOUT = 'OUT'; all_record = 'NO'; all_record_count=0; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=0; + + AutoDial_ReSume_PauSe('VDADpause'); + + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Número"; + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Inspecione a ligação então LIGAÇÃO DO SELETOR or LIGAÇÃO DA FAIXA CLARA"; + var man_status = "Inspecione a ligação então LIGAÇÃO DO SELETOR or LIGAÇÃO DA FAIXA CLARA"; } else { @@ -3302,8 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3311,17 +4247,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "FUNIL VAZIO") || (MDnextCID == "DNC NÚMERO") ) + + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) { - if (MDnextCID == "FUNIL VAZIO") - {alert("Não mais conduz no funil para a campanha:\n" + campaign);} + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("Não mais conduz no funil para a campanha:\n" + campaign); alert_displayed=1;} + 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;} + if (alert_displayed==0) + {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Número"; + } else - {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} + { + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + reselect_alt_dial = 0; + } } else { @@ -3333,6 +4303,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; document.vicidial_form.phone_code.value = MDnextResponse_array[7]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = MDnextResponse_array[8]; + } document.vicidial_form.phone_number.value = MDnextResponse_array[8]; document.vicidial_form.title.value = MDnextResponse_array[9]; document.vicidial_form.first_name.value = MDnextResponse_array[10]; @@ -3363,73 +4338,99 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CBcomments = MDnextResponse_array[31]; dialed_number = MDnextResponse_array[32]; dialed_label = MDnextResponse_array[33]; + source_id = MDnextResponse_array[34]; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICISELETOR_web_QUERY_STRING =~ s/ /+/gi; -// $VICISELETOR_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - VDIC_web_form_address = VICIDiaL_web_form_address; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3442,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3458,7 +4451,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Cliente"; - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3468,6 +4461,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3479,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3491,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3505,7 +4510,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Número"; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Número"; + } var xmlhttp=false; /*@cc_on @*/ @@ -3554,7 +4568,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -3582,11 +4601,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go em to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Número"; + } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -3596,8 +4627,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Only - dial the previewed lead function ManualDialOnly(taskaltnum) { + inOUT = 'OUT'; + alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -3615,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = lead_dial_number; dialed_label = 'ADDR3'; WebFormRefresH(''); - } + } else { var manDiaLonly_num = document.vicidial_form.phone_number.value; @@ -3625,6 +4659,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ENDEREÇO3 ";} + 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; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -3646,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -3655,28 +4723,32 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " CHAMADA NOT PLACED") { alert("a chamada não foi colocada, não havia um erro:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; var dispnum = manDiaLonly_num; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); - document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + MDnextCID + "   Anel de espera..."; - - document.getElementById("HangupControl").innerHTML = "\"Cliente"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + if (alt_dial_status_display=='0') + { + document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + MDnextCID + "   Anel de espera..."; + + document.getElementById("HangupControl").innerHTML = "\"Cliente"; + } + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -3686,6 +4758,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[campaign_script],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -3697,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -3725,14 +4805,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } AutoDialReady = 1; AutoDialWaiting = 1; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } } else { var VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (dial_method == "INBOUND_MAN") + { + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -3764,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -3834,6 +4944,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + + 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(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -3880,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -3905,6 +5064,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_default_xfer_group = default_xfer_group;} + if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') ) + {LIVE_campaign_recording = VDIC_data_VDIG[12];} + else + {LIVE_campaign_recording = campaign_recording;} + + if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') ) + {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];} + else + {LIVE_campaign_rec_filename = campaign_rec_filename;} + + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -3919,11 +5103,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip = VDIC_data_VDAC[4]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; + document.getElementById("SecondSDISP").innerHTML = '0'; VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICISELETOR_LOG ENTRY FOR THIS CHAMADA PROCESS + // INSERT VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS // DialLog("start"); custchannellive=1; @@ -3935,6 +5120,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value = check_VDIC_array[9]; document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; document.vicidial_form.phone_code.value = check_VDIC_array[11]; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = check_VDIC_array[12]; + } document.vicidial_form.phone_number.value = check_VDIC_array[12]; document.vicidial_form.title.value = check_VDIC_array[13]; document.vicidial_form.first_name.value = check_VDIC_array[14]; @@ -3964,12 +5154,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; + + var gIndex = 0; + if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} + if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;} + document.getElementById("gender_list").selectedIndex = gIndex; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -3981,15 +5183,37 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT PROGR.SELEC NÚMERO: ENDEREÇO3 ";} + 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; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Altere este número de telefone para INATIVO";} + else + {EAactive_link = "Altere este número de telefone para ACTIVAS";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Ativa:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notas:" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { + inOUT = 'IN'; if (VDIC_data_VDIG[2].length > 2) { document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; } var dispnum = document.vicidial_form.phone_number.value; - var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } @@ -4012,79 +5236,104 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + + if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -4094,6 +5343,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var textname = decoded; URLDecode(scripttexts[CalL_ScripT_id],'YES'); var texttext = decoded; + var regWFplus = new RegExp("\\+","ig"); + textname = textname.replace(regWFplus, ' '); + texttext = texttext.replace(regWFplus, ' '); var testscript = "" + textname + "\n\n

\n\n" + texttext; document.getElementById("ScriptContents").innerHTML = testscript; } @@ -4105,9 +5357,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + + if (alert_enabled=='ON') + { + alert(" Entrante: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4123,84 +5385,103 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; } } @@ -4258,6 +5539,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send Hangup command for customer call connected to the conference now to Manager function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo) { + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} var form_cust_channel = document.vicidial_form.callchannel.value; var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; @@ -4267,10 +5552,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgainCalLSecondS = VD_live_call_secondS; AgaiNCalLCID = CalLCID; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('MAIN'); } if (form_cust_channel.length > 3) { @@ -4298,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLHANGUP"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -4308,6 +5593,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); // var HU_debug = xmlhttp.responseText; // var HU_debug_array=HU_debug.split(" "); @@ -4330,8 +5616,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICISELETOR_LOG ENTRY FOR THIS CHAMADA PROCESS + // UPDATE VICIDIAL_LOG ENTRY FOR THIS CHAMADA PROCESS DialLog("end"); + conf_dialed=0; if (dispowindow == 'NO') { open_dispo_screen=0; @@ -4421,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; } reselect_alt_dial = 0; } @@ -4447,7 +5734,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4456,7 +5750,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + } reselect_alt_dial = 0; } } @@ -4464,6 +5765,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ShoWTransferMain('OFF'); } + } @@ -4474,10 +5776,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var xferchannel = document.vicidial_form.xferchannel.value; var xfer_channel = lastxferchannel; var process_post_hangup=0; - if (MD_channel_look==1) + if ( (MD_channel_look==1) && (leaving_threeway < 1) ) { MD_channel_look=0; - DialTimeHangup(); + DialTimeHangup('XFER'); } if (xferchannel.length > 3) { @@ -4521,8 +5823,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} delete xmlhttp; } } - else {process_post_hangup=1;} - if (process_post_hangup==1) + else {process_post_hangup=1;} + if (process_post_hangup==1) { XD_live_customer_call = 0; XD_live_call_secondS = 0; @@ -4536,7 +5838,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; + // document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; @@ -4550,8 +5852,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect - function DialTimeHangup() + function DialTimeHangup(tasktypecall) { + if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) ) + { + // alert("RedirecTxFEr|" + RedirecTxFEr); MD_channel_look=0; var xmlhttp=false; /*@cc_on @*/ @@ -4585,11 +5890,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { Nactiveext = null; Nactiveext = xmlhttp.responseText; - // alert(xmlhttp.responseText); - } + // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway); + } } delete xmlhttp; } + } } @@ -4626,6 +5932,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { + + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value + @@ -4699,33 +6010,80 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-SELETOR"); + alert("VOCÊ DEVE SER PAUSADO PARA DAR ENTRADA A um CÓDIGO Da PAUSA NaMODALIDADE De AUTO-DIAL"); } else { - showDiv('PausaCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - PausaCode_HTML = ''; - document.vicidial_form.PausaCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - PausaCode_HTML = "
# CHAMADABACK DATE/TIMENÚMERONAME STATUSCAMPAIGNLAST DATE/TIME DA CHAMADA COMMENTS
PAUSA CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - PausaCode_HTML = PausaCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {PausaCode_HTML = PausaCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - PausaCode_HTML = PausaCode_HTML + "


Vá Para trás"; - document.getElementById("PausaCodeSelectContent").innerHTML = PausaCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Vá Para trás";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Grupo Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "COSTUMEER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Vá Para trás"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Você deve selecionar uma disposição");} @@ -4736,9 +6094,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Formulário"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -4749,7 +6109,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_list lead record with disposition selection function DispoSelect_submit() { - + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + leaving_threeway=0; + blind_transfer=0; + document.vicidial_form.callchannel.value = ''; + document.vicidial_form.callserverip.value = ''; + document.vicidial_form.xferchannel.value = ''; + document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + var DispoChoice = document.vicidial_form.DispoSelection.value; if (DispoChoice.length < 1) {alert("Você deve selecionar uma disposição");} @@ -4782,13 +6154,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -4808,7 +6180,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; + if (disable_alter_custphone=='Y') + { + var tmp_pn = document.getElementById("phone_numberDISP"); + tmp_pn.innerHTML = '                     '; + } + document.vicidial_form.phone_number.value = ''; document.vicidial_form.title.value =''; document.vicidial_form.first_name.value =''; document.vicidial_form.middle_initial.value =''; @@ -4830,60 +6207,72 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.called_count.value =''; VDCL_group_id = ''; fronter = ''; + inOUT = 'OUT'; if (manual_dial_in_progress==1) { manual_dial_finished(); } + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimize"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimize "; document.getElementById("DispoSelectHAspan").innerHTML = "Hangup Outra vez"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } + } @@ -4891,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Pausa Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -4915,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PausaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -4931,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Grupo Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + 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 + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -4949,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -4985,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Mostra message that there are no voice channels in the VICISELETOR session +// Mostra message that there are no voice channels in the VICIDIAL session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -5005,10 +6410,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; - if (protocol == 'EXTERNAL') + if ( (protocol == 'EXTERNAL') || (protocol == 'Local') ) { var protodial = 'Local'; - var extendial = extension + "@" + ext_context; + var extendial = extension; + // var extendial = extension + "@" + ext_context; } else { @@ -5054,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5142,8 +6548,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Update vicidial_live_agents record with closer in group choices function CloserSelect_submit() { + if (dial_method == "INBOUND_MAN") + {document.vicidial_form.CloserSelectBlended.checked=false;} if (document.vicidial_form.CloserSelectBlended.checked==true) {VICIDiaL_closer_blended = 1;} + else + {VICIDiaL_closer_blended = 0;} var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -5171,7 +6581,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_choice=" + CloserSelectChoices + "-"; + CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CSCupdate_query); @@ -5197,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5205,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Você não pode registrar para fora durante uma tentativa do seletor. \nEspere 50 segundos pelo seletor para falhar para fora se não se");} @@ -5238,7 +6648,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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; + 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); @@ -5254,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "ESTALE AQUI PARA LOGON OUTRA VEZ\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "ESTALE AQUI PARA LOGON OUTRA VEZ\n"; logout_stop_timeouts = 1; @@ -5388,10 +6801,14 @@ else var encoded = encodedvar; decoded = ''; var i = 0; - var RGnl = new RegExp("\n","g"); + var RGnl = new RegExp("[\r]\n","g"); var RGplus = new RegExp(" ","g"); var RGiframe = new RegExp("iframe","gi"); +var xtest; +xtest=unescape(encoded); +encoded=utf8_decode(xtest); + if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; @@ -5435,6 +6852,7 @@ else var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -5477,6 +6895,7 @@ else SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -5520,6 +6939,7 @@ else var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -5562,31 +6982,114 @@ else encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } - while (i < encoded.length) { - var ch = encoded.charAt(i); - if (ch == "%") { - if (i < (encoded.length-2) - && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 - && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { - decoded += unescape( encoded.substr(i,3) ); - i += 3; - } else { - alert( 'Bad escape combo near ...' + encoded.substr(i) ); - decoded += "%[ERR]"; - i++; - } - } else { - decoded += ch; - i++; - } - } // while - decoded = decoded.replace(RGnl, "
"); - +decoded=encoded; // simple no ? +decoded = decoded.replace(RGnl, "
"); +// while (i < encoded.length) { +// var ch = encoded.charAt(i); +// if (ch == "%") { +// if (i < (encoded.length-2) +// && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1 +// && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) { +// decoded += unescape( encoded.substr(i,3) ); +// i += 3; +// } else { +// alert( 'Bad escape combo near ...' + encoded.substr(i) ); +// decoded += "%[ERR]"; +// i++; +// } +// } else { +// decoded += ch; +// i++; +// } +// } // while +// decoded = decoded.replace(RGnl, "
"); +// return false; }; +// ################################################################################ +// Taken form php.net Angelos +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + }; + + +// ################################################################################ +// phone number format +function phone_number_format(formatphone) { + // customer_local_time, status date display 9999999999 + // vdc_header_phone_format + // US_DASH 000-000-0000 - USA dash separated phone number
+ // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis
+ // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code
+ // AU_SPAC 000 000 000 - Australia space separated phone number
+ // IT_DASH 0000-000-000 - Italy dash separated phone number
+ // FR_SPAC 00 00 00 00 00 - France space separated phone number
+ var regUS_DASHphone = new RegExp("US_DASH","g"); + var regUS_PARNphone = new RegExp("US_PARN","g"); + var regUK_DASHphone = new RegExp("UK_DASH","g"); + var regAU_SPACphone = new RegExp("AU_SPAC","g"); + var regIT_DASHphone = new RegExp("IT_DASH","g"); + var regFR_SPACphone = new RegExp("FR_SPAC","g"); + var status_display_number = formatphone; + var dispnum = formatphone; + if (vdc_header_phone_format.match(regUS_DASHphone)) + { + var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUS_PARNphone)) + { + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regUK_DASHphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10); + } + if (vdc_header_phone_format.match(regAU_SPACphone)) + { + var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9); + } + if (vdc_header_phone_format.match(regIT_DASHphone)) + { + var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10); + } + if (vdc_header_phone_format.match(regFR_SPACphone)) + { + var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10); + } + + return status_display_number; + }; + // ################################################################################ // Move the Dispo frame out of the way and change the link to maximize @@ -5596,7 +7099,7 @@ else showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maximize"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maximize "; } @@ -5605,13 +7108,28 @@ else function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimize"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimize "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); } +// ################################################################################ +// Mostra the groups selection span + function OpeNGrouPSelectioN() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + { + alert("Você deve estar PAUSED PARA ALTERAR GRUPOS"); + } + else + { + showDiv('CloserSelectBox') + } + } + + // ################################################################################ // Hide the CBcommentsBox span upon click function CBcommentsBoxhide() @@ -5628,6 +7146,27 @@ else } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Mostra the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -5748,6 +7287,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -5755,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -5766,32 +7308,38 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('PausaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatusSpan');} - if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) ) {clearDiv('DiaLLeaDPrevieW');} if (alt_phone_dialing != 1) {clearDiv('DiaLDiaLAltPhonE');} if (volumecontrol_active != '1') {hideDiv('VolumeControlSpan');} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} + document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PausaCodeLinkSpan").innerHTML = "DÊ ENTRADA A um CÓDIGO Da PAUSA"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "DÊ ENTRADA A um CÓDIGO Da PAUSA"; } if (VICIDiaL_allow_closers < 1) { document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; - if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) + if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -5808,6 +7356,18 @@ else hideDiv('CloserSelectBox'); MainPanelToFront(); var CloserSelecting = 0; + if (dial_method == "INBOUND_MAN") + { + dial_method = "MANUAL"; + auto_dial_level=0; + starting_dial_level=0; + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + } + } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + } VICIDiaL_closer_login_checked = 1; } @@ -5826,18 +7386,22 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; LIVE_default_xfer_group = default_xfer_group; + LIVE_campaign_recording = campaign_recording; + LIVE_campaign_rec_filename = campaign_rec_filename; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -5881,6 +7445,7 @@ else { VD_live_call_secondS++; document.vicidial_form.SecondS.value = VD_live_call_secondS; + document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS; } if (XD_live_customer_call==1) { @@ -5950,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -5964,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -5985,6 +7551,11 @@ else var hours = t.getHours(); var min = t.getMinutes(); var sec = t.getSeconds(); + var regMSdate = new RegExp("MS_","g"); + var regUSdate = new RegExp("US_","g"); + var regEUdate = new RegExp("EU_","g"); + var regALdate = new RegExp("AL_","g"); + var regAMPMdate = new RegExp("AMPM","g"); if (year < 1000) {year+=1900} if (month< 10) {month= "0" + month} if (daym< 10) {daym= "0" + daym} @@ -5995,7 +7566,49 @@ else filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec; tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec; SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec; - document.getElementById("status").innerHTML = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec + display_message; + + var status_date = ''; + var status_time = hours + ":" + min + ":" + sec; + if (vdc_header_date_format.match(regMSdate)) + { + status_date = year + "-" + month + "-" + daym; + } + if (vdc_header_date_format.match(regUSdate)) + { + status_date = month + "/" + daym + "/" + year; + } + if (vdc_header_date_format.match(regEUdate)) + { + status_date = daym + "/" + month + "/" + year; + } + if (vdc_header_date_format.match(regALdate)) + { + var statusmon=''; + if (mon == 1) {statusmon = "JAN";} + if (mon == 2) {statusmon = "FEV";} + if (mon == 3) {statusmon = "MAR";} + if (mon == 4) {statusmon = "ABR";} + if (mon == 5) {statusmon = "POS";} + if (mon == 6) {statusmon = "JUN";} + if (mon == 7) {statusmon = "JLY";} + if (mon == 8) {statusmon = "AGO";} + if (mon == 9) {statusmon = "SET";} + if (mon == 10) {statusmon = "OUT";} + if (mon == 11) {statusmon = "NOV";} + if (mon == 12) {statusmon = "DEZ";} + + status_date = statusmon + " " + daym; + } + if (vdc_header_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (hours == 12) {AMPM = 'PM';} + if (hours == 0) {AMPM = 'AM'; hours = '12';} + if (hours > 12) {hours = (hours - 12); AMPM = 'PM';} + status_time = hours + ":" + min + ":" + sec + " " + AMPM; + } + + document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); @@ -6004,35 +7617,64 @@ else var UnixTimec = (UnixTime + (3600 * customer_gmt_diff)); var UnixTimeMSc = (UnixTimec * 1000); c.setTime(UnixTimeMSc); + var Cyear= c.getYear() var Cmon= c.getMonth() - // Cmon++; + Cmon++; var Cdaym= c.getDate() var Chours = c.getHours(); var Cmin = c.getMinutes(); var Csec = c.getSeconds(); + if (Cyear < 1000) {Cyear+=1900} if (Cmon < 10) {Cmon= "0" + Cmon} if (Cdaym < 10) {Cdaym= "0" + Cdaym} if (Chours < 10) {Chours = "0" + Chours;} if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;} if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;} - if (Cmon == 0) {Cmon = "JAN";} - if (Cmon == 1) {Cmon = "FEV";} - if (Cmon == 2) {Cmon = "MAR";} - if (Cmon == 3) {Cmon = "ABR";} - if (Cmon == 4) {Cmon = "POS";} - if (Cmon == 5) {Cmon = "JUN";} - if (Cmon == 6) {Cmon = "JLY";} - if (Cmon == 7) {Cmon = "AGO";} - if (Cmon == 8) {Cmon = "SET";} - if (Cmon == 9) {Cmon = "OUT";} - if (Cmon == 10) {Cmon = "NOV";} - if (Cmon == 11) {Cmon = "DEZ";} - if (Chours == 12) {AMPM = 'PM';} - if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} if (Cmin < 10) {Cmin = "0" + Cmin;} if (Csec < 10) {Csec = "0" + Csec;} - var customer_local_time = Cmon + " " + Cdaym + " " + Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + var customer_date = ''; + var customer_time = Chours + ":" + Cmin + ":" + Csec; + if (vdc_customer_date_format.match(regMSdate)) + { + customer_date = Cyear + "-" + Cmon + "-" + Cdaym; + } + if (vdc_customer_date_format.match(regUSdate)) + { + customer_date = Cmon + "/" + Cdaym + "/" + Cyear; + } + if (vdc_customer_date_format.match(regEUdate)) + { + customer_date = Cdaym + "/" + Cmon + "/" + Cyear; + } + if (vdc_customer_date_format.match(regALdate)) + { + var customermon=''; + if (Cmon == 1) {customermon = "JAN";} + if (Cmon == 2) {customermon = "FEV";} + if (Cmon == 3) {customermon = "MAR";} + if (Cmon == 4) {customermon = "ABR";} + if (Cmon == 5) {customermon = "POS";} + if (Cmon == 6) {customermon = "JUN";} + if (Cmon == 7) {customermon = "JLY";} + if (Cmon == 8) {customermon = "AGO";} + if (Cmon == 9) {customermon = "SET";} + if (Cmon == 10) {customermon = "OUT";} + if (Cmon == 11) {customermon = "NOV";} + if (Cmon == 12) {customermon = "DEZ";} + + customer_date = customermon + " " + Cdaym + " "; + } + if (vdc_customer_date_format.match(regAMPMdate)) + { + var AMPM = 'AM'; + if (Chours == 12) {AMPM = 'PM';} + if (Chours == 0) {AMPM = 'AM'; Chours = '12';} + if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';} + customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM; + } + + var customer_local_time = customer_date + " " + customer_time; document.vicidial_form.custdatetime.value = customer_local_time; } @@ -6137,6 +7779,8 @@ else var buildDivHTML = " ALT DO TELEFONE
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } function buildDiv(divvar) @@ -6159,6 +7803,8 @@ else document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} + if (DefaulTAlTDiaL == '1') + {document.vicidial_form.DiaLAltPhonE.checked=true;} } } } @@ -6234,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Transferência"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + 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"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -6246,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -6272,20 +7933,29 @@ else } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - clearDiv('DiaLLeaDPrevieW'); + if (dial_method == "INBOUND_MAN") + { + document.getElementById("DiaLControl").innerHTML = "\"\"Resumo\"
\"Número"; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + } + else + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -6299,20 +7969,24 @@ else div.scroll_script {height: px; width: px; 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;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .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} .log_title {font-size: 12px; font-family: monospace; font-weight: bold;} .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} + .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: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -6327,18 +8001,21 @@ echo "\n"; MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
- + -LOGOUT\n"; ?> +     + + 0) {echo "GROUPS     \n";} ?> +LOGOUT\n"; ?>
height=30> - + - +
VICISELETORVICIDIAL SCRIPT VALIGN=MIDDLE ALIGN=CENTER>   LIVE     sessão ID: VALIGN=MIDDLE ALIGN=CENTER>   LIVE     sessão ID:     Vive A Chamada
@@ -6346,7 +8023,7 @@ echo "\n"; - height=>

VICISELETOR
+ height=>

VICIDIAL
@@ -6357,8 +8034,12 @@ echo "\n"; X RECHAMADAS ATIVAS
- -
+ +
+
+ + segundos: +     @@ -6375,7 +8056,7 @@ echo "\n";
- + height=460>
RECHAMADAS PARA O AGENTE :
Estale sobre uma rechamada abaixo para chamar agora a parte traseira do cliente. Se você estalar sobre um registro abaixo para o chamar, estará removido da lista.
@@ -6386,7 +8067,7 @@ echo "\n";
- + height=460> - +
LIGAÇÃO MANUAL NOVA DO SELETOR PARA :

Incorpore a informação abaixo para a ligação que nova você deseja se chamar.
\n";
  (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)


Se você quiser marcar um número e o ter não adicionado como uma ligação nova, entre no dialstring exato esse você querem chamar-se abaixo no campo da ultrapassagem do seletor. Ao hangup esta chamada você terá que abrir as CHAMADAS ncEsta ligação da SESSÃO no fundo da tela e pendurá-las acima estalando em sua ligação da canaleta lá.
 
+

+     +
+

Se você quiser marcar um número e o ter não adicionado como uma ligação nova, entre no dialstring exato esse você querem chamar-se abaixo no campo da ultrapassagem do seletor. Ao hangup esta chamada você terá que abrir as CHAMADAS ncEsta ligação da SESSÃO no fundo da tela e pendurá-las acima estalando em sua ligação da canaleta lá.
 
Ultrapassagem Do Seletor:   (os dígitos satisfazem somente)

- Seletor Agora + Seletor Agora +                 + Preview Call                 Vá Para trás
@@ -6430,7 +8117,7 @@ echo "\n"; -Seu Status:
Calls Dialing: +Seu Status:
Calls Dialing:
@@ -6440,7 +8127,7 @@ Seu Status:
Calls Dialing: - Transferência - Conferência
+ Transferência - Conferência            
LOCAL MAIS PRÓXIMO @@ -6451,8 +8138,8 @@ Seu Status:
Calls Dialing:   - ULTRAPASSAGEM DO SELETOR   - CHAMADA DA LICENÇA 3-WAY + ULTRAPASSAGEM DO SELETOR   +
CHAMADA DA LICENÇA 3-WAY Transferência Da Cortina Do Seletor D1 D2 @@ -6512,7 +8199,31 @@ Seu Status:
Calls Dialing: + + height=70> + + + + + + +
Extensão Alt Telefone Informação: minimize
+
+
+
+
+ +
+
+ + + + + +
maximize
Alt Telefone Info
+
+ + height=500>
Noone está em sua sessão:
Vá Para trás

@@ -6520,7 +8231,7 @@ Seu Status:
Calls Dialing: + height=500>
O cliente pendurou acima:
Vá Para trás

@@ -6529,7 +8240,7 @@ Seu Status:
Calls Dialing: + height=550>
Chamada Wrapup: segundos restantes no wrapup



@@ -6538,29 +8249,34 @@ Seu Status:
Calls Dialing: - height=500>
Sua sessão foi incapacitada
LOGOUT

Vá Para trás + + height=500>
Sua sessão foi incapacitada
LOGOUT

Vá Para trás
- + + height=500>
Há um tempo sincronização problema com o seu sistema, por favor informe o seu administrador de sistema


Vá Para trás +
+
+ + height=500>

LOGOUT
- +
- +
 
- + height=47>
Todas as mudanças feitas ao cliente que a informação abaixo neste tempo não será comitted, você devem mudar a informação do cliente antes de você hangup a chamada.
- - height=460>
CHAMADA DA DISPOSIÇÃO :       Hangup Outra vez       minimize
+ + height=460>
CHAMADA DA DISPOSIÇÃO :       Hangup Outra vez       minimize
Extremidade-$$$-CHAME A Seleção Da Disposição
PARE DE CHAMAR-SE
@@ -6572,15 +8288,26 @@ Seu Status:
Calls Dialing: + height=460>
SELECIONE Um CÓDIGO Da PAUSA :
- Pausa Code Selection - + Pausa Code Selection +

 
- + + height=460>
Selecionar um grupo ALIÁS :
+ Grupo Alias Selecção + +

  +
+
+ + + + + height=460>\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
Selecione uma data da rechamada :
@@ -6604,7 +8331,17 @@ Seu Status:
Calls Dialing: + + + + + + + + + +  

+ Comentários dos CB:

SUBMETA

@@ -6623,30 +8360,39 @@ Seu Status:
Calls Dialing: + height=460>
SELEÇÃO DE GRUPO INBOUND MAIS PRÓXIMA
Seleção De Grupo Inbound Mais próxima
- CHAMADA MISTURADA(outbound ativado)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + CHAMADA MISTURADA(outbound ativado)
+ RESTAURAÇÃO | SUBMETA



 
- + Canaleta Canaleta MINHA RECHAMADA SOMENTE
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " CHAMADA MISTURADA
";} ?>
- height=>
VICISELETOR SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -6656,28 +8402,36 @@ Seu Status:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> -> - +
Versão do correia-cliente de VICISELETOR:     CONFIGURAÇÃO:               Usuário:              
+> +
Versão do correia-cliente de VICIDIAL:     CONFIGURAÇÃO:               Usuário:              
Mostre a informação da canaleta da chamada de conferência

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
- +
- + - id="MainTable"> +
id="MainTable"> @@ -6719,45 +8473,82 @@ ID REGISTRO:
+
STATUS:
-Número Seguinte Do Seletor
+Número Seguinte Do Seletor
INSPECÇÃO PRÉVIA DA LIGAÇÃO
ALT DO TELEFONE
@@ -6696,7 +8450,7 @@ LIMA DE GRAVAÇÃO:
ID REGISTRO:
-Comece Gravar
+Comece Gravar

Formulário Da Correia fotorreceptora

@@ -6705,7 +8459,7 @@ ID REGISTRO:

Cliente Do Hangup

-
Emita DTMF

+
Emita DTMF

- - + + +
segundos:   Canaleta:   Tempo De Cust:   Customer Time:   Canaleta:
Informação Do Cliente:
+ + + - + - + - + + + - + + + + + - + + + + + - + + + + + - + + + - + + +
Título:   Primeiramente:   Mi:  Último:   Prime:   Mi:  Último:
Endereço1:
Endereço2:   Endereço3: Endereço3:
Cidade:   Estado:   PostCode: Estado: PostCode:
Província:   Vendedor Id: Vendedor Id: Sexo:
Telefone:   DialCode:   Alt. Telefone: +                     "; + echo ""; + } +else + { + echo ""; + } +?> + +DialCode: Alt. Telefone:
Mostra:   Email: Email:
Comentários: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -6773,7 +8564,7 @@ else
@@ -6788,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/agc_pt/voicemail_check.php b/LANG_www/agc_pt/voicemail_check.php index 5a03e14a..9a60dae6 100644 --- a/LANG_www/agc_pt/voicemail_check.php +++ b/LANG_www/agc_pt/voicemail_check.php @@ -1,21 +1,21 @@ LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - +# voicemail_check.php version 2.0.5 +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# +# This script is designed purely to check whether the voicemail box on the server defined has new and old messages +# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table +# +# required variables: +# - $server_ip +# - $session_name +# - $user +# - $pass +# optional variables: +# - $format - ('text','debug') +# - $vmail_box - ('101','1234',...) +# +# # changes # 50422-1147 - First build of script # 50503-1241 - added session_name checking for extra security diff --git a/LANG_www/agc_sk/conf_exten_check.php b/LANG_www/agc_sk/conf_exten_check.php index c5752ceb..3cfd457b 100644 --- a/LANG_www/agc_sk/conf_exten_check.php +++ b/LANG_www/agc_sk/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -38,8 +38,19 @@ # 80424-0442 - Added non_latin lookup from system_settings # 80519-1425 - Added calls-in-queue tally # 80703-1106 - Added API functionality for Hangup and Dispo +# 81104-0229 - Added mysql error logging capability +# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 90102-1402 - Added check for system and database time synchronization +# 90120-1720 - Added compatibility for API pause/resume and dial a number +# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours # +$version = '2.0.5-18'; +$build = '90307-1855'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=17; +$one_mysql_log=0; + require("dbconnect.php"); ### If you have globals turned off uncomment these lines @@ -75,6 +86,7 @@ header ("Pragma: no-cache"); // HTTP/1.0 ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -102,8 +114,6 @@ $Alogin='N'; $RingCalls='N'; $DiaLCalls='N'; -$version = '2.0.4-12'; -$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -116,6 +126,7 @@ $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' a if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -137,6 +148,7 @@ $auth=$row[0]; $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -185,6 +197,7 @@ echo " $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Acount=$row[0]; @@ -193,6 +206,7 @@ echo " $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Astatus=$row[0]; } @@ -209,6 +223,16 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } if ($campagentstdisp == 'YES') { @@ -216,6 +240,7 @@ echo " $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; @@ -227,15 +252,17 @@ echo " $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + 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 = "Calls in Queue: $RingCalls";} - else {$RingCalls = "Calls in Queue: $RingCalls";} + if ($RingCalls > 0) {$RingCalls = "Hovory v Queue: $RingCalls";} + else {$RingCalls = "Hovory v Queue: $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')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $DiaLCalls=$row[0]; @@ -257,28 +284,138 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 5) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } ### grab the API hangup and API dispo fields in vicidial_live_agents - $stmt="SELECT external_hangup,external_status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $external_hangup = $row[0]; $external_status = $row[1]; + $external_pause = $row[2]; + $external_dial = $row[3]; if (strlen($external_status)<1) {$external_status = '::::::::::';} - if ($Acount < 1) {$Alogin='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} + $web_epoch = date("U"); + $stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $server_epoch = $row[0]; + $db_epoch = $row[1]; + $time_diff = ($server_epoch - $db_epoch); + $web_diff = ($db_epoch - $web_epoch); - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stav: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . "|\n"; + + ##### grab the shift information the agent + $stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $VU_user_group = $row[0]; + $VU_agent_shift_enforcement_override = $row[1]; + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $shift_enforcement = $row[0]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR + $Ashift_logout=0; + if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|SPUSTIŤ",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if (strlen($LOGgroup_shiftsSQL) < 3) + {$Ashift_logout++;} + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ($shift_ok < 1) + {$Ashift_logout++;} + } + } + + + if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) ) + {$Alogin='TIME_SYNC';} + if ($Acount < 1) + {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) + {$Alogin='DEAD_EXTERNAL';} + if ($Ashift_logout > 0) + {$Alogin='SHIFT_ODHLÁSIŤ';} + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stav: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n"; } $total_conf=0; $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$sip_list = mysql_num_rows($rslt);} # echo "$sip_list|"; $loop_count=0; @@ -292,6 +429,7 @@ echo " $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$channels_list = mysql_num_rows($rslt);} # echo "$channels_list|"; $loop_count=0; @@ -334,6 +472,7 @@ echo " $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $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 "Konferencia $conf_exten bol zaregistrovaný $exten\n"; } @@ -350,4 +489,26 @@ if ($format=='debug') exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_sk/inbound_popup.php b/LANG_www/agc_sk/inbound_popup.php index 3801f7e9..dd4b3c96 100644 --- a/LANG_www/agc_sk/inbound_popup.php +++ b/LANG_www/agc_sk/inbound_popup.php @@ -319,7 +319,7 @@ echo "$NOW_TIME

\n"; echo "
Volané číslo: $row[8]
Poznámka: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
Poznámky:$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; echo "POLOŹIŤ - \n"; echo "POSLAŤ DO MOJEJ HLASOVEJ SCHRÁNKY\n"; diff --git a/LANG_www/agc_sk/manager_send.php b/LANG_www/agc_sk/manager_send.php index 57d29094..e4133a15 100644 --- a/LANG_www/agc_sk/manager_send.php +++ b/LANG_www/agc_sk/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 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 @@ -36,7 +36,11 @@ # - $session_id - ('8600051') # - $FROMvdc - ('YES','NO') # - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...) - +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50401-1002 - First build of script, Hangup function only # 50404-1045 - Redirect basic function enabled @@ -77,8 +81,18 @@ # 80915-1755 - Rewrote leave-3way functions for external calling # 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call # 81020-1459 - Fixed bugs in queue_log logging +# 81104-0203 - Added mysql error logging capability +# 90303-1144 - Fixed manual dial live hangup bug +# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables +# 90305-1040 - Added agent_dialed_number and type for user_call_log feature # +$version = '2.0.5-38'; +$build = '90305-1040'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=83; +$one_mysql_log=0; + require("dbconnect.php"); ### These are variable assignments for PHP globals off @@ -152,6 +166,15 @@ if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -161,6 +184,7 @@ header ("Pragma: no-cache"); // HTTP/1.0 ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -185,8 +209,6 @@ if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '2.0.5-34'; -$build = '81020-1459'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -197,6 +219,7 @@ $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' a if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -218,6 +241,7 @@ $auth=$row[0]; $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -267,6 +291,7 @@ if ($ACTION=="SysCIDOriginate") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);} echo "Originate príkaz poslaný pre Exten $exten Kanál $channel na $server_ip\n"; } } @@ -294,6 +319,7 @@ if ($ACTION=="OriginateName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -323,6 +349,7 @@ if ($ACTION=="OriginateNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -360,10 +387,27 @@ if ($ACTION=="Originate") {$outCID = "\"$queryCID\" <$outbound_cid>";} else {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - echo "Originate príkaz poslaný pre Exten $exten Kanál $channel na $server_ip\n"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Originate príkaz poslaný pre Exten $exten Kanál $channel na $server_ip |$account|$variable|\n"; + + 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','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } } } @@ -390,12 +434,14 @@ if ($ACTION=="HangupConfDial") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $ACTION="Hangup"; @@ -414,6 +460,7 @@ if ($ACTION=="Hangup") $stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} $row=''; $rowx=''; $channel_live=1; @@ -447,6 +494,7 @@ $rslt=mysql_query($stmt, $link); $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -455,6 +503,7 @@ $rslt=mysql_query($stmt, $link); $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { @@ -467,6 +516,29 @@ $rslt=mysql_query($stmt, $link); } } } + if ( ($auto_dial_level < 1) and (strlen($stage)>2) and (strlen($channel)>2) and (strlen($exten)>2) ) + { + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension NOT LIKE \"%$exten%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02083',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $channel_live=0; + echo "Kanál $channel in use by another agent na $call_server_ip, Hangup príkaz nebol vložený $rowx[0]\n$stmt\n"; + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|MDCHU|$user|$channel|$call_server_ip|$exten|\n"); + fclose($fp); + } + } + else + { + echo "$stmt\n"; + } + } if ($channel_live==1) { @@ -474,6 +546,7 @@ $rslt=mysql_query($stmt, $link); { $stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($format=='debug') {echo "\n";} if ($rowx[0] > 0) @@ -482,6 +555,7 @@ $rslt=mysql_query($stmt, $link); ##### SPUSTIŤ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);} if ($format=='debug') {echo "\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -505,6 +579,7 @@ $rslt=mysql_query($stmt, $link); $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_cn_ct = mysql_num_rows($rslt); if ($VAC_cn_ct > 0) { @@ -517,6 +592,7 @@ $rslt=mysql_query($stmt, $link); ### grab call lead information needed for QM logging $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) { @@ -539,6 +615,7 @@ $rslt=mysql_query($stmt, $link); $stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) { @@ -552,6 +629,7 @@ $rslt=mysql_query($stmt, $link); $time_id=0; $stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_eq_ct = mysql_num_rows($rslt); if ($VAC_eq_ct > 0) { @@ -565,6 +643,7 @@ $rslt=mysql_query($stmt, $link); if ($format=='debug') {echo "\n";} $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); if ($format=='debug') {echo "\n";} } @@ -576,6 +655,7 @@ $rslt=mysql_query($stmt, $link); $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);} echo "Hangup príkaz poslaný pre Kanál $channel na $call_server_ip\n"; } } @@ -610,24 +690,28 @@ if ($ACTION=="RedirectVD") $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);} } if ($auto_dial_level < 1) { $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; if ($format=='debug') {echo "\n";} $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);} } $ACTION="Redirect"; } @@ -654,6 +738,7 @@ if ($ACTION=="RedirectToPark") $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -677,6 +762,7 @@ if ($ACTION=="RedirectFromPark") $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } } @@ -699,6 +785,7 @@ if ($ACTION=="RedirectName") $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -728,6 +815,7 @@ if ($ACTION=="RedirectNameVmail") $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) { @@ -778,41 +866,54 @@ if ($ACTION=="RedirectXtraCXNeW") $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 1) { $stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);} $stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtC, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $exten = $row[0]; + if ( (ereg("^8300",$extension)) and ($protocol == 'Local') ) + { + $extension = "$extension$user"; + } + $stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtD, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);} $stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtE, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);} $queryCID = "CXAR24$NOWnum"; $stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtF, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);} $stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtG, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);} if ($auto_dial_level < 1) { $stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtH, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);} } // $fp = fopen ("./vicidial_debug_3way.txt", "a"); @@ -837,12 +938,14 @@ if ($ACTION=="RedirectXtraCXNeW") $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -854,12 +957,14 @@ if ($ACTION=="RedirectXtraCXNeW") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -873,6 +978,7 @@ if ($ACTION=="RedirectXtraCXNeW") $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) { @@ -885,6 +991,7 @@ if ($ACTION=="RedirectXtraCXNeW") $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $dest_server_ip = $rowx[0]; $dest_session_id = $rowx[1]; @@ -905,10 +1012,12 @@ if ($ACTION=="RedirectXtraCXNeW") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);} echo "RedirectXtraCX príkaz poslaný pre Kanál $channel na $call_server_ip and \nHungup $extrachannel na $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel na $call_server_ip, Hungup $extrachannel na $server_ip";} @@ -984,41 +1093,49 @@ if ($ACTION=="RedirectXtraNeW") $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 1) { $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $exten = $row[0]; $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} $queryCID = "CXAR23$NOWnum"; $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} if ($auto_dial_level < 1) { $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} } echo "NeWSessioN|$exten|\n"; @@ -1039,12 +1156,14 @@ if ($ACTION=="RedirectXtraNeW") $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -1056,12 +1175,14 @@ if ($ACTION=="RedirectXtraNeW") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -1077,6 +1198,7 @@ if ($ACTION=="RedirectXtraNeW") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);} echo "RedirectXtra príkaz poslaný pre Kanál $channel and \nExtraKanál $extrachannel\n to $exten na $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten na $server_ip";} @@ -1098,10 +1220,12 @@ if ($ACTION=="RedirectXtraNeW") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);} echo "RedirectXtra príkaz poslaný pre Kanál $channel na $call_server_ip and \nExtraKanál $extrachannel\n to $exten na $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} @@ -1438,12 +1562,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); $channel=$rowx[0]; $channel = eregi_replace("1$","2",$channel); @@ -1470,12 +1596,14 @@ if ($ACTION=="Redirect") $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -1488,6 +1616,7 @@ if ($ACTION=="Redirect") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} echo "Redirect príkaz poslaný pre Kanál $channel na $server_ip\n"; } @@ -1518,12 +1647,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) { @@ -1536,15 +1667,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} if ($ACTION=="Monitor") { $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; @@ -1553,6 +1687,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) { $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1567,6 +1702,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -1604,10 +1740,12 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysql_affected_rows($link); if ($RLaffected_rows > 0) { @@ -1620,6 +1758,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $VLA_inOUT='NONE'; $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLA_inOUT_ct = mysql_num_rows($rslt); if ($VLA_inOUT_ct > 0) @@ -1640,6 +1779,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -1650,6 +1790,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} } } } @@ -1664,6 +1805,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) ### find the value to put in the vicidial_id field if this was an inbound call $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) { @@ -1679,6 +1821,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysql_num_rows($rslt); if ($rec_count>0) @@ -1693,12 +1836,14 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going na in this conference # and extension = '$exten' $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} # $rec_count = intval(mysql_num_rows($rslt) / 2); $rec_count = mysql_num_rows($rslt); $h=0; @@ -1714,6 +1859,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} $i++; } @@ -1749,6 +1895,7 @@ if ($ACTION=="VolumeControl") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $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 príkaz poslaný pre Konferencia $exten, Stage $stage Kanál $channel na $server_ip\n"; } } @@ -1771,9 +1918,26 @@ if ($format=='debug') {echo "\n\n\n";} exit; + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> - - - - - diff --git a/LANG_www/agc_sk/timeclock.php b/LANG_www/agc_sk/timeclock.php new file mode 100644 index 00000000..77570d86 --- /dev/null +++ b/LANG_www/agc_sk/timeclock.php @@ -0,0 +1,455 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field +# 80525-2351 - Added an audit log that is not to be editable +# 80602-0641 - Fixed status update bug +# + +$version = '2.0.5-4'; +$build = '80602-0641'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$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://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +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($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url 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]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +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 ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "Užívateľa a heslo, ktoré ste zadali, nie sú aktívne v systéme
Prosím, skúste to znova:"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Meno užívateľa:
Heslo užívateľa:
 

VERZIA: $version       POSTAVENÉ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### 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]; + + $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'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='SPUSTIŤ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='SPUSTIŤ'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'SPUSTIŤ') ) + { + ### You cannot log in or out within 30 sekúnd of your last login/logout + $VDdisplayMESSAGE = "Nemôžete sa prihlásiť alebo sa do 30 sekúnd od vášho posledného prihlásenia alebo odhlásenie"; + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Meno užívateľa:
Heslo užívateľa:
 

VERZIA: $version       POSTAVENÉ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTOODHLÁSIŤ') or ($status=='SPUSTIŤ') or ($status=='ODHLÁSIŤ') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "Teraz ste prihlásený-out"; + $LOGtimeMESSAGE = "Ste odhlásený na$NOW_TIME
Množstvo času, ste prihlásený-in:$totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='ODHLÁSIŤ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $timeclock_id = mysql_insert_id($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='ODHLÁSIŤ', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Add a record to the timeclock audit log + $stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='ODHLÁSIŤ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock audit log + $stmt="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 "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTOODHLÁSIŤ') or ($status=='SPUSTIŤ') or ($status=='ODHLÁSIŤ') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) ) + {echo "ERROR: timeclock log vstupe už bolo dosiahnuté:$status|$stage"; exit;} + + if ($referrer=='agent') + {$BACKlink = "SPÄŤ na Agent Prihlásiť obrazovky";} + if ($referrer=='admin') + {$BACKlink = "SPÄŤ na administratívne";} + if ($referrer=='welcome') + {$BACKlink = "SPÄŤ na úvodnú obrazovku";} + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERZIA: $version       POSTAVENÉ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTOODHLÁSIŤ') or ($status=='SPUSTIŤ') or ($status=='ODHLÁSIŤ') ) + { + $VDdisplayMESSAGE = "Čas od Vášho posledného prihlásenia-in:$totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "Ty posledný prihlásený-out na:$last_action_date

Kliknite nižšie k LOGIN LOG-IN"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Množstvo času, ktoré ste vykáceli-in:$totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'ODHLÁSIŤ'; + $LOGtimeMESSAGE = "Ste prihlásený-in na adrese: $last_action_date
Množstvo času, ktoré ste vykáceli-in:$totTIME_HMS

Kliknite na Logout nižšie log-out"; + } + + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERZIA: $version       POSTAVENÉ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL:Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
Meno užívateľa:
Heslo užívateľa:
 

VERZIA: $version       POSTAVENÉ: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/LANG_www/agc_sk/vdc_db_query.php b/LANG_www/agc_sk/vdc_db_query.php index 60e43005..f04f0a7e 100644 --- a/LANG_www/agc_sk/vdc_db_query.php +++ b/LANG_www/agc_sk/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -77,7 +77,12 @@ # - $agentchannel = ('Zap/1-1','SIP/testing-6ry4i3',...) # - $conf_dialed = ('0','1') # - $leaving_threeway = ('0','1') - +# - $blind_transfer = ('0','1') +# - $usegroupalias - ('0','1') +# - $account - ('DEFAULT',...) +# - $agent_dialed_number - ('1','') +# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) +# # CHANGELOG: # 50629-1044 - First build of script # 50630-1422 - Added manual dial action and MD channel lookup @@ -167,10 +172,31 @@ # 81010-1048 - Added support for hangup of all channels except for agent channel after attempting a 3way call # 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call # 81020-1459 - Fixed bugs in queue_log logging +# 81104-0134 - Added mysql error logging capability +# 81104-1617 - Added multi-retry for some vicidial_live_agents table MySQL queries +# 81106-0410 - Added force_timeclock_login option to LoginCampaigns function +# 81107-0424 - Added carryover of script and presets for in-group calls from campaign settings +# 81110-0058 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1512 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81111-1630 - Added another hangup fix for non-hangup +# 81114-0126 - More vicidial_agent_log bug fixes +# 81119-1809 - webform backslash fix +# 81124-2212 - Fixes blind transfer bug +# 81126-1522 - Fixed callback comments bug +# 81211-0420 - Fixed Manual dial agent_log bug +# 90120-1718 - Added external pause and dial option +# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option +# 90128-0231 - Added vendor_lead_code to manual dial lead lookup +# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups +# 90305-1041 - Added agent_dialed_number and type for user_call_log feature +# 90307-1735 - Added Shift enforcement and manager override features # -$version = '2.0.5-85'; -$build = '81020-1459'; +$version = '2.0.5-103'; +$build = '90307-1735'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=193; +$one_mysql_log=0; require("dbconnect.php"); @@ -321,22 +347,45 @@ if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} +if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} + elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} +if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} + elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} +if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} + elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} +if (isset($_GET["account"])) {$account=$_GET["account"];} + elseif (isset($_POST["account"])) {$account=$_POST["account"];} +if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} + elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} +if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} + elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} 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 +$txt = '.txt'; +$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]=''; +$agents='@agents'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$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) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; $i++; } ##### END SETTINGS LOOKUP ##### @@ -355,16 +404,7 @@ $phone_number = ereg_replace("[^0-9]","",$phone_number); if (!isset($format)) {$format="text";} if ($format == 'debug') {$DB=1;} if (!isset($ACTION)) {$ACTION="refresh";} - -$txt = '.txt'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -$ENTRYdate = date("YmdHis"); if (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; -$agents='@agents'; if ($ACTION == 'LogiNCamPaigns') { @@ -376,6 +416,7 @@ else if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -396,6 +437,7 @@ else $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00003',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $SNauth=$row[0]; if($SNauth==0) @@ -429,52 +471,183 @@ echo " ### specific agent on the login screen ################################################################################ if ($ACTION == 'LogiNCamPaigns') -{ + { if ( (strlen($user)<1) ) - { - echo "\n"; - exit; - } + { + echo "\n"; + exit; + } else - { - echo "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Prihlásiť:
\n"; + $VDdisplayMESSAGE.= "Manager Heslo:
\n"; + $VDdisplayMESSAGE.= "



\n"; + echo "$VDdisplayMESSAGE"; + exit; + } + } + + if ($show_campaign_list > 0) + { + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00006',$user,$server_ip,$session_name,$one_mysql_log);} + $camps_to_print = mysql_num_rows($rslt); + + echo "\n"; + } + else + { + echo "\n"; } - echo "\n"; exit; } -} @@ -498,6 +671,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00007',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $closer_choice =$row[0]; @@ -505,25 +679,30 @@ if ($ACTION == 'regCLOSER') $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00008',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00009',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00010',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="INSERT INTO vicidial_user_closer_log set user='$user',campaign_id='$campaign',event_date='$NOW_TIME',blended='$closer_blended',closer_campaigns='$closer_choice';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00011',$user,$server_ip,$session_name,$one_mysql_log);} $stmt="DELETE FROM vicidial_live_inbound_agents where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00012',$user,$server_ip,$session_name,$one_mysql_log);} $in_groups_pre = preg_replace('/-$/','',$closer_choice); $in_groups = explode(" ",$in_groups_pre); @@ -535,6 +714,7 @@ if ($ACTION == 'regCLOSER') { $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $viga_ct = mysql_num_rows($rslt); if ($viga_ct > 0) @@ -551,6 +731,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);} } $k++; } @@ -583,6 +764,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -603,6 +785,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -612,6 +795,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00017',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -622,6 +806,7 @@ if ($ACTION == 'manDiaLnextCaLL') } $stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00018',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -635,6 +820,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00019',$user,$server_ip,$session_name,$one_mysql_log);} $lists_to_parse = mysql_num_rows($rslt); $camp_lists=''; $o=0; @@ -649,6 +835,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00020',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -660,10 +847,24 @@ if ($ACTION == 'manDiaLnextCaLL') } if ($stage=='lookup') { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); + if (strlen($vendor_lead_code)>0) + { + $stmt="SELECT lead_id FROM vicidial_list where vendor_lead_code='$vendor_lead_code' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + if ( ($man_leadID_ct > 0) and (strlen($phone_number) > 5) ) + {$override_phone++;} + } + else + { + $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00021',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $man_leadID_ct = mysql_num_rows($rslt); + } if ($man_leadID_ct > 0) { $row=mysql_fetch_row($rslt); @@ -674,9 +875,10 @@ if ($ACTION == 'manDiaLnextCaLL') else { ### 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='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00022',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -688,6 +890,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00023',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $lead_id = mysql_insert_id($link); $CBleadIDset=1; @@ -699,6 +902,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00024',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } } @@ -710,6 +914,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00025',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $hopper_leadID_ct = mysql_num_rows($rslt); if ($hopper_leadID_ct > 0) @@ -722,6 +927,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -736,7 +942,8 @@ if ($ACTION == 'manDiaLnextCaLL') $gmt_offset_now = trim("$row[8]"); $called_since_last_reset = trim("$row[9]"); $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); + if ($override_phone < 1) + {$phone_number = trim("$row[11]");} $title = trim("$row[12]"); $first_name = trim("$row[13]"); $middle_initial = trim("$row[14]"); @@ -763,6 +970,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00027',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -795,6 +1003,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00028',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -809,6 +1018,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00029',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $server_ct = mysql_num_rows($rslt); if ($server_ct > 0) @@ -831,6 +1041,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='$called_since_last_reset', called_count='$called_count',user='$user',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00030',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -838,11 +1049,13 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00031',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' 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,'00032',$user,$server_ip,$session_name,$one_mysql_log);} ### if preview dialing, do not send the call if ( (strlen($preview)<1) || ($preview == 'NO') ) @@ -874,30 +1087,53 @@ if ($ACTION == 'manDiaLnextCaLL') {$Ndialstring = "$Local_out_prefix$phone_number";} else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00035',$user,$server_ip,$session_name,$one_mysql_log);} ### update calls_today count in vicidial_campaign_agents $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $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);} + + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} + } ############################################# ##### SPUSTIŤ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -923,18 +1159,21 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); # ENTERQUEUE $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); # CONNECT $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -1013,12 +1252,41 @@ if ($ACTION == 'alt_phone_change') $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; if ($DB) {echo "$stmt\n";} $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 "ALTERN. TELEFÓN ČÍSLO STAV CHANGED\n"; } } +################################################################################ +### AlertControl - change the agent alert setting in vicidial_users +### +################################################################################ +if ($ACTION == 'AlertControl') +{ + if (strlen($stage)<1) + { + $channel_live=0; + echo "AGENT ALERT SETTING NOT CHANGED\n"; + echo "$stage Nie je správny\n"; + exit; + } + else + { + if (ereg('ON',$stage)) {$stage = '1';} + else {$stage = '0';} + + $stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'000185',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "AGENT ALERT SETTING CHANGED $stage\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -1042,6 +1310,7 @@ if ($ACTION == 'manDiaLskip') $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00042',$user,$server_ip,$session_name,$one_mysql_log);} echo "LEAD REVERTED\n"; @@ -1070,6 +1339,7 @@ if ($ACTION == 'manDiaLonly') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -1102,6 +1372,15 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + if ( ($usegroupalias > 0) and (strlen($account)>1) ) + { + $RAWaccount = $account; + $account = "Account: $account"; + $variable = "Variable: usegroupalias=1"; + } + else + {$account=''; $variable='';} + ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -1109,29 +1388,52 @@ if ($ACTION == 'manDiaLonly') {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00045',$user,$server_ip,$session_name,$one_mysql_log);} ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00046',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9046$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00047',$user,$server_ip,$session_name,$one_mysql_log);} echo "$MqueryCID\n"; + 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')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + } + + ############################################# ##### SPUSTIŤ 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 ($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; @@ -1157,18 +1459,21 @@ if ($ACTION == 'manDiaLonly') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00049',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); # ENTERQUEUE $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00050',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); # CONNECT $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00051',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -1195,8 +1500,9 @@ if (strlen($MDnextCID)<18) else { ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; + $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -1210,6 +1516,7 @@ else $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -1219,6 +1526,12 @@ else $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' 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);} + + $stmt="UPDATE vicidial_auto_calls set uniqueid='$uniqueid',channel='$channel' where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -1244,6 +1557,10 @@ if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + echo "LOG NEBOL ZADANÝ\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign Nie je správny\n"; exit; @@ -1253,6 +1570,7 @@ if ($stage == "start") $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,'00056',$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) @@ -1264,6 +1582,7 @@ if ($stage == "start") $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1279,6 +1598,7 @@ if ($stage == "start") $stmt = "UPDATE vicidial_auto_calls SET uniqueid='$uniqueid' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00058',$user,$server_ip,$session_name,$one_mysql_log);} # ##### insert log into call_log for manual VICIDiaL call # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; @@ -1303,6 +1623,7 @@ if ($stage == "end") $VLA_inOUT='NONE'; $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00059',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLA_inOUT_ct = mysql_num_rows($rslt); if ($VLA_inOUT_ct > 0) @@ -1344,6 +1665,7 @@ if ($stage == "end") $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00060',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -1369,6 +1691,7 @@ if ($stage == "end") ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch,term_reason,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -1396,6 +1719,7 @@ if ($stage == "end") $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { @@ -1413,6 +1737,7 @@ if ($stage == "end") ##### SPUSTIŤ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00063',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -1440,6 +1765,7 @@ if ($stage == "end") ### check to see if campaign has alt_dial enabled $stmt="SELECT auto_alt_dial FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00064',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1458,6 +1784,7 @@ if ($stage == "end") $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1475,6 +1802,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00066',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_dnc_ct = mysql_num_rows($rslt); if ($VLAP_dnc_ct > 0) @@ -1488,6 +1816,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00067',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_cdnc_ct = mysql_num_rows($rslt); if ($VLAP_cdnc_ct > 0) @@ -1502,6 +1831,7 @@ if ($stage == "end") $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} } else {$alt_dial_skip=1;} @@ -1517,6 +1847,7 @@ if ($stage == "end") $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_mancall_ct = mysql_num_rows($rslt); if ($VAC_mancall_ct > 0) @@ -1534,6 +1865,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_dnc_ct = mysql_num_rows($rslt); if ($VLAP_dnc_ct > 0) @@ -1547,6 +1879,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00071',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_cdnc_ct = mysql_num_rows($rslt); if ($VLAP_cdnc_ct > 0) @@ -1561,6 +1894,7 @@ if ($stage == "end") $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} } else {$addr3_dial_skip=1;} @@ -1586,6 +1920,7 @@ if ($stage == "end") $stmt="SELECT gmt_offset_now,state,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,'00073',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VL_deailts_ct = mysql_num_rows($rslt); if ($VL_deailts_ct > 0) @@ -1598,6 +1933,7 @@ if ($stage == "end") $alt_dial_phones_count=0; $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00074',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_ct = mysql_num_rows($rslt); if ($VLAP_ct > 0) @@ -1610,6 +1946,7 @@ if ($stage == "end") $Xlast++; $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00075',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_detail_ct = mysql_num_rows($rslt); if ($VLAP_detail_ct > 0) @@ -1628,6 +1965,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00076',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_dnc_ct = mysql_num_rows($rslt); if ($VLAP_dnc_ct > 0) @@ -1641,6 +1979,7 @@ if ($stage == "end") { $stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00077',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VLAP_cdnc_ct = mysql_num_rows($rslt); if ($VLAP_cdnc_ct > 0) @@ -1656,6 +1995,7 @@ if ($stage == "end") $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} $Xlast=9999999999; } } @@ -1668,6 +2008,7 @@ if ($stage == "end") ### grab call lead information needed for QM logging $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00079',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1690,6 +2031,7 @@ if ($stage == "end") $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETECALLER' and queue='$VDcampaign_id';"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00080',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_cc_ct = mysql_num_rows($rslt); if ($VAC_cc_ct > 0) @@ -1713,10 +2055,22 @@ if ($stage == "end") $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00081',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00082',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9082$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { @@ -1725,6 +2079,7 @@ if ($stage == "end") $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00083',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); } } @@ -1736,6 +2091,7 @@ if ($stage == "end") ### check to see if lead should be alt_dialed $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id' order by call_time desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00084',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) @@ -1753,23 +2109,36 @@ if ($stage == "end") $CLuniqueid = $row[9]; } - $CLstage = preg_replace("/XFER|-/",'',$CLstage); + $CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage); if ($CLstage < 0.25) {$CLstage=0;} $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00085',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); } - # $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; + # $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$VDcampaign_id' and callerid LIKE \"M%\";"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00086',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00087',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9087$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } + $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { @@ -1778,6 +2147,7 @@ if ($stage == "end") $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00088',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); } } @@ -1792,6 +2162,7 @@ if ($stage == "end") ### check to see if lead should be alt_dialed $stmt="SELECT term_reason,uniqueid from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00089',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) { @@ -1810,10 +2181,41 @@ if ($stage == "end") } } + ### check to see if the vicidial_log record exists, if not, insert it + $stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_vld_ct = mysql_num_rows($rslt); + if ($VAC_vld_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLD_count = $row[0]; + if ($VLD_count < 1) + { + ##### insert log into vicidial_log for manual VICIDiaL call + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + + if ($affected_rows > 0) + { + echo "VICIDiaL_LOG Vložiť: $uniqueid|$channel|$NOW_TIME\n"; + echo "$StarTtime\n"; + } + else + { + echo "LOG NEBOL ZADANÝ\n"; + } + } + } + ##### update the duration and end time in the vicidial_log table $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) @@ -1828,12 +2230,14 @@ if ($stage == "end") else { $SQLterm = "term_reason='$term_reason'"; + $QL_term=''; if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) { ### check to see if lead should be alt_dialed $stmt="SELECT term_reason,closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00091',$user,$server_ip,$session_name,$one_mysql_log);} $VAC_qm_ct = mysql_num_rows($rslt); if ($VAC_qm_ct > 0) { @@ -1849,14 +2253,44 @@ if ($stage == "end") else { $SQLterm = "term_reason='AGENT'"; + $QL_term = 'COMPLETEAGENT'; } } - ##### update the duration and end time in the vicidial_log table - $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); + if (strlen($SQLterm) > 0) + { + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + + if ($enable_queuemetrics_logging > 0) + { + if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) ) + { + $stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';"; + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00093',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VAC_cc_ct = mysql_num_rows($rslt); + if ($VAC_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $agent_complete = $row[0]; + } + if ($agent_complete < 1) + { + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00094',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + } + } + } } } @@ -1875,6 +2309,7 @@ if ($stage == "end") $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00095',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$rec_list = mysql_num_rows($rslt);} while ($rec_list>$loop_count) { @@ -1887,7 +2322,7 @@ if ($stage == "end") else { # if (preg_match("/$agentchannel/i",$row[0])) - if ($agentchannel == "$row[0]") + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) { $donothing=1; } @@ -1901,8 +2336,40 @@ if ($stage == "end") $loop_count++; } + $loop_count=0; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} + if ($rslt) {$rec_list = mysql_num_rows($rslt);} + while ($rec_list>$loop_count) + { + $row=mysql_fetch_row($rslt); + if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) + { + $rec_channels[$total_rec] = "$row[0]"; + $total_rec++; + } + else + { + # if (preg_match("/$agentchannel/i",$row[0])) + if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) ) + { + $donothing=1; + } + else + { + $hangup_channels[$total_hangup] = "$row[0]"; + $total_hangup++; + } + } + if ($format=='debug') {echo "\n";} + $loop_count++; + } + + ### if a conference call or 3way call was attempted, then hangup all channels except for the agentchannel - if ( ($conf_dialed > 0) and ($leaving_threeway < 1) ) + if ( ( ($conf_dialed > 0) or ($hangup_all_non_reserved > 0) ) and ($leaving_threeway < 1) and ($blind_transfer < 1) ) { $loop_count=0; while($loop_count < $total_hangup) @@ -1912,6 +2379,7 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} } $loop_count++; } @@ -1923,6 +2391,7 @@ if ($stage == "end") $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00097',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$recFN_list = mysql_num_rows($rslt);} while ($recFN_list>$loop_count) { @@ -1941,6 +2410,7 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00098',$user,$server_ip,$session_name,$one_mysql_log);} echo "REC_ZASTAVIŤ|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename)>2) @@ -1948,6 +2418,7 @@ if ($stage == "end") $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($fn_count) { @@ -1980,6 +2451,7 @@ if ($stage == "end") $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; @@ -1998,19 +2470,27 @@ if ($stage == "end") $talk_sec=0; + $talk_epochSQL=''; $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select talk_epoch,talk_sec,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $talk_epochSQL=",talk_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $talk_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_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,'00102',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -2039,6 +2519,7 @@ if ($ACTION == 'VDADREcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00103',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -2088,6 +2569,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00104',$user,$server_ip,$session_name,$one_mysql_log);} $queue_leadID_ct = mysql_num_rows($rslt); if ($queue_leadID_ct > 0) @@ -2106,6 +2588,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00105',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vla_cc_ct = mysql_num_rows($rslt); if ($vla_cc_ct > 0) @@ -2118,17 +2601,29 @@ if ($ACTION == 'VDADcheckINCOMING') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00106',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9106$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $list_lead_ct = mysql_num_rows($rslt); if ($list_lead_ct > 0) @@ -2173,6 +2668,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT entry_time,callback_time,user,comments FROM vicidial_callbacks where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00109',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -2189,23 +2685,26 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} ### update the log status to INCALL $user_group=''; - $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $ug_record_ct = mysql_num_rows($rslt); - if ($ug_record_ct > 0) - { - $row=mysql_fetch_row($rslt); - $user_group = trim("$row[0]"); - } + $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,'00111',$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); + $user_group = trim("$row[0]"); + } $stmt = "select campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00112',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -2217,10 +2716,31 @@ if ($ACTION == 'VDADcheckINCOMING') } else { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + if (preg_match('/^M|^V/',$callerid)) + { + $call_type = 'OUT'; + $VDADchannel_group = $campaign; + } + else + { + $call_type = 'IN'; + $stmt = "select campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDADchannel_group =$row[0]; + } + } if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|\n"); fclose($fp); } } @@ -2230,10 +2750,12 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00113',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group from vicidial_campaigns where campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -2244,12 +2766,15 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; + if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number||||\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||\n|\n"; $stmt = "select phone_number,alt_dial from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00115',$user,$server_ip,$session_name,$one_mysql_log);} $VDAC_cid_ct = mysql_num_rows($rslt); if ($VDAC_cid_ct > 0) { @@ -2257,6 +2782,11 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + else + { + $dialed_number = $phone_number; + $dialed_label = 'MAIN'; + } if (ereg('X',$dialed_label)) { if (ereg('LAST',$dialed_label)) @@ -2271,6 +2801,7 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00116',$user,$server_ip,$session_name,$one_mysql_log);} $VLAP_ct = mysql_num_rows($rslt); if ($VLAP_ct > 0) { @@ -2289,10 +2820,12 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);} $VDL_cid_ct = mysql_num_rows($rslt); if ($VDL_cid_ct > 0) { @@ -2300,16 +2833,17 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_front_VDlog =$row[0]; } - $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { $row=mysql_fetch_row($rslt); $VDCL_group_name = $row[0]; $VDCL_group_color = $row[1]; - $VDCL_group_web = $row[2]; + $VDCL_group_web = stripslashes($row[2]); $VDCL_fronter_display = $row[3]; $VDCL_ingroup_script = $row[4]; $VDCL_get_call_launch = $row[5]; @@ -2320,19 +2854,70 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_default_xfer_group = $row[10]; $VDCL_ingroup_recording_override = $row[11]; $VDCL_ingroup_rec_filename = $row[12]; + $VDCL_default_group_alias = $row[13]; + + + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidOR_ct = mysql_num_rows($rslt); + if ($VDIG_cidOR_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) + {$VDCL_ingroup_script = $row[0];} + if (strlen($VDCL_xferconf_a_dtmf) < 1) + {$VDCL_xferconf_a_dtmf = $row[1];} + if (strlen($VDCL_xferconf_a_number) < 1) + {$VDCL_xferconf_a_number = $row[2];} + if (strlen($VDCL_xferconf_b_dtmf) < 1) + {$VDCL_xferconf_b_dtmf = $row[3];} + if (strlen($VDCL_xferconf_b_number) < 1) + {$VDCL_xferconf_b_number = $row[4];} + if (strlen($VDCL_default_group_alias) < 1) + {$VDCL_default_group_alias = $row[5];} + } + + $stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidgwv_ct = mysql_num_rows($rslt); + if ($VDIG_cidgwv_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + + if (strlen($VDCL_group_web_vars) < 1) + { + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00120',$user,$server_ip,$session_name,$one_mysql_log);} $Ctype = 'I'; } else { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cid_ct = mysql_num_rows($rslt); if ($VDIG_cid_ct > 0) { @@ -2343,16 +2928,44 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[3]; $VDCL_xferconf_b_dtmf = $row[4]; $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_group_alias = $row[6]; + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_group_web_vars = $row[0]; + } + } + + $VDCL_caller_id_number=''; + if (strlen($VDCL_default_group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDCL_caller_id_number = $row[0]; } } ### if web form is set then send na to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00122',$user,$server_ip,$session_name,$one_mysql_log);} $VDU_cid_ct = mysql_num_rows($rslt); if ($VDU_cid_ct > 0) { @@ -2416,6 +3029,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { @@ -2425,6 +3039,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' 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,'00124',$user,$server_ip,$session_name,$one_mysql_log);} ### If HOVORBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) @@ -2432,11 +3047,13 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00125',$user,$server_ip,$session_name,$one_mysql_log);} } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00126',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $enable_agc_xfer_log_ct = mysql_num_rows($rslt); if ($enable_agc_xfer_log_ct > 0) @@ -2484,6 +3101,7 @@ else $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,'00127',$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) @@ -2495,6 +3113,7 @@ else $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','ODHLÁSIŤ','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00128',$user,$server_ip,$session_name,$one_mysql_log);} $vul_insert = mysql_affected_rows($link); if ($no_delete_sessions < 1) @@ -2503,6 +3122,7 @@ else $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00129',$user,$server_ip,$session_name,$one_mysql_log);} $vc_remove = mysql_affected_rows($link); } @@ -2510,24 +3130,37 @@ else $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00130',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9130$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $vla_delete = mysql_affected_rows($link); ##### Delete the vicidial_live_inbound_agents records for this session $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysql_affected_rows($link); ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00132',$user,$server_ip,$session_name,$one_mysql_log);} $wcs_delete = mysql_affected_rows($link); ##### Hangup the client phone $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) { $row=mysql_fetch_row($rslt); @@ -2536,6 +3169,7 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00134',$user,$server_ip,$session_name,$one_mysql_log);} } if ($LogouTKicKAlL > 0) @@ -2548,12 +3182,14 @@ else $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00135',$user,$server_ip,$session_name,$one_mysql_log);} } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$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)) ) { @@ -2563,6 +3199,7 @@ else $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,'00137',$user,$server_ip,$session_name,$one_mysql_log);} } if ($vla_delete > 0) @@ -2571,6 +3208,7 @@ else ##### SPUSTIŤ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00138',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2607,6 +3245,7 @@ else $stmt = "SELECT time_id FROM queue_log where agent='Agent/$user' and verb='AGENTLOGIN' order by time_id desc limit 1;"; $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); @@ -2621,9 +3260,10 @@ else $time_logged_in = ($StarTtime - $logintime); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='AGENTLOGOFF',data1='$user$agents',data2='$time_logged_in',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00140',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2651,29 +3291,43 @@ if ($ACTION == 'updateDISPO') else { ### update the comments in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set lead_id='',external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9141$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $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);} } else { $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} } if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2681,9 +3335,11 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') ) @@ -2691,31 +3347,42 @@ if ($ACTION == 'updateDISPO') $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} } } $dispo_sec=0; + $dispo_epochSQL=''; $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); + if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) ) + { + $dispo_epochSQL=",dispo_epoch='$StarTtime'"; + $row[0]=$row[2]; + } $dispo_sec = (($StarTtime - $row[0]) + $row[1]); } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',status='$dispo_choice' $dispo_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,'00151',$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,'00152',$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) @@ -2724,22 +3391,32 @@ if ($ACTION == 'updateDISPO') $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id($link); + if ($auto_dial_level < 1) + { + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } ### HOVORBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { + $comments = eregi_replace('"','',$comments); + $comments = eregi_replace("'",'',$comments); + $comments = eregi_replace(';','',$comments); + $comments = eregi_replace("\\\\",' ',$comments); $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00154',$user,$server_ip,$session_name,$one_mysql_log);} } $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00155',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$row[0])) ) @@ -2747,6 +3424,7 @@ if ($ACTION == 'updateDISPO') $stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -2754,6 +3432,7 @@ if ($ACTION == 'updateDISPO') $stmt="UPDATE vicidial_hopper set status='READY' where lead_id='$lead_id' and status='HOLD' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00157',$user,$server_ip,$session_name,$one_mysql_log);} } } else @@ -2761,12 +3440,14 @@ if ($ACTION == 'updateDISPO') $stmt="DELETE from vicidial_hopper where lead_id='$lead_id' and status='HOLD';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00158',$user,$server_ip,$session_name,$one_mysql_log);} } ############################################# ##### SPUSTIŤ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2794,6 +3475,7 @@ if ($ACTION == 'updateDISPO') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$stage',agent='Agent/$user',verb='CALLSTATUS',data1='$dispo_choice',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00160',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); @@ -2822,6 +3504,7 @@ if ($ACTION == 'updateLEAD') $stmt = "SELECT disable_alter_custdata,disable_alter_custphone FROM vicidial_campaigns where campaign_id='$campaign'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00161',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dac_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2845,6 +3528,7 @@ if ($ACTION == 'updateLEAD') } $stmt = "SELECT alter_custdata_override,alter_custphone_override FROM vicidial_users where user='$user'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00162',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $aco_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2881,12 +3565,23 @@ if ($ACTION == 'updateLEAD') $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', 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) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' $phoneSQL where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00163',$user,$server_ip,$session_name,$one_mysql_log);} } $random = (rand(1000000, 9999999) + 10000000); $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00164',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9164$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } } echo "Lead $lead_id information has$DO_NOT_UPDATE_text been updated\n"; @@ -2912,10 +3607,30 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00165',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9165$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} + $retry_count=0; + while ( ($errno > 0) and ($retry_count < 9) ) + { + $rslt=mysql_query($stmt, $link); + $one_mysql_log=1; + $errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9166$retry_count",$user,$server_ip,$session_name,$one_mysql_log); + $one_mysql_log=0; + $retry_count++; + } $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { @@ -2923,6 +3638,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ##### SPUSTIŤ 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00167',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -2946,53 +3662,95 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); + $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,'00182',$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); + $user_group = trim("$row[0]"); + } + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='$QMstatus',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00168',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } - if ($agent_log == 'NO') - {$donothing=1;} - else + $pause_sec=0; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) + $row=mysql_fetch_row($rslt); + $dispo_epoch = $row[4]; + $wait_sec=0; + if ($row[2] > 0) { - $row=mysql_fetch_row($rslt); - $wait_sec=0; - if ($row[2] > 0) - { - $wait_sec = (($StarTtime - $row[2]) + $row[3]); - } - if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) - {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} - else - {$pause_sec = (($row[4] - $row[0]) + $row[1]);} - + $wait_sec = (($StarTtime - $row[2]) + $row[3]); } - if ($ACTION == 'VDADready') + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + + } + if ($ACTION == 'VDADready') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) { $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 ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_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,'00170',$user,$server_ip,$session_name,$one_mysql_log);} } } + if ($ACTION == 'VDADpause') + { + if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) ) + { + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_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,'00171',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $agent_log = 'NEW_ID'; + } + + if ($agent_log == 'NEW_ID') + { + $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,'00182',$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); + $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) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00153',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + } } - echo 'Agent ' . $user . ' je teraz v stave ' . $stage . "\n"; + echo 'Agent ' . $user . ' je teraz v stave ' . $stage . "\nNext agent_log_id:\n$agent_log_id\n"; } @@ -3013,6 +3771,7 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -3020,12 +3779,14 @@ if ($ACTION == 'UpdatEFavoritEs') $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00173',$user,$server_ip,$session_name,$one_mysql_log);} } else { $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00174',$user,$server_ip,$session_name,$one_mysql_log);} } } echo "Favorites list has been updated to $favorites_list for $exten\n"; @@ -3035,7 +3796,7 @@ if ($ACTION == 'UpdatEFavoritEs') ################################################################################ ### PauseCodeSubmit - Update vicidial_agent_log with pause code ################################################################################ -if ($ACTION == 'PauzaCodeSubmit') +if ($ACTION == 'PauseCodeSubmit') { $row=''; $rowx=''; if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) @@ -3048,6 +3809,7 @@ if ($ACTION == 'PauzaCodeSubmit') $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" 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,'00175',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); if ($affected_rows > 0) { @@ -3055,6 +3817,7 @@ if ($ACTION == 'PauzaCodeSubmit') ##### SPUSTIŤ QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,allow_sipsak_messages FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00176',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -3085,13 +3848,14 @@ if ($ACTION == 'PauzaCodeSubmit') $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); mysql_close($linkB); } } } -echo "Pauza Code has been updated to $status for $agent_log_id\n"; +echo " Pauza Code has been updated to $status for $agent_log_id\n"; } @@ -3103,6 +3867,7 @@ if ($ACTION == 'CalLBacKLisT') $stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} echo "$callbacks_count\n"; $loop_count=0; @@ -3124,6 +3889,7 @@ $loop_count=0; $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; @@ -3141,6 +3907,7 @@ if ($ACTION == 'CalLBacKCounT') $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $cbcount=$row[0]; @@ -3160,4 +3927,29 @@ echo "\n\n\n"; exit; + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} + ?> diff --git a/LANG_www/agc_sk/vicidial.php b/LANG_www/agc_sk/vicidial.php index 7ead521b..9a1a53b8 100644 --- a/LANG_www/agc_sk/vicidial.php +++ b/LANG_www/agc_sk/vicidial.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database @@ -199,10 +199,36 @@ # 81015-0405 - Fixed bug related to hangups on 3way calls # 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available # 81020-1501 - Fixed bugs in queue_log logging +# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE +# 81103-1427 - Added 3way call dial prefix +# 81104-0140 - Added mysql error logging capability +# 81104-1618 - Changed MySQL queries logging +# 81106-0411 - Changedthe campaign login list behaviour +# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause +# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug +# 81119-1811 - webform backslash fix +# 81124-2213 - Fixes blind transfer bug +# 81209-1617 - Added campaign web form target option and web form address variables +# 81211-0422 - Fixed Manual dial agent_log bug +# 90102-1402 - Added time sync check notification +# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only +# 90120-1719 - Added API pause/resume and number dial functionality +# 90126-2302 - Added Vtiger login option and agent alert option +# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup +# 90202-0148 - Added option to disable BLENDED checkbox +# 90209-0132 - Changed tab images and color scheme +# 90303-1145 - Fixed rare manual dial live hangup bug +# 90304-1333 - Added user-specific web vars option +# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API +# 90307-1736 - Added Shift enforcement and manager override features # -$version = '2.0.5-178'; -$build = '81020-1501'; +$version = '2.0.5-201'; +$build = '90307-1736'; +$mel=1; # Mysql Error Log enabled = 1 +$mysql_log_count=60; +$one_mysql_log=0; require("dbconnect.php"); @@ -220,6 +246,8 @@ if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} +if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} @@ -247,7 +275,7 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign); $forever_stop=0; @@ -263,6 +291,7 @@ $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); +$loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -274,8 +303,9 @@ $random = (rand(1000000, 9999999) + 10000000); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable FROM system_settings;"; +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); $i=0; @@ -287,6 +317,10 @@ while ($i < $qm_conf_ct) $vdc_customer_date_format = $row[2]; $vdc_header_phone_format = $row[3]; $WeBRooTWritablE = $row[4]; + $timeclock_end_of_day = $row[5]; + $vtiger_url = $row[6]; + $enable_vtiger_integration = $row[7]; + $outbound_autodial_active = $row[8]; $i++; } @@ -317,15 +351,19 @@ $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of chann $PreseT_DiaL_LinKs = '0'; # set to 1 to show a VOLAŤ link for Dial Presets $LogiNAJAX = '1'; # set to 1 to do lookups na campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Zložiť zákazníka $LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout $TelefónSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login $DefaulTAlTDiaL = '0'; # set to 1 to enable ALT VOLAŤ by default if enabled for the campaign +$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option +$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 - +$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 +$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers @@ -395,11 +433,13 @@ if ($relogin == 'YES') $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $VU_user_group=$row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) { @@ -409,9 +449,45 @@ if ($relogin == 'YES') } } +### code for manager override of shift restrictions +if ($MGR_override > 0) + { + if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} + elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} + if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} + elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} + + $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $MGR_auth=$row[0]; + + if($MGR_auth>0) + { + $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} + print "\n"; + + ### Add a record to the vicidial_admin_log + $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='MANAGER prepísať 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);} + } + } + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -427,10 +503,16 @@ while ($camps_to_print > $o) if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } } else - {$camp_form_code .= "\n";} + { + if (!ereg('login_allowable_campaigns',$camp_form_code)) + {$camp_form_code .= "\n";} + } $o++; } $camp_form_code .= "\n"; @@ -503,13 +585,13 @@ if ($relogin == 'YES') echo "web klient VICIDIAL: Znova prihlásiť\n"; echo "\n"; echo "\n"; -echo " Timeclock
\n"; +echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Slovensky
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -523,8 +605,9 @@ echo ""; echo "\n"; echo ""; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Znova prihlásiť
Heslo užívateľa:
Kampaň: $camp_form_code
$camp_form_code
  \n"; +echo "

VERZIA: $version       POSTAVENÉ: $build
\n"; echo "\n\n"; @@ -540,7 +623,7 @@ if ($user_login_first == 1) echo "web klient VICIDIAL: Prihlásenie kampane\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -549,7 +632,7 @@ echo "
\n"; #echo "\n"; echo "

Meno užívateľa

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -573,9 +656,10 @@ echo "
Prihlásenie kampane
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; @@ -583,13 +667,13 @@ echo "web klient VICIDIAL: Prihlásiť\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; echo "
\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -622,13 +706,13 @@ if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) echo "web klient VICIDIAL: Prihlásenie telefónu\n"; echo "\n"; echo "\n"; -echo " Timeclock
\n"; +echo "Timeclock
\n"; echo "
Prihlásiť
\n"; echo "\n"; echo "\n";echo "\n";echo "
English Slovensky
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -658,9 +742,10 @@ $VDloginDISPLAY=0; } else { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; + $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $auth=$row[0]; @@ -669,22 +754,161 @@ $VDloginDISPLAY=0; $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - $VU_user_group=$row[10]; - $VU_vicidial_recording_override=$row[11]; - $VU_alter_custphone_override=$row[12]; + $LOGfullname = $row[0]; + $user_level = $row[1]; + $VU_hotkeys_active = $row[2]; + $VU_agent_choose_ingroups = $row[3]; + $VU_scheduled_callbacks = $row[4]; + $agentonly_callbacks = $row[5]; + $agentcall_manual = $row[6]; + $VU_vicidial_recording = $row[7]; + $VU_vicidial_transfers = $row[8]; + $VU_closer_default_blended = $row[9]; + $VU_user_group = $row[10]; + $VU_vicidial_recording_override = $row[11]; + $VU_alter_custphone_override = $row[12]; + $VU_alert_enabled = $row[13]; + $VU_agent_shift_enforcement_override = $row[14]; + $VU_shift_override_flag = $row[15]; + + if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';} + else {$VU_alert_enabled = 'OFF';} + + ### Gather timeclock and shift enforcement restriction settings + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $forced_timeclock_login = $row[0]; + $shift_enforcement = $row[1]; + $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]); + $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL); + $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; + + ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) + { + $last_agent_event=''; + $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); + + ##### grab timeclock logged-in time for each user ##### + $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $events_to_parse = mysql_num_rows($rslt); + if ($events_to_parse > 0) + { + $rowx=mysql_fetch_row($rslt); + $last_agent_event = $rowx[0]; + } + if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} + if ( (strlen($last_agent_event)<2) or (ereg('ODHLÁSIŤ',$last_agent_event)) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "Musíte sa prihlásiť do TIMECLOCK PRVEJ
"; + } + } + ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR + + ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + if ( ( (ereg("SPUSTIŤ|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("SPUSTIŤ|ALL",$VU_agent_shift_enforcement_override)) ) + { + $shift_ok=0; + if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: Nie sú k dispozícii žiadne Posuvy povolený pre užívateľské skupiny
"; + } + else + { + $HHMM = date("Hi"); + $wday = date("w"); + + $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);} + $shifts_to_print = mysql_num_rows($rslt); + + $o=0; + while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) + { + $rowx=mysql_fetch_row($rslt); + $shift_id = $rowx[0]; + $shift_start_time = $rowx[1]; + $shift_length = $rowx[2]; + $shift_weekdays = $rowx[3]; + + if (eregi("$wday",$shift_weekdays)) + { + $HHshift_length = substr($shift_length,0,2); + $MMshift_length = substr($shift_length,3,2); + $HHshift_start_time = substr($shift_start_time,0,2); + $MMshift_start_time = substr($shift_start_time,2,2); + $HHshift_end_time = ($HHshift_length + $HHshift_start_time); + $MMshift_end_time = ($MMshift_length + $MMshift_start_time); + if ($MMshift_end_time > 59) + { + $MMshift_end_time = ($MMshift_end_time - 60); + $HHshift_end_time++; + } + if ($HHshift_end_time > 23) + {$HHshift_end_time = ($HHshift_end_time - 24);} + $HHshift_end_time = sprintf("%02s", $HHshift_end_time); + $MMshift_end_time = sprintf("%02s", $MMshift_end_time); + $shift_end_time = "$HHshift_end_time$MMshift_end_time"; + + if ( + ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or + ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or + ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) + ) + {$shift_ok++;} + } + $o++; + } + + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) + { + $VDloginDISPLAY=1; + $VDdisplayMESSAGE = "ERROR: Nemáte možnosť prihlásiť sa mimo vašej smeny
"; + } + } + if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) + { + $VDdisplayMESSAGE.= "

MANAGER prepísať:
\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "\n"; + $VDdisplayMESSAGE.= "Manager Prihlásiť:
\n"; + $VDdisplayMESSAGE.= "Manager Heslo:
\n"; + $VDdisplayMESSAGE.= "\n"; + } + } + ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR + + + + + + if ($WeBRooTWritablE > 0) { @@ -697,6 +921,7 @@ $VDloginDISPLAY=0; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; @@ -705,7 +930,7 @@ $VDloginDISPLAY=0; echo "web klient VICIDIAL: VICIDIAL Prihlásenie kampane\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "
Prihlásenie telefónu
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -729,6 +954,7 @@ echo "
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) @@ -740,6 +966,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysql_num_rows($rslt); $i=0; @@ -754,8 +981,9 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysql_num_rows($rslt); $j=0; @@ -776,6 +1004,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysql_num_rows($rslt); $w=0; @@ -804,13 +1033,14 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; - $web_form_address = $row[2]; + $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; @@ -848,6 +1078,37 @@ echo "1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $default_group_alias_cid = $row[0]; + } + } + + $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VDIG_cidogwv = mysql_num_rows($rslt); + if ($VDIG_cidogwv > 0) + { + $row=mysql_fetch_row($rslt); + $default_web_vars = $row[0]; + } if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -860,6 +1121,8 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysql_num_rows($rslt); $j=0; @@ -906,6 +1170,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysql_num_rows($rslt); $INgrpCT=0; @@ -929,6 +1194,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysql_num_rows($rslt); $XFgrpCT=0; @@ -944,9 +1210,37 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_group_aliases = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_group_aliases) + { + $row=mysql_fetch_row($rslt); + $group_alias_id[$i] = $row[0]; + $group_alias_name[$i] = $row[1]; + $caller_id_number[$i] = $row[2]; + $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; + $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; + $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; + $i++; + $j++; + } + $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); + $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); + $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); + $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; @@ -975,7 +1269,7 @@ echo "web klient VICIDIAL: Prihlásenie kampane\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -984,7 +1278,7 @@ echo "
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -1012,6 +1306,7 @@ echo "
Prihlásenie kampane
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} $alias_ct = mysql_num_rows($rslt); if ($alias_ct > 0) { @@ -1022,6 +1317,7 @@ if ($alias_found > 0) { $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} $alias_ct = mysql_num_rows($rslt); if ($alias_ct > 0) { @@ -1053,6 +1349,7 @@ $authphone=0; $stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) @@ -1060,7 +1357,7 @@ if (!$authphone) echo "web klient VICIDIAL: Prihlásenie telefónu Error\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -1069,7 +1366,7 @@ echo "
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -1104,27 +1401,28 @@ else if ($DB) {echo "|$stmtx|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmtx, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); ### get number of agents logged in to each server $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); ### find out whether the server is set to active $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowy=mysql_fetch_row($rslt); ### find out whether the server_updater is running $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowz=mysql_fetch_row($rslt); $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| "; @@ -1146,6 +1444,7 @@ else $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; @@ -1216,16 +1515,16 @@ else { $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} } } if ($TelefónSComPIP == '2') { $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} } if ($clientDST) { @@ -1237,10 +1536,16 @@ else $extension = "$dialplan_number$AT$ext_context"; } $SIP_user = "$protocol/$extension"; + $SIP_user_DiaL = "$protocol/$extension"; + if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) + { + $SIP_user = "$protocol/$extension$VD_login"; + } $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $asterisk_version=$row[0]; @@ -1294,10 +1599,12 @@ else $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { @@ -1305,10 +1612,12 @@ else $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysql_num_rows($rslt); $i=0; @@ -1326,16 +1635,19 @@ else $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0] > 0) { $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); $session_id = $row[0]; } @@ -1346,24 +1658,28 @@ else $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1377,10 +1693,10 @@ else ##### SPUSTIŤ SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$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]; @@ -1391,7 +1707,6 @@ else $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -1405,11 +1720,12 @@ else } ### insert a NOVÁ record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($auto_dial_level > 0) { @@ -1418,6 +1734,7 @@ else ##### grab the campaign_weight and number of calls today na that campaign for the agent $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysql_num_rows($rslt); if ($vca_ct > 0) @@ -1434,6 +1751,7 @@ else $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; } @@ -1441,6 +1759,7 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1449,15 +1768,17 @@ else $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1478,6 +1799,7 @@ else $stmt="INSERT INTO vicidial_live_agents (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,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); print "\n"; @@ -1489,12 +1811,14 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); print "\n"; @@ -1508,7 +1832,7 @@ else echo "web klient VICIDIAL: VICIDIAL Prihlásenie kampane\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "
Prihlásiť Error
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -1532,7 +1856,7 @@ echo "
web klient VICIDIAL: VICIDIAL Prihlásenie kampane\n"; echo "\n"; echo "\n"; - echo " Timeclock
\n"; + echo "Timeclock
\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Slovensky
\n"; @@ -1569,10 +1893,17 @@ echo "
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $agent_log_id = mysql_insert_id($link); print "\n"; + $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUaffected_rows = mysql_affected_rows($link); + $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1588,6 +1919,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysql_num_rows($rslt); $e=0; @@ -1764,6 +2096,15 @@ $CCAL_OUT .= "
"; var CallBackCommenTs = ''; var scheduled_callbacks = ''; var dispo_check_all_pause = ''; + var api_check_all_pause = ''; + VARgroup_alias_ids = new Array(); + VARgroup_alias_names = new Array(); + VARcaller_id_numbers = new Array(); + var VD_group_aliases_ct = ''; + var agent_allow_group_alias = ''; + var default_group_alias = ''; + var default_group_alias_cid = ''; + var active_group_alias = ''; var agent_pause_codes_active = ''; VARpause_codes = new Array(); VARpause_code_names = new Array(); @@ -1873,12 +2214,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VDIC_web_form_address = ''; var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; - var panel_bgcolor = '#E0C2D6'; + var panel_bgcolor = ''; var CusTCB_bgcolor = '#FFFF66'; var auto_dial_level = ''; var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; + var three_way_dial_prefix = ''; var campaign_cid = ''; var campaign_vdad_exten = ''; var campaign_leads_to_call = ''; @@ -1889,6 +2231,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var campaign_rec_filename = ''; var LIVE_campaign_recording = ''; var LIVE_campaign_rec_filename = ''; + var LIVE_default_group_alias = ''; + var LIVE_caller_id_number = ''; + var LIVE_web_vars = ''; + var default_web_vars = ''; var campaign_script = ''; var get_call_launch = ''; var campaign_am_message_exten = ''; @@ -1979,6 +2325,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var three_way_call_cid = ''; var outbound_cid = ''; var threeway_cid = ''; + var cid_choice = ''; + var prefix_choice = ''; + var agent_dialed_number=''; + var agent_dialed_type=''; var allcalls_delay = ''; var omit_phone_code = ''; var no_delete_sessions = ''; @@ -1990,7 +2340,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; - var PauzaCode_HTML = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; @@ -2022,11 +2372,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var agentphonelive = 0; var conf_dialed = 0; var leaving_threeway = 0; + var blind_transfer = 0; + var hangup_all_non_reserved = ''; var dial_method = ''; - var DiaLControl_auto_HTML = "\"Pauza\"
\"Pokračovať\""; - var DiaLControl_auto_HTML_ready = "\"Pauza\"\"Pokračovať\""; - var DiaLControl_auto_HTML_OFF = "\"Pauza\"\"Pokračovať\""; - var DiaLControl_manual_HTML = "\"Volať"; + var web_form_target = ''; + var TEMP_VDIC_web_form_address = ''; + var APIPausE_ID = '99999'; + var APIDiaL_ID = '99999'; + var VtigeRLogiNScripT = ''; + var VtigeRurl = ''; + var VtigeREnableD = ''; + var alert_enabled = '' + var shift_logout_flag = 0; + var DiaLControl_auto_HTML = "\"\"Pokračovať\""; + var DiaLControl_auto_HTML_ready = "\"\"Pokračovať\""; + var DiaLControl_auto_HTML_OFF = "\"\"Pokračovať\""; + var DiaLControl_manual_HTML = "\"Volať"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); @@ -2185,6 +2546,60 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send alert control command for agent + function alert_control(taskalert) + { + 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(); + } + if (xmlhttp) + { + alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(alert_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + Nactiveext = null; + Nactiveext = xmlhttp.responseText; + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + if (taskalert=='ON') + { + alert_enabled = 'ON'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is ON"; + } + else + { + alert_enabled = 'OFF'; + document.getElementById("AgentAlertSpan").innerHTML = "Alert is OFF"; + } + + } + + // ################################################################################ // park customer and place 3way call function xfer_park_dial() @@ -2205,15 +2620,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} mainxfer_send_redirect('3WAY','','',tempvarattempt); - if (threeway_end == '0') - { - document.vicidial_form.xferchannel.value = ''; - xfercall_send_hangup(); - - document.vicidial_form.callchannel.value = ''; - document.vicidial_form.callserverip.value = ''; - dialedcall_send_hangup(); - } +// if (threeway_end == '0') +// { +// document.vicidial_form.xferchannel.value = ''; +// xfercall_send_hangup(); +// +// document.vicidial_form.callchannel.value = ''; +// document.vicidial_form.callserverip.value = ''; +// dialedcall_send_hangup(); +// } if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} } @@ -2223,8 +2638,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function SendManualDial(taskFromConf) { conf_dialed=1; + var sending_group_alias = 0; if (taskFromConf == 'YES') { + agent_dialed_number='1'; + agent_dialed_type='XFER_3WAY'; + document.getElementById("DialWithCustomer").innerHTML ="\"Volanie"; document.getElementById("ParkCustomerDial").innerHTML ="\"Zaparkovať"; @@ -2239,6 +2658,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {threeway_cid = outbound_cid;} if (three_way_call_cid == 'UPRAVENÉER') {threeway_cid = document.vicidial_form.phone_number.value;} + if (three_way_call_cid == 'AGENT_CHOOSE') + { + threeway_cid = cid_choice; + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + } } else { @@ -2254,27 +2679,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (dial_prefix == 'X') {var temp_dial_prefix = '';} - else {var temp_dial_prefix = dial_prefix;} + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} if (omit_phone_code == 'Y') {var temp_phone_code = '';} else {var temp_phone_code = document.vicidial_form.phone_code.value;} - if (manual_string.length > 9) + if (manual_string.length > 7) {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;} } + else + {agent_dialed_type='XFER_OVERRIDE';} } if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid);} + {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);} else - {basic_originate_call(manual_string,'NO','NO');} + {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);} MD_ring_secondS=0; } // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { + var usegroupalias=0; var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) @@ -2325,14 +2753,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - if (taskprefix == 'NO') {var orig_prefix = '';} - else {var orig_prefix = agc_dial_prefix;} + if (taskprefix == 'NO') {var call_prefix = '';} + else {var call_prefix = agc_dial_prefix;} + + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + if (taskreverse == 'YES') { if (taskdialvalue.length < 2) {var dialnum = dialplan_number;} else {var dialnum = taskdialvalue;} + var call_prefix = ''; var originatevalue = "Local/" + tasknum + "@" + ext_context; } else @@ -2355,12 +2788,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var queryCID = "DCagcW" + epoch_sec + user_abb;} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} - if (taskcid.length > 3) - {var call_cid = taskcid;} - else - {var call_cid = campaign_cid;} - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + { + if (taskcid.length > 3) + {var call_cid = taskcid;} + else + {var call_cid = campaign_cid;} + } + + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -2368,6 +2810,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + // alert(VMCoriginate_query); // alert(xmlhttp.responseText); if ((taskdialvalue.length > 0) && (tasknowait != 'YES')) @@ -2381,6 +2824,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -2525,6 +2973,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('AgenTDisablEBoX'); } + if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) + { + showDiv('SysteMDisablEBoX'); + } + if (AGLogiN == 'SHIFT_ODHLÁSIŤ') + { + shift_logout_flag=1; + } } var VLAStatuS_array = check_time_array[4].split("Stav: "); var VLAStatuS = VLAStatuS_array[1]; @@ -2544,6 +3000,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var APIHanguP = APIHanguP_array[1]; var APIStatuS_array = check_time_array[7].split("APIStatuS: "); var APIStatuS = APIStatuS_array[1]; + var APIPausE_array = check_time_array[8].split("APIPausE: "); + var APIPausE = APIPausE_array[1]; + var APIDiaL_array = check_time_array[9].split("APIDiaL: "); + var APIDiaL = APIDiaL_array[1]; if ( (APIHanguP==1) && (VD_live_customer_call==1) ) { hideDiv('CustomerGoneBox'); @@ -2557,7 +3017,78 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.DispoSelection.value = APIStatuS; DispoSelect_submit(); } + if (APIPausE.length > 4) + { + var APIPausE_array = APIPausE.split("!"); + if (APIPausE_ID == APIPausE_array[1]) + { + // alert("PAUSE ALREADY RECEIVED"); + } + else + { + APIPausE_ID = APIPausE_array[1]; + if (APIPausE_array[0]=='PAUSE') + { + if (VD_live_customer_call==1) + { + // set to pause na next dispo + document.vicidial_form.DispoSelectStop.checked=true; + // alert("Setting dispo to PAUSE"); + } + else + { + if (AutoDialReady==1) + { + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + } + VICIDiaL_pause_calling = 1; + } + } + } + if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) ) + { + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready"); + } + } + } + if (APIDiaL.length > 9) + { + var APIDiaL_array_detail = APIDiaL.split("!"); + if (APIDiaL_ID == APIDiaL_array_detail[6]) + { + // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]); + } + else + { + APIDiaL_ID = APIDiaL_array_detail[6]; + document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1]; + document.vicidial_form.phone_code.value = APIDiaL_array_detail[1]; + document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0]; + document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5]; + prefix_choice = APIDiaL_array_detail[7]; + active_group_alias = APIDiaL_array_detail[8]; + cid_choice = APIDiaL_array_detail[9]; + // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); + + if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system + {document.vicidial_form.LeadLookuP.checked=true;} + else + {document.vicidial_form.LeadLookuP.checked=false;} + if (APIDiaL_array_detail[4] == 'YES') // focus na vicidial agent screen + {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);} + if (APIDiaL_array_detail[3] == 'YES') // call preview + {NeWManuaLDiaLCalLSubmiT('PREVIEW');} + else + {NeWManuaLDiaLCalLSubmiT('NOW');} + } + } + +// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working na API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -2826,6 +3357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Covers the following types: XFER, VMAIL, ENTRY, CONF, ZAPARKOVAŤ, FROMZAPARKOVAŤ, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote) { + blind_transfer=1; // conf_dialed=1; if (auto_dial_level == 0) {RedirecTxFEr = 1;} var xmlhttpXF=false; @@ -2876,12 +3408,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (document.vicidial_form.xferoverride.checked==false) { - if (dial_prefix == 'X') {var temp_dial_prefix = '';} - else {var temp_dial_prefix = dial_prefix;} + if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';} + else {var temp_dial_prefix = three_way_dial_prefix;} if (omit_phone_code == 'Y') {var temp_phone_code = '';} else {var temp_phone_code = document.vicidial_form.phone_code.value;} - if (blindxferdialstring.length > 9) + if (blindxferdialstring.length > 7) {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} } } @@ -2911,8 +3443,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*$group**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id; } @@ -2965,6 +3497,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'ParK') { + blind_transfer=0; var queryCID = "LPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -2976,6 +3509,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'FROMParK') { + blind_transfer=0; var queryCID = "FPvdcW" + epoch_sec + user_abb; var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; @@ -3142,13 +3676,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + + manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&lead_id=" + document.vicidial_form.lead_id.value + "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -3158,7 +3692,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDlogResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; @@ -3344,7 +3878,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadPreview.checked=true; document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','',''); + ManualDialNext(taskCBid,taskLEADid,'','','','0'); } @@ -3376,6 +3910,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (agent_allow_group_alias == 'Y') + { + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Skupina Alias: " + active_group_alias + ""; + document.getElementById("ManuaLDiaLGrouP").innerHTML = "Kliknite tu pre Zvoliť skupinu Alias"; + } showDiv('NeWManuaLDiaLBox'); } } @@ -3384,31 +3923,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Insert the new manual dial as a lead and go to manual dial screen - function NeWManuaLDiaLCalLSubmiT() + function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; + + var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + if (MDDiaLOverridEform.length > 0) { - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES'); + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; + agent_dialed_number=1; MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - buildDiv('DiaLDiaLAltPhonE'); - document.vicidial_form.LeadPreview.checked=true; - document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + + if (tempDiaLnow == 'PREVIEW') + { + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); } document.vicidial_form.MDPhonENumbeR.value = ''; @@ -3421,6 +3984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var MDDiaLCodEform = document.vicidial_form.phone_code.value; var MDPhonENumbeRform = document.vicidial_form.phone_number.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { @@ -3432,6 +3996,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.LeadLookuP.checked==true) {MDLookuPLeaD = 'lookup';} + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; alt_phone_dialing=1; auto_dial_level=0; manual_dial_in_progress=1; @@ -3440,7 +4006,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} buildDiv('DiaLDiaLAltPhonE'); document.vicidial_form.LeadPreview.checked=false; document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD); + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); } } @@ -3611,7 +4177,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Volať ďalšie číslo request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) { inOUT = 'OUT'; all_record = 'NO'; @@ -3622,7 +4188,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AutoDial_ReSume_PauSe('VDADpause'); - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -3662,9 +4228,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter; - // alert(manual_dial_filter + "\n" +manDiaLnext_query); - xmlhttp.open('POST', 'vdc_db_query.php'); + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); + xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); xmlhttp.onreadystatechange = function() @@ -3694,13 +4269,13 @@ 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("This phone number is not in the campaign lists:\n" + mdnPhonENumbeR); alert_displayed=1;} + {alert("Tento telefón nie je v kampani zoznamy:\n" + mdnPhonENumbeR); alert_displayed=1;} if (alert_displayed==0) - {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + {alert("Nešpecifikovaná chyba:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} if (starting_dial_level == 0) { - document.getElementById("DiaLControl").innerHTML = "\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"Volať"; } else { @@ -3708,7 +4283,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -3781,65 +4356,81 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var genderValue = document.getElementById('gender_list').options[genderIndex].value; document.vicidial_form.gender.value = genderValue; - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + campaign + - "&channel_group=" + campaign + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - -// $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; -// $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } + else + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - VDIC_web_form_address = VICIDiaL_web_form_address; + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (LeaDPreVDispO == 'CALLBK') { @@ -3852,14 +4443,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (document.vicidial_form.LeadPreview.checked==false) { reselect_preview_dial = 0; @@ -3892,7 +4475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } @@ -3904,6 +4487,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } delete xmlhttp; + + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + } } } @@ -3922,7 +4514,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -4011,16 +4603,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { - document.getElementById("DiaLControl").innerHTML = "\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"Volať"; } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } } @@ -4034,6 +4631,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} alt_dial_status_display = 0; all_record = 'NO'; all_record_count=0; + var usegroupalias=0; if (taskaltnum == 'ALTTelefónE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -4062,24 +4660,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } if (dialed_label == 'ALT') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: ALT ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: ALT ";} if (dialed_label == 'ADDR3') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: Adresa 3 ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: Adresa 3 ";} var REGalt_dial = new RegExp("X","g"); if (dialed_label.match(REGalt_dial)) { - document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefón Code and Number: " + EAphone_code + " " + EAphone_number; + document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefón Kód a číslo: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k NEAKTÍVNYCH";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k aktívnemu";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; - document.getElementById("EAcommentsBoxD").innerHTML = "Poznámka:
" + EAalt_phone_notes; + document.getElementById("EAcommentsBoxB").innerHTML = "Aktívne:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Poznámky:
" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -4104,7 +4702,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; + if (cid_choice.length > 3) + { + var call_cid = cid_choice; + usegroupalias=1; + } + else + {var call_cid = campaign_cid;} + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + else + {var call_prefix = dial_prefix;} + + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -4113,6 +4723,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDOnextResponse = null; + // alert(manDiaLonly_query); // alert(xmlhttp.responseText); MDOnextResponse = xmlhttp.responseText; @@ -4161,13 +4772,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (get_call_launch == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } } } } delete xmlhttp; + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; } } @@ -4193,7 +4809,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -4209,12 +4825,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -4246,7 +4867,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } } delete xmlhttp; @@ -4323,11 +4951,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var EAactive_link = ''; if (APCactive == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k NEAKTÍVNYCH";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k aktívnemu";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxB").innerHTML = "Aktívne:" + EAalt_phone_active + "
" + EAactive_link; var xmlhttp=false; /*@cc_on @*/ @@ -4411,7 +5039,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var check_VDIC_array=check_incoming.split("\n"); if (check_VDIC_array[0] == '1') { - // alert(xmlhttprequestcheckauto.responseText); + // alert(xmlhttprequestcheckauto.responseText); AutoDialWaiting = 0; var VDIC_data_VDAC=check_VDIC_array[1].split("|"); @@ -4446,6 +5074,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {LIVE_campaign_rec_filename = campaign_rec_filename;} + if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') ) + {LIVE_default_group_alias = VDIC_data_VDIG[14];} + else + {LIVE_default_group_alias = default_group_alias;} + + if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') ) + {LIVE_caller_id_number = VDIC_data_VDIG[15];} + else + {LIVE_caller_id_number = default_group_alias_cid;} + + if (VDIC_data_VDIG[16].length > 0) + {LIVE_web_vars = VDIC_data_VDIG[16];} + else + {LIVE_web_vars = default_web_vars;} + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -4541,24 +5184,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} showDiv('CBcommentsBox'); } if (dialed_label == 'ALT') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: ALT ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: ALT ";} if (dialed_label == 'ADDR3') - {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: Adresa 3 ";} + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: Adresa 3 ";} var REGalt_dial = new RegExp("X","g"); if (dialed_label.match(REGalt_dial)) { - document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ ČÍSLO: " + dialed_label + ""; - document.getElementById("EAcommentsBoxA").innerHTML = "Telefón Code and Number: " + EAphone_code + " " + EAphone_number; + document.getElementById("CusTInfOSpaN").innerHTML = " ALT VOLAŤ číslo: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Telefón Kód a číslo: " + EAphone_code + " " + EAphone_number; var EAactive_link = ''; if (EAalt_phone_active == 'Y') - {EAactive_link = "Change this phone number to INACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k NEAKTÍVNYCH";} else - {EAactive_link = "Change this phone number to ACTIVE";} + {EAactive_link = "Zmeniť toto telefónne číslo k aktívnemu";} - document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; - document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; - document.getElementById("EAcommentsBoxD").innerHTML = "Poznámka: " + EAalt_phone_notes; + document.getElementById("EAcommentsBoxB").innerHTML = "Aktívne:" + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count:" + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Poznámky:" + EAalt_phone_notes; showDiv('EAcommentsBox'); } @@ -4595,7 +5238,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -4613,69 +5256,82 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.gender.value = genderValue; - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } + + + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} @@ -4701,7 +5357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (CalL_AutO_LauncH == 'WEBFORM') { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) @@ -4710,6 +5366,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} window.clipboardData.setData('Text', tmp_clip.value) } + if (alert_enabled=='ON') + { + alert(" Príchodzie: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter); + } } else { @@ -4740,76 +5400,88 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.gender.value = genderValue; } - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - "&source_id=" + source_id + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} + var regWFAcustom = new RegExp("^VAR","ig"); + if (VDIC_web_form_address.match(regWFAcustom)) + { + URLDecode(VDIC_web_form_address,'YES'); + TEMP_VDIC_web_form_address = decoded; + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, ''); + } else - {web_form_vars = '?' + web_form_vars} + { + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); + + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} + + TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + } if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -4911,7 +5583,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "HLvdcW" + epoch_sec + user_abb; var hangupvalue = customer_channel; // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS); - custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "campaign" + group; + custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLPOLOŹIŤ"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(custhangup_query); @@ -5036,7 +5708,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"Volať"; } reselect_alt_dial = 0; } @@ -5064,7 +5736,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = ''; if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -5080,7 +5752,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; } else { @@ -5342,30 +6014,69 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - showDiv('PauzaCodeSelectBox'); + showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; - PauzaCode_HTML = ''; - document.vicidial_form.PauzaCodeSelection.value = ''; + PauseCode_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); - PauzaCode_HTML = "
PAUSE CODE
"; + PauseCode_HTML = "
PAUSE CODE
"; var loop_ct = 0; while (loop_ct < VD_pause_codes_ct) { - PauzaCode_HTML = PauzaCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; loop_ct++; if (loop_ct == VD_pause_codes_ct_half) - {PauzaCode_HTML = PauzaCode_HTML + "
";} + {PauseCode_HTML = PauseCode_HTML + "";} } - PauzaCode_HTML = PauzaCode_HTML + "


Vrátiť späť"; - document.getElementById("PauzaCodeSelectContent").innerHTML = PauzaCode_HTML; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Vrátiť späť";} + + PauseCode_HTML = PauseCode_HTML + "


" + Go_BacK_LinK; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } +// ################################################################################ +// Generate the Skupina Alias Chooser panel + function GroupAliasSelectContent_create(task3way) + { + showDiv('GroupAliasSelectBox'); + WaitingForNextStep=1; + GroupAlias_HTML = ''; + document.vicidial_form.GroupAliasSelection.value = ''; + var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2); + GroupAlias_HTML = "
GROUP ALIAS
"; + if (task3way > 0) + { + VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1); + GroupAlias_HTML = GroupAlias_HTML + "CAMPAIGN - " + campaign_cid + "

"; + GroupAlias_HTML = GroupAlias_HTML + "UPRAVENÉER - " + document.vicidial_form.phone_number.value + "

"; + GroupAlias_HTML = GroupAlias_HTML + "AGENT_PHONE - " + outbound_cid + "

"; + } + var loop_ct = 0; + while (loop_ct < VD_group_aliases_ct) + { + GroupAlias_HTML = GroupAlias_HTML + "" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "

"; + loop_ct++; + if (loop_ct == VD_group_aliases_ct_half) + {GroupAlias_HTML = GroupAlias_HTML + "
";} + } + + var Go_BacK_LinK = "Vrátiť späť"; + + GroupAlias_HTML = GroupAlias_HTML + "


" + Go_BacK_LinK; + document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML; + } + // ################################################################################ // open web form, then submit disposition function WeBForMDispoSelect_submit() { leaving_threeway=0; + blind_transfer=0; document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; @@ -5385,7 +6096,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH('NO','YES'); - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + document.getElementById("WebFormSpan").innerHTML = "\"Web"; + + window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); DispoSelect_submit(); } @@ -5401,6 +6114,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var group = campaign;} leaving_threeway=0; + blind_transfer=0; document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; @@ -5446,7 +6160,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp.send(DSupdate_query); xmlhttp.onreadystatechange = function() { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) { var check_dispo = null; check_dispo = xmlhttp.responseText; @@ -5506,7 +6220,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimalizovať"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimalizovať "; document.getElementById("DispoSelectHAspan").innerHTML = "Položte znova"; CBcommentsBoxhide(); @@ -5514,41 +6228,48 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AgentDispoing = 0; - if (wrapup_waiting == 0) + if (shift_logout_flag < 1) { - if (document.vicidial_form.DispoSelectStop.checked==true) + if (wrapup_waiting == 0) { - if (auto_dial_level != '0') + if (document.vicidial_form.DispoSelectStop.checked==true) { - AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - VICIDiaL_pause_calling = 1; - if (dispo_check_all_pause != '1') - { - document.vicidial_form.DispoSelectStop.checked=false; - } - } - else - { - if (auto_dial_level != '0') - { - AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + if (auto_dial_level != '0') + { + AutoDialWaiting = 0; + AutoDial_ReSume_PauSe("VDADpause"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + } + VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { - // trigger HotKeys manual dial automatically go to next lead - if (manual_auto_hotkey == '1') + if (auto_dial_level != '0') { - manual_auto_hotkey = 0; - ManualDialNext('','','','',''); + AutoDialWaiting = 1; + AutoDial_ReSume_PauSe("VDADready","NEW_ID"); + // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; + } + else + { + // trigger HotKeys manual dial automatically go to next lead + if (manual_auto_hotkey == '1') + { + manual_auto_hotkey = 0; + ManualDialNext('','','','','','0'); + } } } } } + else + { + LogouT('SHIFT'); + } } } @@ -5559,7 +6280,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Submit the Pauza Code function PauseCodeSelect_submit(newpausecode) { - hideDiv('PauzaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); WaitingForNextStep=0; var xmlhttp=false; @@ -5583,7 +6304,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauzaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -5599,6 +6320,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Submit the Skupina Alias + function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) + { + hideDiv('GroupAliasSelectBox'); + WaitingForNextStep=0; + + if (newusegroup > 0) + { + active_group_alias = newgroupalias; + document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Skupina Alias: " + active_group_alias + ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Skupina Alias: " + active_group_alias + ""; + } + cid_choice = newgroupcid; + } + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame @@ -5617,13 +6354,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; - basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0'); } function DtMf_PreSet_b_DiaL() { document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; - basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0'); } // ################################################################################ @@ -5723,7 +6460,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (auto_dial_level > 0) { - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); } } @@ -5870,7 +6607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (logout_stop_timeouts < 1) { - LogouT(); + LogouT('CLOSE'); alert("PLEASE CLICK THE ODHLÁSIŤ LINK TO LOG OUT NEXT TIME.\n"); } } @@ -5878,7 +6615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. - function LogouT() + function LogouT(tempreason) { if (MD_channel_look==1) {alert("Nemôžete sa odhlásiť počas prebiehajúceho hovoru. \nČakať 50 sekúnd na volanie po neúspešnom prepojení ak nebola odpoveď");} @@ -5927,8 +6664,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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 = "KLIKNITE TU NA ZNOVU PRIHLÁSENIE\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "KLIKNITE TU NA ZNOVU PRIHLÁSENIE\n"; logout_stop_timeouts = 1; @@ -6112,6 +6852,7 @@ encoded=utf8_decode(xtest); var SCserver_ip = server_ip; var SCSIPexten = extension; var SCsession_id = session_id; + var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) { @@ -6154,6 +6895,7 @@ encoded=utf8_decode(xtest); SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+'); SCserver_ip = SCserver_ip.replace(RGplus,'+'); SCSIPexten = SCSIPexten.replace(RGplus,'+'); + SCweb_vars = SCweb_vars.replace(RGplus,'+'); } var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g"); @@ -6197,6 +6939,7 @@ encoded=utf8_decode(xtest); var RGserver_ip = new RegExp("--A--server_ip--B--","g"); var RGSIPexten = new RegExp("--A--SIPexten--B--","g"); var RGsession_id = new RegExp("--A--session_id--B--","g"); + var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGsource_id, SCsource_id); @@ -6239,6 +6982,7 @@ encoded=utf8_decode(xtest); encoded = encoded.replace(RGserver_ip, SCserver_ip); encoded = encoded.replace(RGSIPexten, SCSIPexten); encoded = encoded.replace(RGsession_id, SCsession_id); + encoded = encoded.replace(RGweb_vars, SCweb_vars); } decoded=encoded; // simple no ? decoded = decoded.replace(RGnl, "
"); @@ -6348,23 +7092,23 @@ function phone_number_format(formatphone) { // ################################################################################ -// Move the Dispo frame out of the way and change the link to maximalizovať +// Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 340; - document.getElementById("DispoSelectMaxMin").innerHTML = "maximalizovať"; + document.getElementById("DispoSelectMaxMin").innerHTML = " maximalizovať "; } // ################################################################################ -// Move the Dispo frame to the top and change the link to minimalizovať +// Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimalizovať"; + document.getElementById("DispoSelectMaxMin").innerHTML = " minimalizovať "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); @@ -6377,7 +7121,7 @@ function phone_number_format(formatphone) { { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("YOU MUST BE PAUSED TO CHANGE GROUPS"); + alert("Musíte byť pozastavené NA ZMENU ZOSKUPENIA"); } else { @@ -6407,7 +7151,7 @@ function phone_number_format(formatphone) { function EAcommentsBoxhide(minimizetask) { hideDiv('EAcommentsBox'); - if (minimalizovaťtask=='YES') + if (minimizetask=='YES') {showDiv('EAcommentsMinBox');} else {hideDiv('EAcommentsMinBox');} @@ -6552,6 +7296,7 @@ else hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); + hideDiv('SysteMDisablEBoX'); hideDiv('CustomerGoneBox'); hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); @@ -6563,7 +7308,8 @@ else hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); - hideDiv('PauzaCodeSelectBox'); + hideDiv('PauseCodeSelectBox'); + hideDiv('GroupAliasSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) @@ -6584,9 +7330,9 @@ else document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { - document.getElementById("PauzaCodeLinkSpan").innerHTML = "VLOŽIŤ KÓD PAUZY"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "VLOŽIŤ KÓD PAUZY"; } if (VICIDiaL_allow_closers < 1) { @@ -6618,6 +7364,11 @@ else document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; } } + if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) + { + document.getElementById("ScriptContents").innerHTML = " "; + + } VICIDiaL_closer_login_checked = 1; } else @@ -6650,7 +7401,7 @@ else if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"Volať"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -6764,13 +7515,14 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 0; - AutoDial_ReSume_PauSe("VDADpause","NO"); + AutoDial_ReSume_PauSe("VDADpause"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') { document.vicidial_form.DispoSelectStop.checked=false; + alert("unchecking PAUSE"); } } else @@ -6778,7 +7530,7 @@ else if (auto_dial_level != '0') { AutoDialWaiting = 1; - AutoDial_ReSume_PauSe("VDADready","NO"); + AutoDial_ReSume_PauSe("VDADready"); // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } } @@ -7128,6 +7880,21 @@ else document.getElementById("XferControl").innerHTML = "\"Presmerovanie"; } } + if (three_way_call_cid == 'AGENT_CHOOSE') + { + if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) ) + { + active_group_alias = LIVE_default_group_alias; + cid_choice = LIVE_caller_id_number; + } + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "Skupina Alias: " + active_group_alias + ""; + document.getElementById("XfeRCID").innerHTML = "Kliknite tu pre Zvoliť skupinu Alias"; + } + else + { + document.getElementById("XfeRCID").innerHTML = ""; + document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = ""; + } } else { @@ -7140,8 +7907,8 @@ else function MainPanelToFront(resumevar) { - document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; - document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -7168,7 +7935,7 @@ else { if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pauza\"\"Pokračovať\"
\"Volať"; + document.getElementById("DiaLControl").innerHTML = "\"\"Pokračovať\"
\"Volať"; if (manual_dial_preview == 1) {buildDiv('DiaLLeaDPrevieW');} } @@ -7179,16 +7946,16 @@ else } } } - panel_bgcolor='#E0C2D6'; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } function ScriptPanelToFront() { showDiv('ScriptPanel'); - document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; - document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; - panel_bgcolor='#FFE7D0'; + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -7239,7 +8006,7 @@ echo "\n";    
0) {echo "GROUPS     \n";} ?> -ODHLÁSIŤ\n"; ?> +ODHLÁSIŤ\n"; ?>
@@ -7267,8 +8034,8 @@ echo "\n"; X AKTÍVNE PREPLÁNOVANÉ HOVORY
- -
+ +
sekúnd: @@ -7289,7 +8056,7 @@ echo "\n";
- + height=460>
PREPLÁNOVANÉ HOVORY PRE AGENTA :
Kliknite na preplánovanie hovoru na volanie zákaznikovi znova. Ak kliknete na záznam nižšie budete ho volať a bude odstránený zo zoznamu.
@@ -7300,7 +8067,7 @@ echo "\n";
- + height=460> - +
NOVÉ manuálne vytáčanie pre zoznam kontaktov :

Zadajte nižšie uvedené informácie pre nový zoznam kontaktov, ktorý chcete volať.
\n";
  (Táto voľba skontroluje, ak sa bude snažiť nájsť telefónne číslo do systému pred jeho vloženie ako nového zoznamu kontaktov)


Ak chcete vytočiť číslo, a nemáte ho v novom zozname kontaktov, vložte volané číslo , ktoré chcete volať do poľa Prepísať volanie. Pre ukončenie hovoru, budete musieť otvoriť odkaz HOVORY V TEJTO RELÁCII v spodnej časti obrazovky, a ukončiť požadovaný kanál.
 
+

+     +
+

Ak chcete vytočiť číslo, a nemáte ho v novom zozname kontaktov, vložte volané číslo , ktoré chcete volať do poľa Prepísať volanie. Pre ukončenie hovoru, budete musieť otvoriť odkaz HOVORY V TEJTO RELÁCII v spodnej časti obrazovky, a ukončiť požadovaný kanál.
 
Prepísanie volania:   (prosím len čísla)

-
Volať znova + Volať znova +                 + Náhľad Výzva                 Vrátiť späť
@@ -7354,7 +8127,7 @@ Váš stav:
Calls Dialing: - Presmerovanie - Konferencia
+ Presmerovanie - Konferencia            
LOKALNE ROZSIRENIE @@ -7429,8 +8202,8 @@ Váš stav:
Calls Dialing: px;z-index:26;" id="EAcommentsBox"> height=70> - - + +
Extended Alt Telefón Information: minimalizovať Rozšírená Alt Telefón Informácie: minimalizovať

@@ -7446,7 +8219,7 @@ Váš stav:
Calls Dialing: px;z-index:27;" id="EAcommentsMinBox"> - +
maximalizovať
Alt Telefón Info
maximalizovať
Alt Telefón Info
@@ -7477,28 +8250,33 @@ Váš stav:
Calls Dialing: - height=500>
Vaša relácia bola ukončená
ODHLÁSIŤ

Vrátiť späť + height=500>
Vaša relácia bola ukončená
ODHLÁSIŤ

Vrátiť späť
- + + height=500>
Je synchronizácia času problém s vašim systémom, povedzte to, prosím, správcu systému


Vrátiť späť +
+
+ + height=500>

ODHLÁSIŤ
- +
- +
 
- + height=47>
Všetky zmeny vykonané v informáciách o zákazníkovi teraz , budú vykonané, musíte zmeniť informácie o zákazníkovi pred ukončením hovoru.
- - height=460>
VYKONANIE HOVORU :       Položte znova       minimalizovať
+ + height=460>
VYKONANIE HOVORU :       Položte znova       minimalizovať
Ukončenie hovoru vybranej dispozície
PAUZA VOLAJUCEHO AGENTA
@@ -7510,18 +8288,26 @@ Váš stav:
Calls Dialing: + height=460>
VYBRAŤ KÓD PAUZY :
- Pauza Code Selection - + Pauza Code Selection +

 
- + + height=460>
VYBER GROUP ALIAS :
+ Skupina Alias Výber + +

  +
+
+ + - + height=460>
Vyberte dátum preplánovania hovoru :
@@ -7566,7 +8352,7 @@ Váš stav:
Calls Dialing: LEN MOJE PREPLÁNOVANÉ HOVORY
";} ?> - Poznámky CB:

+ Poznámky CB:

POTVRDIŤ

@@ -7574,30 +8360,39 @@ Váš stav:
Calls Dialing: + height=460>
Užší výber prichádzajúce skupiny
Užší výber prichádzajúce skupiny
- ZMIESANE VOLANIE(Odchádzaúce volanie aktivované)
+ 0) and ($disable_blended_checkbox < 1) ) + { + ?> + ZMIESANE VOLANIE(Odchádzaúce volanie aktivované)
+ ZNOVU INCIALIZOVAŤ | POTVRDIŤ



 
- + Kanál Kanál LEN MOJE PREPLÁNOVANÉ HOVORY
";} + if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) ) + {echo " ZMIESANE VOLANIE
";} ?>
- height=>
VICIDIAL SCRIPT
+ height=>
VICIDIAL SCRIPT
@@ -7607,11 +8402,19 @@ Váš stav:
Calls Dialing: px;z-index:15;" id="MaiNfooterspan"> ->
verzia web klient VICIDIAL:     POSTAVENÉ:               Server:              
+> +
verzia web klient VICIDIAL:     POSTAVENÉ:               Server:              
Ukázať informáciu o konferenčnom kanále

 
+ 0) ) + {echo "Alert is ON";} +else + {echo "Alert is OFF";} +?> +
@@ -7623,12 +8426,12 @@ Váš stav:
Calls Dialing: - id="MainTable"> +
id="MainTable">
STAV:
-Volať ďalšie číslo
+Volať ďalšie číslo
PREZRIET ZOZNAM KONTAKTOV
ALTER. ČÍSLO TELEFÓNU
@@ -7674,24 +8477,38 @@ ID NAHRÁVKY:
- + +
  Čas:   Kanál:   Customer Time:   Kanál:
Informácia o zákazníkovi:
+ + + - + - + - + + + - + + + + + - + + + + + + + + + + - + + + - + + +
Titul:   Prvý:   MI:   Posledný:   Prvý:   MI:   Posledný:
Adresa1:
Adresa2:   Adresa3: Adresa3:
Mesto:   Štát:   PSČ: Štát: PSČ:
Kraj:   zákaznícke ID:   Gender: zákaznícke: Pohlavie:
Telefón: @@ -7703,27 +8520,35 @@ if ($disable_alter_custphone=='Y') } else { - echo ""; + echo ""; } ?> - -  Volací kód:   Alternatívne číslo: Volací kód: Alter. číslo:
Prezrieť:   Email: Email:
Poznámky: + \n";} + {echo "\n";} else {echo "\n";} ?>
@@ -7754,6 +8579,26 @@ else exit; +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) +{ +$NOW_TIME = date("Y-m-d H:i:s"); +# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); +$errno=''; $error=''; +if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } +$one_mysql_log=0; +return $errno; +} ?> diff --git a/LANG_www/vicidial/AST_CLOSERstats.php b/LANG_www/vicidial/AST_CLOSERstats.php deleted file mode 100644 index ec53f93f..00000000 --- a/LANG_www/vicidial/AST_CLOSERstats.php +++ /dev/null @@ -1,617 +0,0 @@ - LICENSE: GPLv2 -### -# 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 -# - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$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 "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;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$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++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Closer Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\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 = "$query_date $time_END";
-
-
-
-echo "VICIDIAL: Auto-dial Closer Stats                      $NOW_TIME\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='" . 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]);
-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);
-	}
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls:            $average_hold_seconds seconds\n";
-
-echo "\n";
-echo "---------- DROPS\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='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 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);
-	}
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
-
-
-
-##############################
-#########  CALL STATUS STATS
-
-$TOTALcalls = 0;
-
-echo "\n";
-echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
-
-$stmt="SELECT * from vicidial_statuses order by status";
-$rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
-
-$o=0;
-while ($statuses_to_print > $o) 
-	{
-	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="SELECT * from vicidial_campaign_statuses 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),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) . "' group by status;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
-$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);
-
-	$TOTALcalls = ($TOTALcalls + $row[0]);
-
-	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[1];
-	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}	
-		}
-	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');}	
-		}
-
-
-	echo "| $status | $status_name | $STATUScount |\n";
-
-	$i++;
-	}
-
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
-
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
-
-
-
-
-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='" . mysql_real_escape_string($group) . "' 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";
-
-
-##############################
-#########  USER STATS
-
-$TOTagents=0;
-$TOTcalls=0;
-$TOTtime=0;
-$TOTavg=0;
-
-echo "\n";
-echo "---------- AGENT STATS\n";
-echo "+--------------------------+------------+----------+--------+\n";
-echo "| AGENT                    | CALLS      | TIME M   | AVRG M |\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='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 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]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$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";
-	$USERtotTALK_MS =		sprintf("%8s", $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";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-if (!$TOTcalls) {$TOTcalls = 1;}
-$TOTavg = ($TOTtime / $TOTcalls);
-$TOTavg = round($TOTavg, 0);
-$TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
-$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
-$TOTavg_S = ($TOTavg_S * 60);
-$TOTavg_S = round($TOTavg_S, 0);
-if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
-$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
-$TOTavg =		sprintf("%6s", $TOTavg_MS);
-
-$TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = 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 =		sprintf("%6s", $TOTtime_MS);
-
-$TOTagents =		sprintf("%10s", $i);
-$TOTcalls =			sprintf("%10s", $TOTcalls);
-$TOTtime =			sprintf("%8s", $TOTtime);
-$TOTavg =			sprintf("%6s", $TOTavg);
-
-echo "+--------------------------+------------+----------+--------+\n";
-echo "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
-echo "+--------------------------+------------+----------+--------+\n";
-
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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 "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\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";
-
-
-
-
-
-$ENDtime = date("U");
-$RUNtime = ($ENDtime - $STARTtime);
-echo "\nRun Time: $RUNtime seconds\n";
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial/AST_VDADstats.php b/LANG_www/vicidial/AST_VDADstats.php deleted file mode 100644 index d8afbdd6..00000000 --- a/LANG_www/vicidial/AST_VDADstats.php +++ /dev/null @@ -1,647 +0,0 @@ - LICENSE: GPLv2 -### -# 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 -# - -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["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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$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 "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;} - -$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++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\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 = "$query_date $time_END";
-
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\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_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);
-
-$TOTALcalls =	sprintf("%10s", $row[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, 2);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 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]);
-$DROPcallsRAW =	$row[0];
-$DROPseconds =	$row[1];
-
-$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$ANSWERcalls =	$row[0];
-
-if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
-	{$DROPpercent = '0';}
-else
-	{
-	$DROPpercent = (($DROPcallsRAW / $TOTALcalls) * 100);
-	$DROPpercent = round($DROPpercent, 2);
-	}
-
-if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
-	{$DROPANSWERpercent = '0';}
-else
-	{
-	$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
-	$DROPANSWERpercent = round($DROPANSWERpercent, 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);
-	}
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ANSWERcalls  $DROPANSWERpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- AUTO-DIAL NO ANSWERS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-if ( ($NAcalls < 1) or ($TOTALcalls < 1) )
-	{$NApercent = '0';}
-else
-	{
-	$NApercent = (($NAcalls / $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);
-	}
-
-echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls  $NApercent%\n";
-echo "Average Call Length for NA Calls in seconds:  $average_na_seconds\n";
-
-
-##############################
-#########  CALL STATUS STATS
-
-$TOTALcalls = 0;
-
-echo "\n";
-echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
-
-$stmt="SELECT * from vicidial_statuses order by status";
-$rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
-
-$o=0;
-while ($statuses_to_print > $o) 
-	{
-	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' 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";}
-$statuses_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $statuses_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$TOTALcalls = ($TOTALcalls + $row[0]);
-
-	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[1];
-	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}	
-		}
-	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');}	
-		}
-
-
-	echo "| $status | $status_name | $STATUScount |\n";
-
-	$i++;
-	}
-
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
-
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
-
-
-##############################
-#########  USER STATS
-
-$TOTagents=0;
-$TOTcalls=0;
-$TOTtime=0;
-$TOTavg=0;
-
-echo "\n";
-echo "---------- AGENT STATS\n";
-echo "+--------------------------+------------+----------+--------+\n";
-echo "| AGENT                    | CALLS      | TIME M   | AVRG M |\n";
-echo "+--------------------------+------------+----------+--------+\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' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 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) {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]);while(strlen($user)>6) {$user = substr("$user", 0, -1);}
-	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_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";
-	$USERtotTALK_MS =		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";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls |   $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-if (!$TOTcalls) {$TOTcalls = 1;}
-$TOTavg = ($TOTtime / $TOTcalls);
-$TOTavg = round($TOTavg, 0);
-$TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
-$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
-$TOTavg_S = ($TOTavg_S * 60);
-$TOTavg_S = round($TOTavg_S, 0);
-if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
-$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
-$TOTavg =		sprintf("%6s", $TOTavg_MS);
-
-$TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = 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 =		sprintf("%6s", $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' 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 Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
-echo "+--------------------------+------------+----------+--------+\n";
-echo "| Average Wait time between calls                    $AVGwait |\n";
-echo "+-----------------------------------------------------------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\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' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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' and campaign_id='" . mysql_real_escape_string($group) . "' 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' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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' and campaign_id='" . mysql_real_escape_string($group) . "' 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' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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' and campaign_id='" . mysql_real_escape_string($group) . "' 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' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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' and campaign_id='" . mysql_real_escape_string($group) . "' 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 "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\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";
-
-
-
-
-
-
-$ENDtime = date("U");
-$RUNtime = ($ENDtime - $STARTtime);
-echo "\nRun Time: $RUNtime seconds\n";
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial/AST_agent_disposition.php b/LANG_www/vicidial/AST_agent_disposition.php deleted file mode 100644 index b0b0a461..00000000 --- a/LANG_www/vicidial/AST_agent_disposition.php +++ /dev/null @@ -1,237 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 70201-1213 - First build - from Marin Blu -# -# - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$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;"; - 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|\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($begin_date)) {$begin_date = $NOW_DATE;} -if (!isset($end_date)) {$end_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 Disposition\n"; -echo "
\n"; -echo "Date - From: to \n"; -echo "  \n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-echo "VICIDIAL: Agent Disposition                             $NOW_TIME\n";
-
-echo "Time range: $begin_date to $end_date \n\n";
-echo "---------- Disposition Details -------------\n\n";
-
-echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID         | CALLS  | TALK   | TALKAVG| A    | B    |CALLBK|CBHOLD| DEC  | DC   | DNC  | DROP |INCALL| LB   | N    | NA   | NI   | NP   | NQ   |QUEUE | SALE | XFER |\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 >= '$begin_date 00:00:01' and call_date <= '$end_date 23:59:59'  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]);
-	$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("%-10s", $row[3]); while(strlen($user[$i])>10) {$user[$i] = substr("$user[$i]", 0, -1);}
-	$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   ";  $ctINCALL[$k]="0   ";  $ctDROP[$k]="0   ";  $ctQUEUE[$k]="0   ";  $ctNP[$k]="0   ";   $ctDEC[$k]="0   ";  $ctNQ[$k]="0   ";  $ctNA[$k]="0   ";   $ctXFER[$k]="0   "; $ctLB[$k]="0   ";  $ctCALLBK[$k]="0   "; $ctCBHOLD[$k]="0   ";
-	$stmt="select count(*),status from vicidial_log where call_date >= '$begin_date 00:00:01' and call_date <= '$end_date 23:59:59'  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') {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if ($row[1] == 'INCALL') {$ctINCALL[$k]=sprintf("%-4s", $row[0]);	$TOT_INCALL = ($TOT_INCALL + $row[0]);}
-		if ($row[1] == 'DROP') {$ctDROP[$k]=sprintf("%-4s", $row[0]);	$TOT_DROP = ($TOT_DROP + $row[0]);}
-		if ($row[1] == 'QUEUE') {$ctQUEUE[$k]=sprintf("%-4s", $row[0]);	$TOT_QUEUE = ($TOT_QUEUE + $row[0]);}
-		if ($row[1] == 'NP') {$ctNP[$k]=sprintf("%-4s", $row[0]);	$TOT_NP = ($TOT_NP + $row[0]);}
-		if ($row[1] == 'DEC') {$ctDEC[$k]=sprintf("%-4s", $row[0]);	$TOT_DEC = ($TOT_DEC + $row[0]);}
-		if ($row[1] == 'NQ') {$ctNQ[$k]=sprintf("%-4s", $row[0]);	$TOT_NQ = ($TOT_NQ + $row[0]);}
-		if ($row[1] == 'NA') {$ctNA[$k]=sprintf("%-4s", $row[0]);	$TOT_NA = ($TOT_NA + $row[0]);}
-		if ($row[1] == 'XFER') {$ctXFER[$k]=sprintf("%-4s", $row[0]);	$TOT_XFER = ($TOT_XFER + $row[0]);}
-		if ($row[1] == 'LB') {$ctLB[$k]=sprintf("%-4s", $row[0]);	$TOT_LB = ($TOT_LB + $row[0]);}
-		if ($row[1] == 'CALLBK') {$ctCALLBK[$k]=sprintf("%-4s", $row[0]);	$TOT_CALLBK = ($TOT_CALLBK + $row[0]);}
-		if ($row[1] == 'CBHOLD') {$ctCBHOLD[$k]=sprintf("%-4s", $row[0]);	$TOT_CBHOLD = ($TOT_CBHOLD + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctCALLBK[$k] | $ctCBHOLD[$k] | $ctDEC[$k] | $ctDC[$k] | $ctDNC[$k] | $ctDROP[$k] | $ctINCALL[$k] | $ctLB[$k] | $ctN[$k] | $ctNA[$k] | $ctNI[$k] | $ctNP[$k] | $ctNQ[$k] | $ctQUEUE[$k] | $ctSALE[$k] | $ctXFER[$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);
-	$TOT_INCALL = sprintf("%-5s", $TOT_INCALL);
-	$TOT_DROP = sprintf("%-5s", $TOT_DROP); 
-	$TOT_QUEUE = sprintf("%-5s", $TOT_QUEUE);
-	$TOT_NP = sprintf("%-5s", $TOT_NP);
-	$TOT_DEC = sprintf("%-5s", $TOT_DEC);
-	$TOT_NQ = sprintf("%-5s", $TOT_NQ);
-	$TOT_NA = sprintf("%-5s", $TOT_NA);
-	$TOT_XFER = sprintf("%-5s", $TOT_XFER);
-	$TOT_LB= sprintf("%-5s", $TOT_LB);
-	$TOT_CALLBK = sprintf("%-5s", $TOT_CALLBK);
-	$TOT_CBHOLD = sprintf("%-5s", $TOT_CBHOLD);
-
-echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                      | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_CALLBK| $TOT_CBHOLD| $TOT_DEC| $TOT_DC| $TOT_DNC| $TOT_DROP| $TOT_INCALL| $TOT_LB| $TOT_N| $TOT_NA| $TOT_NI| $TOT_NP| $TOT_NQ| $TOT_QUEUE| $TOT_SALE| $TOT_XFER|\n";
-echo "+-----------------+------------+--------+--------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+\n";
-echo "\n";
-
-}
-?>
-
\ No newline at end of file
diff --git a/LANG_www/vicidial/AST_agent_performance_detail.php b/LANG_www/vicidial/AST_agent_performance_detail.php
deleted file mode 100644
index 5557d4dd..00000000
--- a/LANG_www/vicidial/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,557 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 71119-2359 - First build
-# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one
-#            - Fixed zero division bug
-#
-
-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["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["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';}
-
-$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;
-	}
-
-$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++;
-	}
-$stmt="select user_group from vicidial_user_groups;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
-$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++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\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 = "$query_date $time_END";
-
-if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
-else {$ugSQL='';}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\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 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 campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;";
-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);
-	$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];
-	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 "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
-echo "| USER NAME       | ID       | CALLS  | TIME    | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG|$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;
-	$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]);
-				$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);
-	$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;}
-
-	$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');}
-	}
-
-	$USERtime_M = ($Stime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($Stalk_sec / 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 =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($Stalk_avg / 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 =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($Spause_sec / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($Spause_avg / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($Swait_sec / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($Swait_avg / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($Sdispo_sec / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($Sdispo_avg / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS =		sprintf("%6s", $USERavgDISPO_MS);
-
-	echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n";
-	$m++;
-	}
-### END loop through each user ###
-
-
-###### 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);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = 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);
-		while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$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("%8s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%8s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%8s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%8s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$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);}
-
-
-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 |$SUMstatusesHTML\n";
-echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
-
-echo "\n";
-
-}
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_www/vicidial/AST_agent_time_sheet_archive.php b/LANG_www/vicidial/AST_agent_time_sheet_archive.php
deleted file mode 100644
index fb71d1d6..00000000
--- a/LANG_www/vicidial/AST_agent_time_sheet_archive.php
+++ /dev/null
@@ -1,286 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1721 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-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["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["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$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 "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($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "VICIDIAL ADMIN: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Modify User\n";
-echo "
\n"; -echo "
  \n"; -echo "Date: \n"; -echo "User ID: \n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\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 "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT 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_archive 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_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS 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 AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive 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_archive 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_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_www/vicidial/AST_inboundEXTstats_department.php b/LANG_www/vicidial/AST_inboundEXTstats_department.php
deleted file mode 100644
index 015f6820..00000000
--- a/LANG_www/vicidial/AST_inboundEXTstats_department.php
+++ /dev/null
@@ -1,178 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-# 70201-1710 - First Build
-#
-
-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_query_date"]))				{$end_query_date=$_GET["end_query_date"];}
-	elseif (isset($_POST["end_query_date"]))	{$end_query_date=$_POST["end_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["SUBMIT"]))					{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$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 "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($query_date)) {$query_date = $NOW_DATE;}
-if (!isset($end_query_date)) {$end_query_date = $NOW_DATE;}
-if (!isset($server_ip)) {$server_ip = '10.10.11.20';}
-
-$stmt="select distinct department from inbound_numbers;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$dept_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $dept_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$dept[$i] =$row[0];
-	$i++;
-	}
-
-?>
-
-
-
-
-
-\n";
-#echo"\n";
-echo "ASTERISK: Inbound Calls Stats - By Department\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A DEPARTMENT AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-$extSQL='';
-$stmt="select extension from inbound_numbers where department='$group';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$inbound_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $inbound_to_print)
-	{
-	if (strlen($extSQL)> 1) {$extSQL .= ",";}
-	$row=mysql_fetch_row($rslt);
-	$extensions[$i] =$row[0];
-	$extSQL .= "'$extensions[$i]'";
-	$i++;
-	}
-
-echo "ASTERISK: Inbound Calls Stats For $group   from $query_date to $end_query_date\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-echo "\n";
-
-echo "+----------------------+------------+------------+\n";
-echo "| NUMBER               | CALLS      | AVG TIME   |\n";
-echo "+----------------------+------------+------------+\n";
-
-$k=0;
-while ($k < $inbound_to_print)
-	{
-	$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($end_query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' and extension='$extensions[$k]' ;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$extensions[$k] = sprintf("%20s", $extensions[$k]);
-	$TOTALcalls =	sprintf("%10s", $row[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);
-		}
-
-	$calls = ($TOTALcalls + $calls);
-	$seconds = ($row[1] + $seconds);
-
-	echo "| $extensions[$k] | $TOTALcalls | $average_hold_seconds |\n";
-	$k++;
-	}
-
-$calls =	sprintf("%10s", $calls);
-$seconds = ($seconds / $calls);
-$seconds = round($seconds, 0);
-$seconds =	sprintf("%5s", $seconds);
-echo "+----------------------+------------+------------+\n";
-echo "| TOTALS               | $calls | AVG: $seconds |\n";
-echo "+----------------------+------------+------------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial/AST_parkstats.php b/LANG_www/vicidial/AST_parkstats.php deleted file mode 100644 index 13552c30..00000000 --- a/LANG_www/vicidial/AST_parkstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1717 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -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["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"];} - -$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 "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;} - -$stmt="select distinct channel_group from park_log;"; -$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++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Park Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A GROUP AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Park Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . 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]);
-$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 Calls taken in this Group:              $TOTALcalls\n";
-echo "Average Hold Time(seconds) for all Calls:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_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);
-
-$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 Dropped Calls:                          $DROPcalls  $DROPpercent%\n";
-echo "Average Hold Time(seconds) for Dropped Calls: $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select park_log.user,full_name,count(*),sum(talked_sec),avg(talked_sec) from park_log,vicidial_users where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and park_log.user is not null and talked_sec is not null and talked_sec > 4 and park_log.user=vicidial_users.user group by park_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);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$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";
-	$USERtotTALK_MS =		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";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$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 park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_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 park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$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 park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_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 park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$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 park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_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 park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$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 park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_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 "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP\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/LANG_www/vicidial/AST_timeonVDAD_closer.php b/LANG_www/vicidial/AST_timeonVDAD_closer.php deleted file mode 100644 index 23eb851e..00000000 --- a/LANG_www/vicidial/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,318 +0,0 @@ - LICENSE: GPLv2 -### -# 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 -# - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$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;"; - 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|\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 "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\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);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
-		$extension[$i] =		sprintf("%-10s", $extension[$i]);
-			while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);}
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$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", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$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] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$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]);
-		$i++;
-		}
-		$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$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 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 "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$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 calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial/AST_timeonVDADall.php b/LANG_www/vicidial/AST_timeonVDADall.php deleted file mode 100644 index ec8eb52a..00000000 --- a/LANG_www/vicidial/AST_timeonVDADall.php +++ /dev/null @@ -1,826 +0,0 @@ - LICENSE: GPLv2 -# -# 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 (Chris Doyle) -# 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 -# - -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["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -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($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} -if (!isset($usergroup)) {$usergroup='';} -if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes -if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name -if (!isset($orderby)) {$orderby='timeup';} -if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes - -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]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $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); - - -$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; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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++; - } - -$stmt="select * from vicidial_user_groups;"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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=''; - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -if ($UGdisplay > 0) - { - echo "\n"; - } -echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       MODIFY | \n"; -echo "SUMMARY | \n"; -echo "REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $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) from vicidial_campaigns;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select count(*) from vicidial_hopper;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="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),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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 LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "
"; - -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -if ($UGdisplay>0) - { - echo "       HIDE USER GROUP"; - } -else - { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       SHOW AGENT ID"; - } -else - { - echo "       SHOW AGENT NAME"; - } -if ($SERVdisplay>0) - { - echo "       HIDE SERVER INFO"; - } -else - { - echo "       SHOW SERVER INFO"; - } -echo "
"; - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if ($campaign_allow_inbound > 0) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} - $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;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - 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"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; - - -$HDbegin = "+"; -$HTbegin = "|"; -$HDstation = "------------+"; -$HTstation = " STATION |"; -$HDuser = "--------------------+"; -$HTuser = " USER |"; -$HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; -$HDsessionid = "------------------+"; -$HTsessionid = " SESSIONID |"; -$HDbarge = "-------+"; -$HTbarge = " BARGE |"; -$HDstatus = "----------+"; -$HTstatus = " STATUS |"; -$HDserver_ip = "-----------------+"; -$HTserver_ip = " SERVER IP |"; -$HDcall_server_ip = "-----------------+"; -$HTcall_server_ip = " CALL SERVER IP |"; -$HDtime = "---------+"; -$HTtime = " MM:SS |"; -$HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; - -if ($UGdisplay < 1) - { - $HDusergroup = ''; - $HTusergroup = ''; - } -if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) - { - $HDsessionid = "-----------+"; - $HTsessionid = " SESSIONID |"; - } -if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) - { - $HDbarge = ''; - $HTbarge = ''; - } -if ($SERVdisplay < 1) - { - $HDserver_ip = ''; - $HTserver_ip = ''; - $HDcall_server_ip = ''; - $HTcall_server_ip = ''; - } - - - -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; -$Aecho .= "$Aline"; -$Aecho .= "$Bline"; -$Aecho .= "$Aline"; - -if ($orderby=='timeup') {$orderSQL='status,last_call_time';} -if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} -if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';} -if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';} -if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';} -if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time 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 ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} -if (strlen($usergroup)<1) {$usergroupSQL = '';} -else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} - -$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - -#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;"; - -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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]; - } - if ($non_latin < 1) - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - } - else - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-40s", $extension); - while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} - } - $Luser = $row[1]; - $user = sprintf("%-18s", $row[1]); - $Lsessionid = $row[2]; - $sessionid = sprintf("%-9s", $row[2]); - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $comments= $row[11]; - - if (eregi("INCALL",$Lstatus)) - { - if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) - {$CM='A';} - else - { - if (eregi("INBOUND",$comments)) - {$CM='I';} - else - {$CM='M';} - } - } - else {$CM=' ';} - - if ($UGdisplay > 0) - { - if ($non_latin < 1) - { - $user_group = sprintf("%-12s", $row[9]); - while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} - } - else - { - $user_group = sprintf("%-40s", $row[9]); - 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("%-18s", $row[10]); - while(strlen($user)>18) {$user = substr("$user", 0, -1);} - } - else - { - $user = sprintf("%-40s", $row[10]); - while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} - } - } - 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 ($Lstatus=='INCALL') - { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - } - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - $G=''; $EG=''; - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$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_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$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 ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} - else {$UGD = "";} - - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} - else {$SVD = "";} - - $agentcount++; - - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "$Aline"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load 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"; - - 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 "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - diff --git a/LANG_www/vicidial/AST_timeonVDADallREC.php b/LANG_www/vicidial/AST_timeonVDADallREC.php deleted file mode 100644 index 2abf27b2..00000000 --- a/LANG_www/vicidial/AST_timeonVDADallREC.php +++ /dev/null @@ -1,943 +0,0 @@ - LICENSE: GPLv2 -# -# 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 (Chris Doyle) -# 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) -# - -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["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -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["RECmonitorLINK"])) {$RECmonitorLINK=$_GET["RECmonitorLINK"];} - elseif (isset($_POST["RECmonitorLINK"])) {$RECmonitorLINK=$_POST["RECmonitorLINK"];} - -if (!isset($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} -if (!isset($usergroup)) {$usergroup='';} -if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes -if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name -if (!isset($orderby)) {$orderby='timeup';} -if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes - -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]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $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); - -$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'");} - if ($non_latin > 0) {$rslta=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; - } - - $stmt="SELECT vicidial_recording 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'");} - if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authrec=$row[0]; - if ($authrec=='1') {$RECmonitorLINK = 1;} else {$RECmonitorLINK = 0;} - - -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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++; - } - -$stmt="select * from vicidial_user_groups;"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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=''; - -?> - - - - - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL Campaign: \n"; -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 ($UGdisplay > 0) - { - echo "\n"; - } -echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       MODIFY | \n"; -echo "SUMMARY | \n"; -echo "REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$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) . "';"; - -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $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) from vicidial_campaigns;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select count(*) from vicidial_hopper;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="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) from vicidial_campaign_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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]; -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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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 "
DIAL LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; - -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -if ($UGdisplay>0) - { - echo "       HIDE USER GROUP"; - } -else - { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       SHOW AGENT ID"; - } -else - { - echo "       SHOW AGENT NAME"; - } -if ($SERVdisplay>0) - { - echo "       HIDE SERVER INFO"; - } -else - { - echo "       SHOW SERVER INFO"; - } -echo "
"; - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} - if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - 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 (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) - {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"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; - - -$HDbegin = "+"; -$HTbegin = "|"; -$HDstation = "------------+"; -$HTstation = " STATION |"; -$HDuser = "--------------------+"; -$HTuser = " USER |"; -$HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; -$HDsessionid = "------------------+"; -$HTsessionid = " SESSIONID |"; -$HDbarge = "-------+"; -$HTbarge = " BARGE |"; -$HDrec = "---------+"; -$HTrec = " MONITOR |"; -$HDstatus = "----------+"; -$HTstatus = " STATUS |"; -$HDserver_ip = "-----------------+"; -$HTserver_ip = " SERVER IP |"; -$HDcall_server_ip = "-----------------+"; -$HTcall_server_ip = " CALL SERVER IP |"; -$HDtime = "---------+"; -$HTtime = " MM:SS |"; -$HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; - -if ($UGdisplay < 1) - { - $HDusergroup = ''; - $HTusergroup = ''; - } -if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) - { - $HDsessionid = "-----------+"; - $HTsessionid = " SESSIONID |"; - } -if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) - { - $HDbarge = ''; - $HTbarge = ''; - } -if ($SERVdisplay < 1) - { - $HDserver_ip = ''; - $HTserver_ip = ''; - $HDcall_server_ip = ''; - $HTcall_server_ip = ''; - } - -if ( ($RECmonitorLINK<1) ) -{ - $HDrec = ''; - $HTrec = ''; -} - -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDrec$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTrec$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; - -$Aecho .= "$Aline"; -$Aecho .= "$Bline"; -$Aecho .= "$Aline"; - -if ($orderby=='timeup') {$orderSQL='status,last_call_time';} -if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} -if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';} -if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';} -if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';} -if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time 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 ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} -if (strlen($usergroup)<1) {$usergroupSQL = '';} -else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} - -$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,lead_id,vicidial_users.pass from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - -#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;"; - -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} $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]; - } - if ($non_latin < 1) - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = eregi_replace('IAX2/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - } - else - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = eregi_replace('IAX2/',"",$row[0]); - $extension = sprintf("%-40s", $extension); - while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} - } - - $Luser = $row[1]; - $user = sprintf("%-18s", $row[1]); - $Lsessionid = $row[2]; - $sessionid = sprintf("%-9s", $row[2]); - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - $Lserver_ip = $row[4]; - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $comments= $row[11]; - - $lead_id = $row[12]; - $user_pass = $row[13]; - - - if (eregi("INCALL",$Lstatus)) - { - if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) - {$CM='A';} - else - { - if (eregi("INBOUND",$comments)) - {$CM='I';} - else - {$CM='M';} - } - } - else {$CM=' ';} - - if ($UGdisplay > 0) - { - if ($non_latin < 1) - { - $user_group = sprintf("%-12s", $row[9]); - while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} - } - else - { - $user_group = sprintf("%-40s", $row[9]); - 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("%-18s", $row[10]); - while(strlen($user)>18) {$user = substr("$user", 0, -1);} - } - else - { - $user = sprintf("%-40s", $row[10]); - while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} - } - } - 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 ($Lstatus=='INCALL') - { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - } - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - $G=''; $EG=''; - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$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_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - - $L=''; - $R=''; - $LL=''; - $EXTF='6'; - $servip= str_replace('.','',$Lserver_ip); - if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} - if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R='';} - if ($SIPmonitorLINK>1) {$R=" | BARGE";} - if ($IAXmonitorLINK>1) {$R=" | BARGE";} - - - if ($RECmonitorLINK>0) - { - - $stmt="select session_name from web_client_sessions where server_ip ='$server_ip' and extension ='$extension' limit 1;"; - if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} - $rslta=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $sess = mysql_num_rows($rslta); - - if ($sess > 0) - { - $row=mysql_fetch_row($rslta); - $sessionname = $row[0]; - } else - { - $sessionname = ""; - } - - - $stmt="select end_time,channel,extension,lead_id,user,server_ip,filename from recording_log where server_ip ='$server_ip' and user ='$Luser';"; - if ($non_latin > 0) {$rslta=mysql_query("SET NAMES 'UTF8'");} - $rslta=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_channels = mysql_num_rows($rslta); - - if ($rec_channels > 0) - { - $ii=0; - while ($ii < $rec_channels) - { - $row=mysql_fetch_row($rslta); - $pos=strpos($row[1], $Lsessionid); - - if ($pos===false) - { - $LL=" Rec "; - } - else - { - if(is_null($row[0])) { - $LL=" Stop"; - } - else - { - $LL=" Rec "; - } - } - - $ii++; - } - } - else - { - $LL=" Rec "; - - } - } - - - 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 = "";} - - $agentcount++; - - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $LL | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "$Aline"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load 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"; - - 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 "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - diff --git a/LANG_www/vicidial/AST_timeoncall.php b/LANG_www/vicidial/AST_timeoncall.php deleted file mode 100644 index fc8eeced..00000000 --- a/LANG_www/vicidial/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$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$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial/admin.php b/LANG_www/vicidial/admin.php deleted file mode 100644 index 7fc0228a..00000000 --- a/LANG_www/vicidial/admin.php +++ /dev/null @@ -1,13575 +0,0 @@ - LICENSE: GPLv2 -# - - -require("dbconnect.php"); - - -###################################################################################################### -###################################################################################################### -####### static variable settings for display options -###################################################################################################### -###################################################################################################### - -$page_width='770'; -$section_width='720'; -$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'; -#$users_color = '#FFFF99'; -#$campaigns_color = '#FFFF99'; -#$lists_color = '#FFFF99'; -#$ingroups_color = '#FFFF99'; -#$remoteagent_color ='#FFFF99'; -#$usergroups_color = '#FFFF99'; -#$scripts_color = '#FFFF99'; -#$filters_color = '#FFFF99'; -#$admin_color = '#FFFF99'; -#$reports_color = '#FFFF99'; - $times_color = '#FF33FF'; - $phones_color = '#FF33FF'; - $conference_color = '#FF33FF'; - $server_color = '#FF33FF'; - $settings_color = '#FF33FF'; - $status_color = '#FF33FF'; -$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'; -$subcamp_color = '#FF9933'; -$subcamp_font = 'BLACK'; - -$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["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_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -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["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -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_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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -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["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($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; - } - -###################################################################################################### -###################################################################################################### -####### Form variable filtering for security and data integrity -###################################################################################################### -###################################################################################################### - -if ($non_latin < 1) -{ -### DIGITS ONLY ### -$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); -$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); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$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); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$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); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$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); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$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); - -### DIGITS and DASHES -$group_rank = ereg_replace("[^-0-9]","",$group_rank); -$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$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); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); -$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); -$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); -$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); - -### ALPHA-NUMERIC ONLY ### -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$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); -$queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); -$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); -$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); -$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); - -### 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); - -### 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); - -### 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); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$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); -$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); -$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); - -### 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 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); -$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); - -### 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); -$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); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); -$list_mix_container = ereg_replace(";","",$list_mix_container); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $queuemetrics_url -# $admin_home_url - -### VARIABLES not filtered at all ### -# $script_text - -} # end of non_latin - - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI 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 -# -# -# 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.0.4-119'; -$build = '71125-1751'; - -$STARTtime = date("U"); -$SQLdate = date("Y-m-d H:i:s"); -$MT[0]=''; -$US='_'; - -$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); - -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 "You have now logged out. Thank you\n"; - exit; -} - - $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<1)) - { - 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; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * 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[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]; - - $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|$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); - } - } - } - -###################################################################################################### -###################################################################################################### -####### Header settings -###################################################################################################### -###################################################################################################### - - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD=="1") {$hh='users'; echo "Add New User";} -if ($ADD=="1A") {$hh='users'; echo "Copy User";} -if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Add New Campaign";} -if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Campaign";} -if ($ADD==111) {$hh='lists'; echo "Add New List";} -if ($ADD==121) {$hh='lists'; echo "Add New DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} -if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Group";} -if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} -if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} -if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} -if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} -if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Add New Call Time";} -if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Add New State Call Time";} -if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";} -if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";} -if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";} -if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD=="2") {$hh='users'; echo "New User Addition";} -if ($ADD=="2A") {$hh='users'; echo "New Copied User Addition";} -if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "New Copied Campaign Addition";} -if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "New Auto Alt Dial Status";} -if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "New Agent Pause Code";} -if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Added";} -if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Added";} -if ($ADD==211) {$hh='lists'; echo "New List Addition";} -if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} -if ($ADD==2011) {$hh='ingroups'; echo "New Copied In-Group Addition";} -if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} -if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} -if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} -if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} -if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "New Call Time Addition";} -if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "New State Call Time Addition";} -if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE";} -if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";} -if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";} -if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";} -if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} -if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL SYSTEM STATUSES";} -if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL STATUS CATEGORY";} -if ($ADD==3) {$hh='users'; echo "Modify User";} -if ($ADD==30) {$hh='campaigns'; echo "Campaign Not Allowed";} -if ($ADD==31) - { - $hh='campaigns'; $sh='detail'; echo "Modify Campaign - Detail - $campaign_id"; - if ($SUB==22) {echo " - Statuses";} - if ($SUB==23) {echo " - HotKeys";} - if ($SUB==25) {echo " - Lead Recycle Entries";} - if ($SUB==26) {echo " - Auto Alt Dial Statuses";} - if ($SUB==27) {echo " - Agent Pause Codes";} - if ($SUB==29) {echo " - List Mixes";} - } -if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Campaign Statuses";} -if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaign HotKeys";} -if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} -if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Campaign Lead Recycle Entries";} -if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Campaign Auto Alt Dial Statuses";} -if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Campaign Agent Pause Codes";} -if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Statuses";} -if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mixes";} -if ($ADD==311) {$hh='lists'; echo "Modify List";} -if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";} -if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modify Call Time State Definitions List";} -if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} -if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} -if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} -if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} -if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} -if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} -if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} -if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORY";} -if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} -if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modify Campaign Lead Recycle";} -if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modify Agent Pause Code";} -if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modify Campaign List Mix";} -if ($ADD==411) {$hh='lists'; echo "Modify List";} -if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";} -if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} -if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} -if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} -if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER VICIDIAL TRUNK RECORD";} -if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} -if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} -if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} -if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} -if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORIES";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} -if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} -if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";} -if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} -if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} -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 "Delete User";} -if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} -if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} -if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Delete Lead Recycle";} -if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Delete Auto Alt Dial Status";} -if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Delete Agent Pause Code";} -if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Removed";} -if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Removed";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} -if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";} -if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} -if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} -if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER VICIDIAL TRUNK RECORD";} -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 "Dialable Lead Count";} -if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} -if ($ADD==0) {$hh='users'; echo "Users List";} -if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='lists'; echo "CallBacks Within List";} -if ($ADD==8111) {$hh='usergroups'; echo "CallBacks Within User Group";} -if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campaigns";} -if ($ADD==100) {$hh='lists'; echo "Lists";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} -if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} -if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} -if ($ADD==10000000) {$hh='filters'; echo "Filters";} -if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Call Times";} -if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "State Call Times";} -if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "PHONE LIST";} -if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "SERVER LIST";} -if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "CONFERENCE LIST";} -if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL CONFERENCE LIST";} -if ($ADD==550) {$hh='users'; echo "Search Form";} -if ($ADD==551) {$hh='users'; echo "SEARCH PHONES";} -if ($ADD==660) {$hh='users'; echo "Search Results";} -if ($ADD==661) {$hh='users'; echo "SEARCH PHONES RESULTS";} -if ($ADD==99999) {$hh='users'; echo "HELP";} -if ($ADD==999999) {$hh='reports'; echo "REPORTS";} - -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>CAMPAIGN</td><td>     RANK</td><td>     CALLS</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) - { - $stmt="SELECT campaign_rank,calls_today 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]; - } - else - {$calls_today=0; $SELECT_campaign_rank=0;} - if ( ($ADD=="4A") or ($ADD=="4B") ) - { - 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 ($ranks_to_print > 0) - { - $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; - $rslt=mysql_query($stmt, $link); - } - - $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); - } - 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-CAMPAIGNS-',$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--; - } - $RANKcampaigns_list .= "</select></td>\n"; - $RANKcampaigns_list .= "<td align=right>     $calls_today</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) ) - { - $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"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - $XFERgroups_list=''; - $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</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) - { - $stmt="SELECT group_rank,calls_today 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]; - } - 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 ($ranks_to_print > 0) - { - $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; - $rslt=mysql_query($stmt, $link); - } - 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';"; - $rslt=mysql_query($stmt, $link); - } - - $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); - } - 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++; - } - $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <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--; - } - $RANKgroups_list .= "</select></td>\n"; - $RANKgroups_list .= "<td align=right>     $calls_today</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 from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $allowed_campaigns = $row[0]; - $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); - $campaigns = explode(" ", $allowed_campaigns); - } - - $campaigns_value=''; - $campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"'; - $p=0; - while ($p<100) - { - if (eregi('ALL-CAMPAIGNS',$campaigns[$p])) - { - $campaigns_list.=" CHECKED"; - $campaigns_value .= " -ALL-CAMPAIGNS- -"; - } - $p++; - } - $campaigns_list.="> ALL-CAMPAIGNS - USERS CAN VIEW ANY CAMPAIGN</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\""; - $p=0; - while ($p<100) - { - if ($campaign_id_value == $campaigns[$p]) - { - # echo "<!-- X $p|$campaign_id_value|$campaigns[$p]| -->"; - $campaigns_list .= " CHECKED"; - $campaigns_value .= " $campaign_id_value"; - } - # echo "<!-- O $p|$campaign_id_value|$campaigns[$p]| -->"; - $p++; - } - $campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n"; - $o++; - } - if (strlen($campaigns_value)>2) {$campaigns_value .= " -";} - } - ##### END get campaigns listing for checkboxes ##### - - - if ( (strlen($ADD)==11) or (strlen($ADD)>12) ) - { - ##### 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=\"HELP\" 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 "
VICIDIAL ADMIN: HELP


\n"; - -?> -VICIDIAL_USERS TABLE

- -
-User ID - 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. - -
-
-
-Password - This field is where you put the VICIDIAL users password. Must be at least 2 characters in length. - -
-
-
-Full Name - This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length. - -
-
-
-User Level - 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. - -
-
-
-User Group - 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. - -
-
-
-Phone Login - 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. - -
-
-
-Phone Pass - 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. - -
-
-
-Hot Keys Active - This option if set to 1 allows the user to use the Hot Keys quick-dispositioning function in vicidial.php. - -
-
-
-Agent Choose Ingroups - 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. - -
-
-
-Scheduled Callbacks - 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. - -
-
-
-Agent-Only Callbacks - 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. - -
-
-
-Agent Call Manual - 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. - -
-
-
-Vicidial Recording - 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. - -
-
-
-Vicidial Transfers - 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. - -
-
-
-Closer Default Blended - This option simply defaults the Blended checkbox on a CLOSER login screen. - -
-
-
-VICIDIAL Recording Override - 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. - -
-
-
-Campaign Ranks - 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. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. 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. 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. - -
-
-
-Agent Alter Customer Data Override - 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. - -
-
-
-Alter Agent Interface Options - This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php. - -
-
-
-Delete Users - This option if set to 1 allows the user to delete other users of equal or lesser user level from the system. - -
-
-
-Delete User Groups - This option if set to 1 allows the user to delete user groups from the system. - -
-
-
-Delete Lists - This option if set to 1 allows the user to delete vicidial lists from the system. - -
-
-
-Delete Campaigns - This option if set to 1 allows the user to delete vicidial campaigns from the system. - -
-
-
-Delete In-Groups - This option if set to 1 allows the user to delete vicidial In-Groups from the system. - -
-
-
-Delete Remote Agents - This option if set to 1 allows the user to delete vicidial remote agents from the system. - -
-
-
-Load Leads - 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. - -
-
-
-Campaign Detail - This option if set to 1 allows the user to view and modify the campaign detail screen elements. - -
-
-
-AGC Admin Access - This option if set to 1 allows the user to login to the astGUIclient admin pages. - -
-
-
-AGC Delete Phones - This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages. - -
-
-
-Delete Scripts - This option if set to 1 allows the user to delete Campaign scripts in the script modification screen. - -
-
-
-Modify Leads - This option if set to 1 allows the user to modify leads in the admin section lead search results page. - -
-
-
-Change Agent Campaign - 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. - -
-
-
-Delete Filters - This option allows the user to be able to delete vicidial lead filters from the system. - -
-
-
-Delete Call Times - This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system. - -
-
-
-Modify Call Times - 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. - -
-
-
-Modify Sections - 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. - -
-
-
-View Reports - This option allows the user to view the VICIDIAL reports. - - - - -



- -VICIDIAL_CAMPAIGNS TABLE

-
-
-Campaign ID - 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 length. - -
-
-
-Campaign Name - This is the description of the campaign, it must be between 6 and 40 characters in length. - -
-
-
-Campaign Description - This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length. - -
-
-
-Campaign Change Date - This is the last time that the settings for this campaign were modified in any way. - -
-
-
-Last Campaign Login Date - This is the last time that an agent was logged into this campaign. - -
-
-
-Campaign Stats Refresh - This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active. - -
-
-
-Active - This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it. - -
-
-
-Park Extension - 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. - -
-
-
-Park File Name - 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. - -
-
-
-Web Form - This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. - -
-
-
-Allow Closers - This is where you can set whether the users of this campaign will have the option to send the call to a closer. - -
-
-
-Default Transfer Group - 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. - -
-
-
-Allowed Transfer Groups - 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. - -
-
-
-Allow Inbound and Blended - 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. - -
-
-
-Dial Status - This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below. 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. - -
-
-
-List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper: -
  - DOWN: select the first leads loaded into the vicidial_list table -
  - UP: select the last leads loaded into the vicidial_list table -
  - UP PHONE: select the highest phone number and works its way down -
  - DOWN PHONE: select the lowest phone number and works its way up -
  - UP LAST NAME: starts with last names starting with Z and works its way down -
  - DOWN LAST NAME: starts with last names starting with A and works its way up -
  - UP COUNT: starts with most called leads and works its way down -
  - DOWN COUNT: starts with least called leads and works its way up -
  - DOWN COUNT 2nd NEW: 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 -
  - DOWN COUNT 3nd NEW: 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 -
  - DOWN COUNT 4th NEW: 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 - -
-
-
-Hopper Level - 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. - -
-
-
-Lead Filter - 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. - -
-
-
-Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. - -
-
-
-Dial Method - 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. - -
-
-
-Auto Dial Level - 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. 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. - -
-
-
-Available Only Tally - 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. - -
-
-
-Drop Percentage Limit - 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. - -
-
-
-Maximum Adapt Dial Level - 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. - -
-
-
-Latest Server Time - 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. - -
-
-
-Adapt Intensity Modifier - 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. - -
-
-
-Dial Level Difference Target - 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. - -
-
-
-Concurrent Transfers - 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. - -
-
-
-Auto Alt-Number Dialing - 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. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - 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. -
  - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. -
  - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. - -
-
-
-Local Call Time - 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. - -
-
-
-Dial Timeout - 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. - -
-
-
-Dial Prefix - 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. - -
-
-
-Omit Phone Code - 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. - -
-
-
-Campaign CallerID - 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. - -
-
-
-Campaign VDAD extension - 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. - -
-
-
-Campaign Rec extension - 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. - -
-
-
-Campaign Recording - 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. - -
-
-
-Campaign Rec Filename - 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. 50 char max. - -
-
-
-Recording Delay - 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. - -
-
-
-Campaign Script - 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. - -
-
-
-Get Call Launch - 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. - -
-
-
-Answering Machine Message - 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. - -
-
-
-AMD send to vm exten - 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. - -
-
-
-Xfer-Conf DTMF - 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, 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. - -
-
-
-Agent Alt Num Dialing - This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called. - -
-
-
-Scheduled Callbacks - 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. - -
-
-
-Drop Call Seconds - 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. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Safe Harbor Message - 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. - -
-
-
-Safe Harbor Exten - This is the dial plan extension that the desired Safe Harbor audio file is located at on your server. - -
-
-
-Wrap Up Seconds - 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. - -
-
-
-Wrap Up Message - This is a campaign-specific message to be displayed on the wrap up screen if wrap up seconds is set. - -
-
-
-Use Internal DNC List - 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. - -
-
-
-Allowed Inbound Groups - 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. - -
-
-
-Agent Pause Codes Active - 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. - -
-
-
-Disable Alter Customer Data - If set to Y, does not change any of the customer data record when an agent dispositions the call. Default is N. - -
-
-
-Allow No-Hopper-Leads Logins - 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. - -
-
-
-List Order Mix - 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. - -
-
-
-List Mix ID - ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation. - -
-
-
-List Mix Name - Descriptive name of the list mix. Must be from 2-50 characters in length. - -
-
-
-List Mix Detail - 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. - -
-
-
-List Mix Method - 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. - -
-
-
-Manual Dial List ID - 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. - - - - -



- -VICIDIAL_LISTS TABLE

-
-
-List ID - 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. Must be a number greater than 100. - -
-
-
-List Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-List Description - This is the memo field for the list, it is optional. - -
-
-
-List Change Date - This is the last time that the settings for this list were modified in any way. - -
-
-
-List Last Call Date - This is the last time that lead was dialed from this list. - -
-
-
-Campaign - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Active - This defines whether the list is to be dialed on or not. - -
-
-
-Reset Lead-Called-Status for this list - 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. - -
-
-
-VICIDIAL DNC List - 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. - - - -



- -VICIDIAL_INBOUND_GROUPS TABLE

-
-
-Group ID - 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. - -
-
-
-Group Name - This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces . - -
-
-
-Group Color - 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. - -
-
-
-Active - This determines whether this group show up in the selection box when a VICIDIAL agent logs in. - -
-
-
-Web Form - 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. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - 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. -
  - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest. -
  - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. -
  - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. -
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. -
-
-
-Fronter Display - 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. - -
-
-
-Campaign Script - 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. - -
-
-
-Get Call Launch - 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. - -
-
-
-Xfer-Conf DTMF - 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, 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. - -
-
-
-Drop Call Seconds - 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. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Drop Message - 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. - -
-
-
-Drop Exten - This is the dial plan extension that the desired Dropped call audio file is located at on your server. - -
-
-
-Call Time - 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. - -
-
-
-After Hours Action - 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. - -
-
-
-After Hours Message Filename - The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye - -
-
-
-After Hours Extension - The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. - -
-
-
-After Hours Voicemail - The voicemail box to send the call to if the Action is set to VOICEMAIL. - -
-
-
-Welcome Message Filename - 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--- - -
-
-
-Music On Hold Context - The music on hold context to use when the customer is placed on hold. Default is default. - -
-
-
-On Hold Prompt Filename - 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. - -
-
-
-On Hold Prompt Interval - The length of time in seconds to wait before playing the on hold prompt. Default is 60. - -
-
-
-Agent Alert Extension - 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. - -
-
-
-Agent Alert Delay - 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. - -
-
-
-Default Transfer Group - 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. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLE

-
-
-User ID Start - 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. - -
-
-
-Number of Lines - 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. - -
-
-
-Server IP - A remote agent entry is only good for one specific server, here is where you select which server you want. - -
-
-
-External Extension - 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. - -
-
-
-Status - 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. - -
-
-
-Campaign - 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. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - - -



- -VICIDIAL_CAMPAIGN_LISTS

-
-
-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. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLE

-
-
-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. 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. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS TABLE

-
-
-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. 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. - - - - - -



- -VICIDIAL_LEAD_RECYCLE TABLE

-
-
-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. - - - - - -



- -VICIDIAL AUTO ALT DIAL STATUSES

-
-
-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. - - - - - -



- -VICIDIAL AGENT PAUSE CODES

-
-
-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. - - - - - -



- -VICIDIAL_USER_GROUPS TABLE

-
-
-User Group - 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. - -
-
-
-Group Name - This is the description of the vicidial user group max of 40 characters. - -
-
-
-Allowed Campaigns - 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. - - - - - -



- -VICIDIAL_SCRIPTS TABLE

-
-
-Script ID - 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. - -
-
-Script Name - 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. - -
-
-Script Comments - 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. - -
-
-Script Text - 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. 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--&phone=--A--phone--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> -
- -
-
-
-Active - This determines whether this script can be selected to be used by a campaign. - - - - - -



- -VICIDIAL_LEAD_FILTERS TABLE

-
-
-Filter ID - 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. - -
-
-Filter Name - This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters. - -
-
-Filter Comments - This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters. - -
-
-Filter SQL - 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 -. - - - - - -



- -VICIDIAL_CALL TIMES TABLE

-
-
-Call Time ID - 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. - -
-
-Call Time Name - 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. - -
-
-Call Time Comments - 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. - -
-
-Default Start and Stop Times - 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. - -
-
-Weekday Start and Stop Times - 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. - -
-
-State Call Time Definitions - This is the list of State specific call time definitions that are followed in this Call Time Definition. - -
-
-State Call Time State - 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. - - - - -



- -VICIDIAL LIST LOADER FUNCTIONALITY

-
-
-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: -
    -
  1. Vendor Lead Code - shows up in the Vendor ID field of the GUI -
  2. Source Code - internal use only for admins and DBAs -
  3. List ID - the list number that these leads will show up under -
  4. Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc -
  5. Phone Number - must be at least 8 digits long -
  6. Title - title of the customer - Mr. Ms. Mrs, etc... -
  7. First Name -
  8. Middle Initial -
  9. Last Name -
  10. Address Line 1 -
  11. Address Line 2 -
  12. Address Line 3 -
  13. City -
  14. State - limited to 2 characters -
  15. Province -
  16. Postal Code -
  17. Country -
  18. Gender -
  19. Date of Birth -
  20. Alternate Phone Number -
  21. Email Address -
  22. Security Phrase -
  23. Comments -
- -
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. - - - - -



- - - - - - -PHONES TABLE

-
-
-Phone extension - 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. - -
-
-
-Dial Plan Number - 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 - -
-
-
-Voicemail Box - 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. - -
-
-
-Outbound CallerID - 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. - -
-
-
-Phone IP address - This field is for the phone's IP address if it is a VOIP phone. This is an optional field - -
-
-
-Computer IP address - This field is for the user's computer IP address. This is an optional field - -
-
-
-Server IP - This menu is where you select which server the phone is active on. - -
-
-
-Login - The login used for the phone user to login to the client applications. - -
-
-
-Password - The password used for the phone user to login to the client applications. - -
-
-
-Status - 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. - -
-
-
-Active Account - Whether the phone is active to put it in the list in the GUI client. - -
-
-
-Phone Type - Purely for administrative notes. - -
-
-
-Full Name - Used by the GUIclient in the list of active phones. - -
-
-
-Company - Purely for administrative notes. - -
-
-
-Picture - Not yet Implemented. - -
-
-
-New Messages - Number of new voicemail messages for this phone on the Asterisk server. - -
-
-
-Old Messages - Number of old voicemail messages for this phone on the Asterisk server. - -
-
-
-Client Protocol - 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. - -
-
-
-Local GMT - 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. - -
-
-
-Manager Login - This is the login that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-Manager Secret - This is the password that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-VICIDIAL Default User - 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. - -
-
-
-VICIDIAL Default Pass - 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. - -
-
-
-VICIDIAL Default Campaign - 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. - -
-
-
-Park Exten - This is the default Parking extension for the client apps. Verify that a different one works before you change this. - -
-
-
-Conf Exten - This is the default Conference park extension for the client apps. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park Exten - This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park File - 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. - -
-
-
-Monitor Prefix - 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. - -
-
-
-Recording Exten - 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. - -
-
-
-VMAIL Main Exten - This is the dial plan extension going to check your voicemail. verify with extensions.conf file before changing. - -
-
-
-VMAIL Dump Exten - 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. - -
-
-
-Exten Context - 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. - -
-
-
-DTMF send Channel - 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. - -
-
-
-Outbound Call Group - 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. - -
-
-
-Browser Location - 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. - -
-
-
-Install Directory - 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. - -
-
-
-CallerID URL - 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 - -
-
-
-VICIDIAL Default URL - 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 - -
-
-
-Call Logging - 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. - -
-
-
-User Switching - 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 - -
-
-
-Conferencing - Set to true to allow user to start conference calls with upto six external lines. - -
-
-
-Admin Hang Up - 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. - -
-
-
-Admin Hijack - 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. - -
-
-
-Admin Monitor - 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. - -
-
-
-Call Park - 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. - -
-
-
-Updater Check - Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users. - -
-
-
-AF Logging - Set to true to log many actions of astGUIclient usage to a text file on the user's computer. - -
-
-
-Queue Enabled - Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users. - -
-
-
-CallerID Popup - Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users. - -
-
-
-VMail Button - Set to true to display the VOICEMAIL button and the messages count display on astGUIclient. - -
-
-
-Fast Refresh - 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. - -
-
-
-Fast Refresh Rate - 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. - -
-
-
-Persistant MySQL - 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. - -
-
-
-Auto Dial Next Number - 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. - -
-
-
-Stop Rec after each call - 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. - -
-
-
-Enable SIPSAK Messages - 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. - -
-
-
-DBX Server - The MySQL database server that this user should be connecting to. - -
-
-
-DBX Database - The MySQL database that this user should be connecting to. Default is asterisk. - -
-
-
-DBX User - The MySQL user login that this user should be using when connecting. Default is cron. - -
-
-
-DBX Pass - The MySQL user password that this user should be using when connecting. Default is 1234. - -
-
-
-DBX Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. - -
-
-
-DBY Server - The MySQL database server that this user should be connecting to. Secondary server, not used currently. - -
-
-
-DBY Database - The MySQL database that this user should be connecting to. Default is asterisk. Secondary server, not used currently. - -
-
-
-DBY User - The MySQL user login that this user should be using when connecting. Default is cron. Secondary server, not used currently. - -
-
-
-DBY Pass - The MySQL user password that this user should be using when connecting. Default is 1234. Secondary server, not used currently. - -
-
-
-DBY Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. Secondary server, not used currently. - - -



- -SERVERS TABLE

-
-
-Server ID - 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. - -
-
-
-Server Description - The field where you use a small phrase to describe the Asterisk server. - -
-
-
-Server IP Address - The field where you put the Network IP address of the Asterisk server. - -
-
-
-Active - Set whether the Asterisk server is active or inactive. - -
-
-
-Asterisk Version - 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. - -
-
-
-Max VICIDIAL Trunks - 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. - -
-
-
-Telnet Host - 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. - -
-
-
-Telnet Port - 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. - -
-
-
-Manager User - The username or login used to connect genericly to the Asterisk server manager. Default is 'cron' - -
-
-
-Manager Secret - The secret or password used to connect genericly to the Asterisk server manager. Default is '1234' - -
-
-
-Manager Update User - 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. - -
-
-
-Manager Listen User - 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. - -
-
-
-Manager Send User - 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. - -
-
-
-Server GMT offset - The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5' - -
-
-
-VMail Dump Exten - The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666' - -
-
-
-VICIDIAL AD extension - The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365' - -
-
-
-Default Context - The default dial plan context used for scripts that operate for this server. Default is 'default' - -
-
-
-System Performance - 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. - -
-
-
-Server Logs - 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. - -
-
-
-AGI Output - 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. - -
-
-
-VICIDIAL Balance Dialing - 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. - -
-
-
-VICIDIAL Balance Offlimits - 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. - - -



- -CONFERENCES TABLE

-
-
-Conference Number - 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. - -
-
-
-Server IP - The menu where you select the Asterisk server that this conference will be on. - - - - -



- -VICIDIAL_SERVER_TRUNKS TABLE

-
-
-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. - - - - - -



- -SYSTEM_SETTINGS TABLE

-
-
-Use Non-Latin - 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. - -
-
-
-Webroot Writable - 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. - -
-
-
-Enable QueueMetrics Logging - 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. - -
-
-
-QueueMetrics Server IP - This is the IP address of the database for your QueueMetrics installation. - -
-
-
-QueueMetrics Database Name - This is the database name for your QueueMetrics database. - -
-
-
-QueueMetrics Database Login - This is the user name used to log in to your QueueMetrics database. - -
-
-
-QueueMetrics Database Password - This is the password used to log in to your QueueMetrics database. - -
-
-
-QueueMetrics URL - This is the URL or web site address used to get to your QueueMetrics installation. - -
-
-
-QueueMetrics Log ID - This is the server ID that all VICIDIAL logs going into the QueueMetrics database will use as an identifier for each record. - -
-
-
-QueueMetrics EnterQueue Prepend - 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. - -
-
-
-VICIDIAL Agent Disable Display - 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. - -
-
-
-Allow SIPSAK Messages - 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. - -
-
-
-Admin Home URL - 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. - -
-
-
-Enable Agent Transfer Logfile - This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled. - - - - - -



- -VICIDIAL_STATUSES TABLE

-
-
-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. - - -



- -VICIDIAL_STATUS_CATEGORIES TABLE

-
-
-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. - - - - -







-







-THE END -
-\n"; - echo "\n"; - echo "\n"; - echo ""; - - $stmt="SELECT dial_statuses,local_call_time,lead_filter_id 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]; - 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 = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - - echo "

\n"; - echo "Show Dialable Leads Count -

\n"; - echo "CAMPAIGN: $campaign_id
\n"; - echo "LISTS: $camp_lists
\n"; - echo "STATUSES: $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,$fSQL); - - echo "

\n"; - echo "\n"; - - exit; - } - else - { - echo "You do not have permission to view this page\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 = '3125551212'; - $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'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $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); - } - -$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("\n","
",$script_text); - - -echo ""; - -echo "Preview Script: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') - {$users_hh="bgcolor =\"$users_color\""; $users_fc="$users_font"; $users_bold="$header_selected_bold";} - else {$users_hh=''; $users_fc='WHITE'; $users_bold="$header_nonselected_bold";} -if ($hh=='campaigns') - {$campaigns_hh="bgcolor=\"$campaigns_color\""; $campaigns_fc="$campaigns_font"; $campaigns_bold="$header_selected_bold";} - else {$campaigns_hh=''; $campaigns_fc='WHITE'; $campaigns_bold="$header_nonselected_bold";} -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 ($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"; - -$stmt="SELECT admin_home_url from system_settings;"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; - -?> -
- BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> - - - - - - - - - - - - - - - 1) { - ?> -> - 1) - { - -# if ($sh=='basic') {$basic_sh="bgcolor=\"$subcamp_color\""; $basic_fc="$subcamp_font";} -# else {$basic_sh=''; $basic_fc='BLACK';} -# if ($sh=='detail') {$detail_sh="bgcolor=\"$subcamp_color\""; $detail_fc="$subcamp_font";} -# else {$detail_sh=''; $detail_fc='BLACK';} -# if ($sh=='dialstat') {$dialstat_sh="bgcolor=\"$subcamp_color\""; $dialstat_fc="$subcamp_font";} -# else {$dialstat_sh=''; $dialstat_fc='BLACK';} - - 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';} - - ?> -> - - - - - - - - - 1) { - ?> - > - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # hard teal - else {$times_sh=''; $times_fc='BLACK';} - if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink - else {$phones_sh=''; $phones_fc='BLACK';} - if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink - else {$server_sh=''; $server_fc='BLACK';} - if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink - else {$conference_sh=''; $conference_fc='BLACK';} - if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink - else {$settings_sh=''; $settings_fc='BLACK';} - if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink - else {$status_sh=''; $status_fc='BLACK';} - - ?> -> - - - - - - - - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - \n"; - echo "You are not authorized to view this page. Please go back.\n"; - } - -} -if (strlen($reports_hh) > 1) { - ?> -> - - - - -
  VICIDIAL ADMIN - HOME | Logout  
> SIZE=> Users > SIZE=> Campaigns > SIZE=> Lists > SIZE=> Scripts > SIZE=> Filters > SIZE=> In-Groups > SIZE=> User Groups > SIZE=> Remote Agents > SIZE=> Admin > SIZE=> Reports
>   > Show Users     |     > Add A New User     |     > Copy User     |     > Search For A User
COLSPAN=2> SIZE=> Campaigns Main COLSPAN=1> SIZE=> Statuses COLSPAN=1> SIZE=> HotKeys COLSPAN=2> SIZE=> Lead Recycle COLSPAN=1> SIZE=> Auto-Alt Dial COLSPAN=1> SIZE=> Pause Codes COLSPAN=2> SIZE=> List Mix
>   > Show Campaigns     |     > Add A New Campaign     |     > Copy Campaign     |     > Real-Time Campaigns Summary
>   > Show Lists     |     > Add A New List     |     > Search For A Lead     |     > Add Number To DNC     |     > Load New Leads
>   > Show Scripts     |     > Add A New Script
>   > Show Filters     |     > Add A New Filter
>   > Show In-Groups     |     > Add A New In-Group     |     > Copy In-Group
>   > Show User Groups     |     > Add A New User Group     |     > Group Hourly Report
>   > Show Remote Agents     |     > Add New Remote Agents
COLSPAN=2> SIZE=> Call Times COLSPAN=2> SIZE=> Phones COLSPAN=2> SIZE=> Conferences COLSPAN=1> SIZE=> Servers COLSPAN=1> SIZE=> System Settings COLSPAN=2> SIZE=> System Statuses
>   > Show Call Times     |     > Add A New Call Time     |     > Show State Call Times     |     > Add A New State Call Time  
>   > Show Phones   |   > Add A New Phone
> Show Conferences   |   > Add A New Conference   |   > Show VICIDIAL Conferences   |   > Add A New VICIDIAL Conference
> Show Servers   |   > Add A New Server
> System Settings
> System Statuses   |   > Status Categories
>  
-
\n"; - echo ""; - - echo "
ADD A NEW USER
\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group:
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=1 display the COPY USER FORM SCREEN -###################### - -if ($ADD=="1A") -{ - if ($LOGmodify_users==1) - { - echo "
\n"; - echo ""; - - echo "
COPY USER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} - - echo "\n"; - echo "\n"; - echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
Source User: $NWB#vicidial_users-user$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ - if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW CAMPAIGN\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Campaign Description: $NWB#vicidial_campaigns-campaign_description$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=12 display the COPY CAMPAIGN FORM SCREEN -###################### - -if ($ADD==12) -{ - if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; - - echo "
COPY A CAMPAIGN\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Source Campaign: $NWB#vicidial_campaigns-campaign_id$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ - if ($LOGmodify_lists==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW LIST\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
ADD A NUMBER TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ - if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW INBOUND GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=1211 display the COPY INBOUND GROUP SCREEN -###################### - -if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; - - echo "
COPY INBOUND GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Source Group ID: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ - if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW REMOTE AGENTS\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ - if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW USERS GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ - if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ - if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW FILTER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ - if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW CALL TIME\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ - if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; - - echo "
ADD NEW STATE CALL TIME\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=11111111111 display the ADD NEW PHONE SCREEN -###################### - -if ($ADD==11111111111) -{ - if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW PHONE\n"; - echo "\n"; - echo "
\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=111111111111 display the ADD NEW SERVER SCREEN -###################### - -if ($ADD==111111111111) -{ - if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW SERVER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=1111111111111 display the ADD NEW CONFERENCE SCREEN -###################### - -if ($ADD==1111111111111) -{ - if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; - - echo "
ADD A NEW CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\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 "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - } - else - { - echo "You do not have permission to view this page\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") -{ - 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 "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - echo "
USER ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } - -$ADD=3; -} - -###################### -# ADD=2A adds the copied new user to the system -###################### - -if ($ADD=="2A") -{ - 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 "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - $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) 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 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); - - echo "
USER COPIED: $user copied from $source_user_id\n"; - echo "

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

\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A COPIED USER |$PHP_AUTH_USER|$ip|$user|$source_user_id|$stmt|\n"); - fclose($fp); - } - } - } -exit; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - 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 "
CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\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 "
CAMPAIGN 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 "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
campaign name must be between 6 and 40 characters in length\n"; - } - else - { - echo "
CAMPAIGN ADDED: $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) 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); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } - } -$ADD=31; -} - -###################### -# ADD=20 adds copied new campaign to the system -###################### - -if ($ADD==20) -{ - - 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 "
CAMPAIGN NOT ADDED - there is already a campaign 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 "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
source campaign ID must be between 2 and 8 characters in length\n"; - } - else - { - echo "
CAMPAIGN 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,safe_harbor_message,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) 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,safe_harbor_message,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 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) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category 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); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY TO NEW CAMPAIGN|$PHP_AUTH_USER|$ip|$campaign_id|$source_campaign_id|$stmt|$stmtA|\n"); - fclose($fp); - } - - } - } -$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';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$category');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } -$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 "
CAMPAIGN 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 "
CAMPAIGN HOT KEY NOT ADDED - Please go back and look at the data you entered\n"; - echo "
hotkey must be a single character between 1 and 9 \n"; - echo "
status must be between 1 and 8 characters in length\n"; - } - else - { - echo "
CAMPAIGN HOT KEY ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN HOT KEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$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 "
CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$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 "
AUTO ALT DIAL STATUS NOT ADDED - there is already an entry for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
AUTO ALT DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - } - else - { - echo "
AUTO ALT DIAL STATUS ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A AUTO-ALT-DIAL STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$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 "
AGENT PAUSE CODE NOT ADDED - there is already an entry for this campaign with this pause code\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) ) - { - echo "
AGENT PAUSE CODE NOT ADDED - Please go back and look at the data you entered\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - echo "
pause code name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
AGENT PAUSE CODE ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW AGENT PAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$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 "
CAMPAIGN DIAL STATUS NOT ADDED - there is already an entry for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN DIAL STATUS ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD CAMPAIGN DIAL STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -#$SUB=28; -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - 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 "
LIST NOT ADDED - there is already a list in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or ($list_id < 100) or (strlen($list_id) > 8) ) - { - echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; - echo "
List ID must be between 2 and 8 characters in length\n"; - echo "
List name must be at least 2 characters in length\n"; - echo "
List ID must be greater than 100\n"; - } - else - { - echo "
LIST ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - 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 "
GROUP NOT ADDED - there is already a group in the system with this ID\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 "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\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) 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); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } -$ADD=3111; -} - - -###################### -# ADD=2011 adds copied inbound group to the system -###################### - -if ($ADD==2011) -{ - 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 "
GROUP NOT ADDED - there is already a group 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 "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\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_message,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) 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_message,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; - $rslt=mysql_query($stmt, $link); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPIED TO NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111; -} - - -###################### -# 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 "
REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
User ID start and external extension must be at least 2 characters in length\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 "
REMOTE AGENTS ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - 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 "
USER GROUP NOT ADDED - there is already a user group entry with this name\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP ADDED: $user_group\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - 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 NOT ADDED - there is already a script entry with this name\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','$script_text','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT ADDED: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - 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 "
FILTER NOT ADDED - there is already a filter entry with this ID\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\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='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER ADDED: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$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 "
CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\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); - - echo "
CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$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 "
STATE CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\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); - - echo "
STATE CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - -###################### -# ADD=21111111111 adds new phone to the system -###################### - -if ($ADD==21111111111) -{ -echo "
\n"; - 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 "
PHONE NOT ADDED - there is already a Phone in the system with this extension/server\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 "
PHONE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE ADDED\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); - } - } -$ADD=31111111111; -} - - -###################### -# ADD=211111111111 adds new server to the system -###################### - -if ($ADD==211111111111) -{ -echo "
\n"; - 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 "
SERVER NOT ADDED - there is already a server in the system with this ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER ADDED\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); - } - } -$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 "
VICIDIAL SERVER TRUNK RECORD NOT ADDED - the number of vicidial trunks is too high: $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 "
VICIDIAL SERVER TRUNK RECORD NOT ADDED - there is already a server-trunk record for this campaign\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) ) - { - echo "
VICIDIAL SERVER TRUNK RECORD NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign must be between 3 and 8 characters in length\n"; - echo "
server_ip delay must be at least 7 characters\n"; - echo "
trunks must be a digit from 0 to 9999\n"; - } - else - { - echo "
VICIDIAL SERVER TRUNK RECORD ADDED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW VICIDIAL TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } -$ADD=311111111111; -} - - -###################### -# ADD=2111111111111 adds new conference to the system -###################### - -if ($ADD==2111111111111) -{ -echo "
\n"; - 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 "
CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE ADDED\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 "
\n"; - 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 CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
VICIDIAL CONFERENCE ADDED\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';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SYSTEM STATUS NOT ADDED - 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';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SYSTEM STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
SYSTEM STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
SYSTEM STATUS ADDED: $status_name - $status\n"; - - $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$category');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } -$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 "
STATUS CATEGORY NOT ADDED - there is already a status category in the system with this ID: $row[0]\n";} - else - { - if ( (strlen($vsc_id) < 2) or (strlen($vsc_id) > 20) or (strlen($vsc_name) < 2) ) - { - echo "
STATUS CATEGORY NOT ADDED - Please go back and look at the data you entered\n"; - echo "
ID must be between 2 and 20 characters in length\n"; - echo "
name name must be between 2 and 50 characters in length\n"; - } - else - { - echo "
STATUS CATEGORY 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 "
ERROR: There are already 4 Status Categories set to TimeOnVDAD Display\n"; - } - - $stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATUS CATEGORY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=331111111111111; -} - - - -###################################################################################################### -###################################################################################################### -####### 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 "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - 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' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - 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' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED: $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' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - echo "
|$campaign_name|$active|\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - if ($dial_method == 'MANUAL') - { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; - } - 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',safe_harbor_message='$safe_harbor_message',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' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - } - else - { - if (ereg('delete',$stage)) - { - echo "
CUSTOM CAMPAIGN STATUS DELETED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } - } - if (ereg('modify',$stage)) - { - echo "
CUSTOM CAMPAIGN STATUS MODIFIED: $campaign_id - $status\n"; - - $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\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 "
CAMPAIGN HOT KEY NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - echo "
the campaign hotkey needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN HOT KEY DELETED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $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); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
AGENT PAUSE CODE NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
pause_code must be between 1 and 6 characters in length\n"; - echo "
pause_code name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
AGENT 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$SUB=27; -$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 "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX MODIFIED: $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 "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX MODIFIED: $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 "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\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 "
LIST MIX NOT MODIFIED: You cannot delete the last list_id entry from a list mix\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX MODIFIED: $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 "
LIST MIX NOT ADDED - Please go back and look at the data you entered\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 "
LIST MIX NOT ADDED - There is already a list mix with this ID in the system\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX ADDED: $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 "
LIST MIX NOT DELETED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX DELETED: $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 "
LIST MIX NOT ACTIVATED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - echo "
LIST MIX ACTIVATED: $campaign_id - $vcl_id - $vcl_name\n"; - } - } - } - else - { - echo "You do not have permission to view this page\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 "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
list name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST MODIFIED: $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' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
RESETTING LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description' where list_id='$list_id'|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
group name and group color must be at least 2 characters in length\n"; - } - else - { - echo "
GROUP MODIFIED: $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_message='$drop_message',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' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=3111; # go to in-group 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 "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
User ID Start and External Extension must be at least 2 characters in length\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 "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|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'|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='$script_text', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\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 "
CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\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 "
STATE CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=3111111111; # go to state call time 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 "
PHONE NOT MODIFIED - there is already a Phone in the system with this extension/server\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 "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE MODIFIED: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . 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' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=31111111111; # go to phone 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 "
SERVER 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 "
SERVER NOT MODIFIED - there is already a server in the system with this server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER MODIFIED: $server_ip\n"; - - $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' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - } - else - { - echo "You do not have permission to view this page\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 "
VICIDIAL SERVER TRUNK RECORD NOT ADDED - the number of vicidial trunks is too high: $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 "
VICIDIAL SERVER TRUNK RECORD NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
campaign must be between 3 and 8 characters in length\n"; - echo "
server_ip delay must be at least 7 characters\n"; - echo "
trunks must be a digit from 0 to 9999\n"; - } - else - { - echo "
VICIDIAL SERVER TRUNK RECORD MODIFIED: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\n"; - - $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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SERVER TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=311111111111; # go to server 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 "
CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE MODIFIED: $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 "You do not have permission to view this page\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 CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
VICIDIAL CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
VICIDIAL CONFERENCE MODIFIED: $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 "You do not have permission to view this page\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 "
VICIDIAL SYSTEM SETTINGS MODIFIED\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';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM SETTINGS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - else - { - echo "You do not have permission to view this page\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 "
SYSTEM STATUS NOT DELETED - Please go back and look at the data you entered\n"; - echo "
the system status cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; - echo "
the system status needs to be at least 1 characters in length\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } - } - } - if (ereg('modify',$stage)) - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
SYSTEM STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the system status needs to be at least 1 characters in length\n"; - echo "
the system status name needs to be at least 1 characters in length\n"; - } - else - { - echo "
SYSTEM STATUS MODIFIED: $status\n"; - - $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\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 "
STATUS CATEGORY NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the status category cannot be a reserved category: UNDEFINED\n"; - echo "
the status category needs to be at least 2 characters in length\n"; - } - else - { - if (ereg('delete',$stage)) - { - echo "
STATUS CATEGORY DELETED: $vsc_id\n"; - - $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - if (ereg('modify',$stage)) - { - echo "
STATUS CATEGORY MODIFIED: $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 "
ERROR: There are already 4 Status Categories set to TimeOnVDAD Display\n"; - } - - $stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display' where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=331111111111111; # go to system settings 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 "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
USER DELETION CONFIRMATION: $user\n"; - echo "

Click here to delete user $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 "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
CAMPAIGN DELETION CONFIRMATION: $campaign_id\n"; - echo "

Click here to delete campaign $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 "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
AGENT LOGOUT CONFIRMATION: $campaign_id\n"; - echo "

Click here to log all agents out of $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 NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
VDAC CLEAR CONFIRMATION: $campaign_id\n"; - echo "

Click here to delete the oldest LIVE record in VDAC for $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 "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
LIST DELETION CONFIRMATION: $list_id\n"; - echo "

Click here to delete list and all of its leads $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 "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
IN-GROUP DELETION CONFIRMATION: $group_id\n"; - echo "

Click here to delete in-group $group_id


\n"; - } - -$ADD='3111'; # go to in-group 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 "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id\n"; - echo "

Click here to delete remote agent $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 "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
USER GROUP DELETION CONFIRMATION: $user_group\n"; - echo "

Click here to delete user group $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 NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
SCRIPT DELETION CONFIRMATION: $script_id\n"; - echo "

Click here to delete 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 "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Click here to delete filter $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 "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete call 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 "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
STATE CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state 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 "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
PHONE DELETION CONFIRMATION: $extension - $server_ip\n"; - echo "

Click here to delete phone $extension - $server_ip


\n"; - } -$ADD='31111111111'; # go to phone 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 "
SERVER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Server ID be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
SERVER DELETION CONFIRMATION: $server_id - $server_ip\n"; - echo "

Click here to delete phone $server_id - $server_ip


\n"; - } -$ADD='311111111111'; # go to server 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 - Please go back and look at the data you entered\n"; - echo "
Conference must be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; - echo "

Click here to delete phone $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 - Please go back and look at the data you entered\n"; - echo "
Conference must be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
VICIDIAL CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; - echo "

Click here to delete phone $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 "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|$user|$stmtA|$stmt|\n"); - fclose($fp); - } - echo "
USER DELETION COMPLETED: $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 "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $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 "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
CAMPAIGN DELETION COMPLETED: $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 "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENT LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
AGENT LOGOUT COMPLETED: $campaign_id\n"; - echo "

\n"; - } - } - else - { - echo "You do not have permission to view this page\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 NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|EMERGENCY VDAC CLEAR|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
LAST VDAC RECORD CLEARED FOR CAMPAIGN: $campaign_id\n"; - echo "

\n"; - } - } - else - { - echo "You do not have permission to view this page\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 "
CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE DELETED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
AUTO ALT DIAL STATUS NOT DELETED - this auto alt dial status is not in this campaign\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
AUTO ALT DIAL STATUS NOT DELETED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - } - else - { - echo "
AUTO ALT DIAL STATUS DELETED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AUTALTDIALSTTUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\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 "
CAMPAIGN PAUSE CODE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\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 "
CAMPAIGN DIAL STATUS NOT REMOVED - this dial status is not selected for this campaign\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN DIAL STATUS NOT REMOVED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN DIAL STATUS REMOVED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DIAL STATUS REMOVED |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } - else - { - echo "You do not have permission to view this page\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 "
LIST NOT DELETED - Please go back and look at the data you entered\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 "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LIST DELETION COMPLETED: $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 "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
IN-GROUP DELETION COMPLETED: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group 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 "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
REMOTE AGENT DELETION COMPLETED: $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 "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
USER GROUP DELETION COMPLETED: $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 NOT DELETED - Please go back and look at the data you entered\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
SCRIPT DELETION COMPLETED: $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 "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
FILTER DELETION COMPLETED: $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 "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
CALL TIME DELETION COMPLETED: $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 "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $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 "State Rule Removed: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
STATE CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times 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 "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP 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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
PHONE DELETION COMPLETED: $extension - $server_ip\n"; - echo "

\n"; - } -$ADD='10000000000'; # go to phone 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 "
SERVER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Server ID be at least 2 characters in length\n"; - echo "
Server IP 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING SERVER!!|$PHP_AUTH_USER|$ip|server_id='$server_id'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
SERVER 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 "
VICIDIAL SERVER TRUNK RECORD NOT DELETED - Please go back and look at the data you entered\n"; - echo "
campaign must be between 3 and 8 characters in length\n"; - echo "
server_ip delay must be at least 7 characters\n"; - } - else - { - echo "
VICIDIAL SERVER TRUNK RECORD DELETED: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SERVER TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -$ADD=311111111111; # go to server modification form below -} - - -###################### -# 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 - Please go back and look at the data you entered\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
Server IP 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } - 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 - Please go back and look at the data you entered\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
Server IP 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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } - 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 * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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]; - - if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
You do not have permissions to modify this user: $row[1]\n"; - } - else - { - echo "
MODIFY A USERS RECORD: $row[1]\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"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "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 ($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"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
User Number: $row[1]$NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
AGENT INTERFACE OPTIONS:
Agent Choose Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
Hot Keys Active: $NWB#vicidial_users-hotkeys_active$NWE
Scheduled Callbacks: $NWB#vicidial_users-scheduled_callbacks$NWE
Agent-Only Callbacks: $NWB#vicidial_users-agentonly_callbacks$NWE
Agent Call Manual: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Recording: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Transfers: $NWB#vicidial_users-vicidial_transfers$NWE
Closer Default Blended: $NWB#vicidial_users-closer_default_blended$NWE
VICIDIAL Recording Override: $NWB#vicidial_users-vicidial_recording_override$NWE
Agent Alter Customer Data Override: $NWB#vicidial_users-alter_custdata_override$NWE
Campaign Ranks: $NWB#vicidial_users-campaign_ranks$NWE
\n"; - echo "\n"; - echo "$RANKcampaigns_list"; - echo "
\n"; - echo "
Inbound Groups: $NWB#vicidial_users-closer_campaigns$NWE
\n"; - echo "\n"; - echo "$RANKgroups_list"; - echo "
\n"; - echo "
ADMIN INTERFACE OPTIONS:
View Reports: $NWB#vicidial_users-view_reports$NWE
Alter Agent Interface Options: $NWB#vicidial_users-alter_agent_interface_options$NWE
Modify Users: $NWB#vicidial_users-modify_sections$NWE
Change Agent Campaign: $NWB#vicidial_users-change_agent_campaign$NWE
Delete Users: $NWB#vicidial_users-delete_users$NWE
Modify User Groups: $NWB#vicidial_users-modify_sections$NWE
Delete User Groups: $NWB#vicidial_users-delete_user_groups$NWE
Modify Lists: $NWB#vicidial_users-modify_sections$NWE
Delete Lists: $NWB#vicidial_users-delete_lists$NWE
Load Leads: $NWB#vicidial_users-load_leads$NWE
Modify Leads: $NWB#vicidial_users-modify_leads$NWE
Modify Campaigns: $NWB#vicidial_users-modify_sections$NWE
Campaign Detail: $NWB#vicidial_users-campaign_detail$NWE
Delete Campaigns: $NWB#vicidial_users-delete_campaigns$NWE
Modify In-Groups: $NWB#vicidial_users-modify_sections$NWE
Delete In-Groups: $NWB#vicidial_users-delete_ingroups$NWE
Modify Remote Agents: $NWB#vicidial_users-modify_sections$NWE
Delete Remote Agents: $NWB#vicidial_users-delete_remote_agents$NWE
Modify Scripts: $NWB#vicidial_users-modify_sections$NWE
Delete Scripts: $NWB#vicidial_users-delete_scripts$NWE
Modify Filters: $NWB#vicidial_users-modify_sections$NWE
Delete Filters: $NWB#vicidial_users-delete_filters$NWE
AGC Admin Access: $NWB#vicidial_users-ast_admin_access$NWE
AGC Delete Phones: $NWB#vicidial_users-ast_delete_phones$NWE
Modify Call Times: $NWB#vicidial_users-modify_call_times$NWE
Delete Call Times: $NWB#vicidial_users-delete_call_times$NWE
Modify Servers: $NWB#vicidial_users-modify_sections$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

DELETE THIS USER\n"; - } - echo "

Click here for user time sheet\n"; - echo "

Click here for user status\n"; - echo "

Click here for user stats\n"; - echo "

Click here for user CallBack Holds\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$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 * 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]; - $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]; - $safe_harbor_message = $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]; - - 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++; - } - } - - ##### get status listings for dynamic pulldown - $stmt="SELECT * from vicidial_statuses order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $statuses_list .= "\n"; - $statname_list["$rowx[0]"] = "$rowx[1]"; - $LRstatuses_list .= "\n"; - if (eregi("Y",$rowx[2])) - {$HKstatuses_list .= "\n";} - $o++; - } - - $stmt="SELECT * 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"; - $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); - - ##### get in-groups listings for dynamic 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==29) {$camp_listmix_color=$subcamp_color;} - else {$camp_listmix_color=$campaigns_color;} - echo "\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "
$row[0]: Basic Detail StatusesHotKeysLead RecyclingAuto Alt DialPause CodesList Mix Real-Time
\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"; - echo "\n"; - - $o=0; - while ($Ds_to_print > $o) - { - $o++; - $Dstatus = $Dstatuses[$o]; - - echo "\n"; - } - else - { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE\n"; - } - } - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - - - echo "\n"; - - echo "\n"; - - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - 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 ($campaign_allow_inbound == 'Y') - { - echo "\n"; - } - - echo "\n"; - - if ($allow_closers == 'Y') - { - echo "\n"; - } - - echo "\n"; - echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Campaign Description: $NWB#vicidial_campaigns-campaign_description$NWE
Campaign Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaign Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Allow Inbound and Blended: $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Dial Status $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
List Order: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPT OVERRIDE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 digits only $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Concurrent Transfers: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Auto Alt-Number Dialing: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
Answering Machine Message: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD Send to VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alt Number Dialing: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Scheduled Callbacks: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Drop Call Seconds: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Use Safe Harbor Message: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Safe Harbor Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Wrap Up Seconds: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Wrap Up Message: $NWB#vicidial_campaigns-wrapup_message$NWE
Use Internal DNC List: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Agent Pause Codes Active: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campaign Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Disable Alter Customer Data: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
Allow No-Hopper-Leads Logins: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Manual Dial List ID: $NWB#vicidial_campaigns-manual_dial_list_id$NWE
Allowed Inbound Groups:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
Default Transfer Group: $NWB#vicidial_campaigns-default_xfer_group$NWE
Allowed Transfer Groups:
"; - echo " $NWB#vicidial_campaigns-xfer_groups$NWE
\n"; - echo "$XFERgroups_list"; - echo "
\n"; - - echo "
\n"; - echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $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])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\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,$fSQL); - echo " - HIDE

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - - - $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 "This campaign has $hopper_leads leads in the dial hopper

\n"; - echo "Click here to see what leads are in the hopper right now

\n"; - echo "Click here to see all CallBack Holds in this campaign

\n"; - echo "Click here to see a VDAD report for this campaign

\n"; - echo "
\n"; - } - - - - 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 "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_statuses$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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 "
STATUSDESCRIPTIONSELECTABLEHUMAN ANSWERDELETE
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "$rowx[0]
\n"; - echo "\n"; - echo "         \n"; - echo "   \n"; - echo "DELETE\n"; - echo "
\n"; - - echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; - echo "\n"; - echo "\n"; - echo "Status:   \n"; - echo "Description:   \n"; - echo "Selectable:   \n"; - echo "Human Answer:   \n"; - echo "Category: \n"; - echo "  
\n"; - echo "
\n"; - - echo "

\n"; - } - - - if ($SUB==23) - { - echo "
CUSTOM HOT KEYS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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 "
HOT KEYSTATUSDESCRIPTIONDELETE
$rowx[1]$rowx[0]$rowx[2]DELETE
\n"; - - echo "
ADD NEW CUSTOM CAMPAIGN HOT KEY
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Hotkey:   \n"; - echo "Status:   \n"; - echo "
\n"; - echo "

\n"; - } - - - if ($SUB==25) - { - echo "

LEAD RECYCLING WITHIN THIS CAMPAIGN:   $NWB#vicidial_lead_recycle$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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); - $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 "
STATUSATTEMPT DELAYATTEMPT MAXIMUMACTIVE DELETE
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
DELETE
\n"; - - echo "
ADD NEW CAMPAIGN LEAD RECYCLE
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Status:   \n"; - echo "Attempt Delay: \n"; - echo "Attempt Maximum: \n"; - echo "
\n"; - - echo "

\n"; - } - - - if ($SUB==26) - { - echo "

AUTO ALT NUMBER DIALING FOR THIS CAMPAIGN:   $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 "
STATUSESDELETE
$AADstatuses[$o]DELETE
\n"; - - echo "
ADD NEW AUTO ALT NUMBER DIALING STATUS
\n"; - echo "\n"; - echo "\n"; - echo "Status:   \n"; - echo "
\n"; - - echo "

\n"; - } - - - if ($SUB==27) - { - echo "

AGENT PAUSE CODES FOR THIS CAMPAIGN:   $NWB#vicidial_pause_codes$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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 "
PAUSE CODESBILLABLEMODIFYDELETE
$rowx[0]\n"; - echo "\n"; - echo "\n"; - echo "  \n"; - echo "
DELETE
\n"; - - echo "
ADD NEW AGENT PAUSE CODE
\n"; - echo "\n"; - echo "\n"; - echo "Pause Code: \n"; - echo "Pause Code Name: \n"; - echo "   Billable: \n"; - echo "
\n"; - - echo "

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

\n"; - echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

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

DELETE THIS CAMPAIGN\n"; - } - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$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 * 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]; - - if (ereg("DISABLED",$list_order_mix)) - {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} - else - {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} - - $stmt="SELECT * from vicidial_statuses order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $statuses_list=''; - - $o=0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $statuses_list .= "\n"; - $statname_list["$rowx[0]"] = "$rowx[1]"; - $LRstatuses_list .= "\n"; - if (eregi("Y",$rowx[2])) - {$HKstatuses_list .= "\n";} - $o++; - } - - $stmt="SELECT * 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"; - $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 ""; - echo ""; - echo "\n"; - echo "\n"; - echo "
$row[0]: Basic View Detail View List Mix Real-Time Screen  
\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"; - echo "\n"; - - $o=0; - while ($Ds_to_print > $o) - { - $o++; - $Dstatus = $Dstatuses[$o]; - - echo "\n"; - } - else - { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE\n"; - } - } - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Campaign Description: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campaign Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaign Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Default Transfer Group: $default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Allow Inbound and Blended: $campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Dial Status $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
List Order: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Get Call Launch: $get_call_launch
\n"; - - echo "
\n"; - echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $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])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - - echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\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,$fSQL); - echo " - HIDE

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - $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 "This campaign has $hopper_leads leads in the dial hopper

\n"; - echo "Click here to see what leads are in the hopper right now

\n"; - echo "Click here to see all CallBack Holds in this campaign

\n"; - echo "Click here to see a VDAD report for this campaign

\n"; - echo "
\n"; - - echo "
\n"; - - ### list of agent rank or skill-level for this campaign - echo "
\n"; - echo "
AGENT RANKS FOR THIS CAMPAIGN:
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT user,campaign_rank,calls_today from vicidial_campaign_agents where campaign_id='$campaign_id'"; - $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[1]$rowx[2]

\n"; - - - echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

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

DELETE THIS CAMPAIGN\n"; - } - } - } - else - { - echo "You do not have permission to view this page\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-CAMPAIGNS",$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) - { - 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 "

LIST MIXES FOR THIS CAMPAIGN:   $NWB#vicidial_campaigns-list_order_mix$NWE
\n"; - - echo "

Experimental Feature in development!!! NON-FUNCTIONAL
\n"; - - - $stmt="SELECT * 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"; - - if ($q > 9) {$AE_disabled = 'DISABLED';} - else {$AE_disabled = '';} - 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 "SET TO ACTIVEMethod:\n"; - echo "
LIST IDPRIORITY% MIXSTATUSES
\n"; - echo "\n"; - echo "List: $MIXdetailsLIST   REMOVE\n"; - - - - echo " \n"; - echo "ADD   \n"; - echo "REMOVE\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"; - echo "
\n"; - } - - - echo "

ADD NEW LIST 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"; - - } - } -} - - -###################### -# 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 "
CUSTOM CAMPAIGN STATUSES LISTINGS:\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 "
CAMPAIGNNAMESTATUSESMODIFY
$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 STATUSES
\n"; -} - - -###################### -# ADD=33 display all campaign hotkeys -###################### -if ($ADD==33) -{ -echo "
\n"; - echo ""; - -echo "
CAMPAIGN HOTKEYS LISTINGS:\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 "
CAMPAIGNNAMEHOTKEYSMODIFY
$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 "
CAMPAIGN LEAD RECYCLE LISTINGS:\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 "
CAMPAIGNNAMELEAD RECYCLESMODIFY
$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 LEAD RECYCLES
\n"; -} - - -###################### -# ADD=36 display all campaign auto-alt dial entries -###################### -if ($ADD==36) -{ -echo "
\n"; - echo ""; - -echo "
CAMPAIGN LEAD AUTO-ALT DIAL LISTINGS:\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 "
CAMPAIGNNAMEAUTO-ALT DIALMODIFY
$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 "
CAMPAIGN AGENT PAUSE CODE LISTINGS:\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 "
CAMPAIGNNAMEPAUSE CODESMODIFY
$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 PAUSE CODES
\n"; -} - - -###################### -# ADD=39 display all campaign list mixes -###################### -if ($ADD==39) -{ -echo "
\n"; - echo ""; - -echo "
CAMPAIGN LIST MIX LISTINGS:\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 "
CAMPAIGNNAMELIST MIXMODIFY
$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 * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $campaign_id = $row[2]; - $active = $row[3]; - $list_description = $row[4]; - $list_changedate = $row[5]; - $list_lastcalldate = $row[6]; - - # grab names of global statuses and statuses in the selected campaign - $stmt="SELECT * 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 * 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 - - - echo "
MODIFY A LISTS RECORD: $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 "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
List Change Date: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; - - echo "
\n"; - echo "
STATUSES WITHIN THIS LIST:
\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 "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; - unset($lead_list); - - - echo "
\n"; - echo "
TIME ZONES WITHIN THIS LIST:
\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 "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$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,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,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 "
CALLED COUNTS WITHIN THIS LIST:
\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"';} - 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 "
STATUSSTATUS NAME$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - - echo "
\n"; - - echo "

Click here to see all CallBack Holds in this list

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

DELETE THIS LIST\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ - if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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 = $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_message = $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]; - - ##### 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";} - - - echo "
MODIFY A GROUPS RECORD: $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 "
Group ID: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Use Drop Message: $NWB#vicidial_inbound_groups-drop_message$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Call Time: $NWB#vicidial_inbound_groups-call_time_id$NWE
After Hours Action: $NWB#vicidial_inbound_groups-after_hours_action$NWE
After Hours Message Filename: $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
After Hours Extension: $NWB#vicidial_inbound_groups-after_hours_exten$NWE
After Hours Voicemail: $NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Welcome Message Filename: $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Music On Hold Context: $NWB#vicidial_inbound_groups-moh_context$NWE
On Hold Prompt Filename: $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
On Hold Prompt Interval: $NWB#vicidial_inbound_groups-prompt_interval$NWE
Agent Alert Extension: $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Agent Alert Delay: $NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Default Transfer Group: $NWB#vicidial_inbound_groups-default_xfer_group$NWE
\n"; - - ### list of agent rank or skill-level for this inbound group - echo "
\n"; - echo "
AGENT RANKS FOR THIS INBOUND GROUP:
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT user,group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id'"; - $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[1]$rowx[2]

\n"; - - echo "

\n"; - - echo "Click here to see a report for this inbound group

\n"; - - echo "
\n"; - - if ($LOGdelete_ingroups > 0) - { - echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; - echo "

DELETE THIS IN-GROUP\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ - if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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 "
MODIFY A REMOTE AGENTS ENTRY: $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 "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - - - if ($LOGdelete_remote_agents > 0) - { - echo "

DELETE THIS REMOTE AGENT\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ - if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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]; - echo ""; - - echo "
MODIFY A USERS GROUP ENTRY\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
Allowed Campaigns: \n"; - echo "$campaigns_list"; - echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; - - - ### list of users in this user group - - $active_confs = 0; - $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; - $rsltx=mysql_query($stmt, $link); - $users_to_print = mysql_num_rows($rsltx); - - echo "
\n"; - echo "
USERS WITHIN THIS USER GROUP: $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 "
USERFULL NAMELEVEL
$rowx[0]$rowx[1]$rowx[2]

\n"; - - - - echo "

Click here to see all CallBack Holds in this user group

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

DELETE THIS USER GROUP\n"; - } - } - else - { - echo "You do not have permission to view this page\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 * 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 = $row[3]; - $active = $row[4]; - echo ""; - - echo "
MODIFY A SCRIPT\n"; - echo "\n"; - echo "\n"; - echo "
Script ID: $script_id$NWB#vicidial_scripts-script_name$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text:

Preview Script
"; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - - if ($LOGdelete_scripts > 0) - { - echo "

DELETE THIS SCRIPT\n"; - } - } - else - { - echo "You do not have permission to view this page\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 * 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 = $row[3]; - echo ""; - - echo "
MODIFY A FILTER\n"; - echo "\n"; - echo "\n"; - echo "
Filter ID: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter 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 "
TEST ON CAMPAIGN:
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - if ($LOGdelete_filters > 0) - { - echo "

DELETE THIS FILTER\n"; - } - } - else - { - echo "You do not have permission to view this page\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 "State Rule Added: $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 "State Rule Removed: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# 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 * 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 "
MODIFY A CALL TIME\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Active State Call Time Definitions for this Record:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "CAMPAIGNS USING THIS CALL TIME:
\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 "INBOUND 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 "

DELETE THIS CALL TIME DEFINITION\n"; - } -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# 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 * 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 "
MODIFY A STATE CALL TIME
\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "CALL TIMES USING THIS STATE CALL TIME:
\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 "

DELETE THIS STATE CALL TIME DEFINITION\n"; - } - -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=31111111111 modify phone record in the system -###################### - -if ($ADD==31111111111) -{ - if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - echo "
MODIFY A PHONE RECORD: $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 "
Phone extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hang Up: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
Enable SIPSAK Messages: $NWB#phones-enable_sipsak_messages$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - - echo "

Click here for phone stats\n"; - - if ($LOGast_delete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=311111111111 modify server record in the system -###################### - -if ($ADD==311111111111) -{ - if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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_ip = $row[2]; - - echo "
MODIFY A SERVER RECORD: $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 "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
VICIDIAL Balance Dialing: $NWB#servers-vicidial_balance_active$NWE
VICIDIAL Balance Offlimits: $NWB#servers-balance_trunks_offlimits$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; - - - ### vicidial server trunk records for this server - echo "

VICIDIAL TRUNKS FOR THIS SERVER:   $NWB#vicidial_server_trunks$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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 "
CAMPAIGN TRUNKS RESTRICTION DELETE
$rowx[1]
\n"; - echo "\n"; - echo "\n"; - echo "
DELETE
\n"; - - echo "
ADD NEW SERVER VICIDIAL TRUNK RECORD
\n"; - echo "\n"; - echo "\n"; - echo "TRUNKS:
\n"; - echo "CAMPAIGN:
\n"; - echo "RESTRICTION:
\n"; - echo "
\n"; - - echo "

\n"; - - - ### list of phones on this server - echo "
\n"; - echo "
PHONES WITHIN THIS SERVER:
\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 "
EXTENSIONNAMEACTIVE
$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 "
CONFERENCEEXTENSION
$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 CONFERENCEEXTENSION
$rowx[0]$rowx[2]

\n"; - - - echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "This server has $active_phones active phones and $inactive_phones inactive phones

\n"; - echo "This server has $active_confs active conferences

\n"; - echo "This server has $active_vdconfs active vicidial conferences

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

DELETE THIS SERVER\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=3111111111111 modify conference record in the system -###################### - -if ($ADD==3111111111111) -{ - if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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 "
MODIFY A CONFERENCE RECORD: $row[0]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - - echo "
\n"; - if ($LOGast_delete_phones > 0) - { - echo "

DELETE THIS CONFERENCE\n"; - } - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=31111111111111 modify vicidial conference record in the system -###################### - -if ($ADD==31111111111111) -{ - if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * 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 "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - - echo "
\n"; - if ($LOGast_delete_phones > 0) - { - echo "

DELETE THIS VICIDIAL CONFERENCE\n"; - } - } - else - { - echo "You do not have permission to view this page\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 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]; - - echo "
MODIFY VICIDIAL SYSTEM SETTINGS\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Version: $version
Install Date: $install_date
Use Non-Latin: $NWB#settings-use_non_latin$NWE
Webroot Writable: $NWB#settings-webroot_writable$NWE
Enable QueueMetrics Logging: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics Server IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics DB Login: $NWB#settings-queuemetrics_login$NWE
QueueMetrics DB Password: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics Log ID: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
VICIDIAL Agent Disable Display: $NWB#settings-vicidial_agent_disable$NWE
Allow SIPSAK Messages: $NWB#settings-allow_sipsak_messages$NWE
Admin Home URL: $NWB#settings-admin_home_url$NWE
Enable Agent Transfer Logfile: $NWB#settings-enable_agc_xfer_log$NWE
\n"; - echo "\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - - - - -###################### -# ADD=321111111111111 modify vicidial system statuses -###################### - -if ($ADD==321111111111111) -{ - if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; - - echo "
\n"; - echo "VICIDIAL STATUSES WITHIN THIS SYSTEM:   $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 * 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 "
STATUSDESCRIPTIONSELECT-
ABLE
HUMAN
ANSWER
CATEGORYMODIFY/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 "DELETE\n"; - } - else - { - echo "DELETE\n"; - } - echo "
\n"; - - echo "
ADD NEW SYSTEM STATUS
\n"; - echo "\n"; - echo "Status:   \n"; - echo "Description:
\n"; - echo "Selectable:   \n"; - echo "Human Answer:   \n"; - echo "Category: \n"; - echo "  
\n"; - echo "
\n"; - - echo "

\n"; - - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - - - -###################### -# ADD=331111111111111 modify vicidial status categories -###################### - -if ($ADD==331111111111111) -{ - if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; - - echo "
\n"; - echo "VICIDIAL STATUS CATEGORIES:   $NWB#vicidial_status_categories$NWE
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT * 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]; - - $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"; - - $p++; - } - - echo "
CATEGORYNAMETOVDADSTATUSES IN THIS CATEGORY
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "$Avsc_id[$p]
\n"; - echo "$CATstatuses"; - echo "
Description:
        \n"; - echo "   DELETE
 
\n"; - - echo "
ADD NEW STATUS CATEGORY
\n"; - echo "\n"; - echo "Category ID:   \n"; - echo "Name:   \n"; - echo "TimeOnVDAD Display:  
\n"; - echo "Description:   \n"; - echo "
\n"; - - echo "

\n"; - - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - - - - -###################### -# ADD=550 search form -###################### - -if ($ADD==550) -{ -echo "
\n"; -echo ""; - -echo "
SEARCH FOR A USER
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
User Number:
Full Name:
User Level:
User Group:
\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 = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\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]MODIFY | STATS | 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='LIVE' and callback_time < '$past_month_date';"; - $rslt=mysql_query($stmt, $link); - echo "
User($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='LIVE' and callback_time < '$past_week_date';"; - $rslt=mysql_query($stmt, $link); - echo "
User($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='LIVE' 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='LIVE' 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 "
CAMPAIGN 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='LIVE' 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='LIVE' 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='LIVE' 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='LIVE' 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 "
USER GROUP 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,'; $LEVELlink='stage=LEVELUP';} - - $stmt="SELECT * 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 CAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUSGROUP
$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 ""; - -$USERlink='stage=USERIDDOWN'; -$NAMElink='stage=NAMEDOWN'; -$LEVELlink='stage=LEVELDOWN'; -$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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} -if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} -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 * from vicidial_users $SQLorder"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER LISTINGS:\n"; -echo "
\n"; -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 "\n"; - $o++; - } - -echo "
USER IDFULL NAMELEVELGROUPLINKS
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN LISTINGS:\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 ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LIST LISTINGS:\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 ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFY
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GROUP LISTINGS:\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 ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFY
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTE AGENTS LISTINGS:\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 ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFY
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER GROUPS LISTINGS:\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 ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SCRIPTS LISTINGS:\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 ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LEAD FILTER LISTINGS:\n"; -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 "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
CALL TIME LISTINGS:\n"; -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 ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] MODIFY
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
STATE CALL TIME LISTINGS:\n"; -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 ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFY
\n"; -} - -###################### -# ADD=10000000000 display all phones -###################### -if ($ADD==10000000000) -{ -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 * from phones $SQLorder"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
PHONE LISTINGS:\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 "
EXTENPROTOSERVERDIAL PLANSTATUSNAMEVMAILLINKS
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; -} - -###################### -# ADD=100000000000 display all servers -###################### -if ($ADD==100000000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SERVER LISTINGS:\n"; -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 ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFY
\n"; -} - -###################### -# ADD=1000000000000 display all conferences -###################### -if ($ADD==1000000000000) -{ -echo "\n";echo "\n"; -$stmt="SELECT admin_home_url from system_settings;"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; - -?> -
-
\n"; - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
CONFERENCE LISTINGS:\n"; -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 ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFY
\n"; -} - -###################### -# ADD=10000000000000 display all vicidial conferences -###################### -if ($ADD==10000000000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
CONFERENCE LISTINGS:\n"; -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 ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFY
\n"; -} - -###################### -# ADD=999999 display reports section -###################### -if ($ADD==999999) -{ - if ($LOGview_reports==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - - $stmt="select * from servers;"; - $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]; - $i++; - } - - $stmt="SELECT enable_queuemetrics_logging,queuemetrics_url from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging_LU = $row[0]; - $queuemetrics_url_LU = $row[1]; - - ?> - - - - - - VICIDIAL: Server Stats and Reports - VICIDIAL: Server Stats and Reports

- -

-	
-	 $o)
-		{
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		echo "\n";
-		$o++;
-		}
-
-	echo "
SERVERDESCRIPTIONIP ADDRESSACTIVEVDAD timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINK
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n
\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "                   VERSION: $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 * 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 * 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) #### 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 = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - 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) #### Monday local time - { - 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) #### Tuesday local time - { - 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) #### Wednesday local time - { - 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) #### Thursday local time - { - 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) #### Friday local time - { - 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) #### Saturday local time - { - 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); - - $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) $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 "This campaign has $active_leads leads to be dialed in those lists\n"; - } - else - { - echo "no dial statuses selected for this campaign\n"; - } - } - else - { - echo "no active lists selected for this campaign\n"; - } - } -else - { - echo "no active lists selected for this campaign\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_www/vicidial/closer-fronter_popup.php b/LANG_www/vicidial/closer-fronter_popup.php deleted file mode 100644 index 98a58eca..00000000 --- a/LANG_www/vicidial/closer-fronter_popup.php +++ /dev/null @@ -1,516 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1020 - Added variable filtering to eliminate SQL injection attack threat -# 61201-1114 - Added lead_id and user to recording_log entry -# - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -#$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; - -# $ext_context = 'default'; defined in dbconnect file - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - 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($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - 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|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) - { - echo "\n\n"; - echo "\n\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; - $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: " . mysql_real_escape_string($filename) . "','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('Zap/" . mysql_real_escape_string($channel) . "','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id','$user')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='" . mysql_real_escape_string($filename) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $user - $full_name\n

\n"; - - $url = "http://10.10.99.2/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - -# $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='$extension',user='$user' where parked_time='$parked_time' and server_ip='$server_ip' and channel='$channel'"; -# if ($DB) {echo "|$stmt|\n";} -# $fp = fopen ("./closer_SQL_updates.txt", "a"); -# fwrite ($fp, "$date|$user|$stmt|\n"); -# fclose($fp); -# $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='" . mysql_real_escape_string($parked_by) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> - - - - - -
- - - - - - - - - - -
COF MW Customer Search
Phone number
- -

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

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


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial/closer-fronter_popup2.php b/LANG_www/vicidial/closer-fronter_popup2.php deleted file mode 100644 index 1c98063d..00000000 --- a/LANG_www/vicidial/closer-fronter_popup2.php +++ /dev/null @@ -1,431 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1025 - Added variable filtering to eliminate SQL injection attack threat -# 61201-1114 - Added lead_id and user to recording_log entry -# - -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -#$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; - -# $ext_context = 'default'; defined in dbconnect file -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if (!$auth) - { - if ( (strlen($PHP_AUTH_USER)>1) and ( (eregi("tsr",$PHP_AUTH_PW)) or (eregi("sales",$PHP_AUTH_PW)) ) ) - { - $auth=1; - $user = $PHP_AUTH_USER; - $pass = $PHP_AUTH_PW; - } - } - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER - $user - $PHP_AUTH_USER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - 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|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and ( (eregi('zap',$customer_zap_channel)) or (eregi('iax',$customer_zap_channel)) ) ) - { - echo "\n\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; -# $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: " . mysql_real_escape_string($filename) . "','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id','$user')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='" . mysql_real_escape_string($filename) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($fronter) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $fronter - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - $stmt="SELECT group_name,group_color from vicidial_inbound_groups where group_id='" . mysql_real_escape_string($channel_group) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $group_name = $row[0]; - $group_color = $row[1]; - - echo "
\n"; - echo "
$channel_group - $group_name

\n\n"; - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### - -if (eregi('CL',$channel_group)) - { - if (strlen($phone) > 9) {$search_phone = $phone;} - if ( (strlen($search_phone) < 10) or (strlen($fronter) < 1) ) - { - echo "\n"; - $stmt="SELECT user,phone_number from vicidial_list where lead_id='$parked_by';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($fronter) < 1) {$fronter=$row[0];} - if (strlen($search_phone) < 10) {$search_phone=$row[1];} - } - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

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


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial/closer.php b/LANG_www/vicidial/closer.php deleted file mode 100644 index 59599edb..00000000 --- a/LANG_www/vicidial/closer.php +++ /dev/null @@ -1,353 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) -# CHANGES -# -# 60620-1032 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -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["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -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["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -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"];} - -$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"); -$popup_page = './closer_popup.php'; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - $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 "Invalid Username/Password: |$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); - } - } - - -$color_class[0] = 'green'; -$color_class[1] = 'red'; -$color_class[2] = 'blue'; -$color_class[3] = 'purple'; -$color_class[4] = 'orange'; -$color_class[5] = 'green'; -$color_class[6] = 'red'; -$color_class[7] = 'blue'; -$color_class[8] = 'purple'; -$color_class[9] = 'orange'; -?> - - - - - -VICIDIAL CLOSER: Main - - -
- - 0) - { - $stmt="SELECT dialplan_number,server_ip from phones where extension='" . mysql_real_escape_string($extension) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dialplan_number=$row[0]; - $server_ip=$row[1]; - - if (!$group_selected) - { - $stmt="select distinct channel_group from park_log;"; - $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++; - } - echo "
Please select the groups you want to pick calls up from:
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inbound Call Groups:
\n"; - $o=0; - while ($groups_to_print > $o) - { - $group_form_print = sprintf("%-20s", $groups[$o]); - echo "$group_form_print
\n"; - $o++; - } - echo "
\n"; - echo "\n"; - echo "


\n"; - } - else - { - $o=0; - while($o < $group_selected) - { - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; - } - - $stmt="INSERT INTO vicidial_user_log values('','" . mysql_real_escape_string($user) . "','LOGIN','CLOSER','$NOW_TIME','$STARTtime');"; - $rslt=mysql_query($stmt, $link); - - echo "\n"; - echo"\n"; - - echo "extension found, forwarding you to closer page, please wait 3 seconds...
\n"; - } - - } - else - { - echo "The extension you entered does not exist, please try again
\n"; - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - - } - else - { - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - -exit; - -} - -$o=0; -while($o < $group_selected) -{ - $listen_groups = "$listen_groups     $groupselect[$o]"; - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; -} - - -echo "\n"; -echo"\n"; - -#CHANNEL SERVER CHANNEL_GROUP EXTENSION PARKED_BY PARKED_TIME -#---------------------------------------------------------------------------------------------- -#Zap/73-1 10.10.11.11 IN_800_TPP_CS TPPpark 7275338730 2004-04-22 12:41:00 - - - -echo "$NOW_TIME           $PHP_AUTH_USER - $fullname - CALLS SENT TO: $dialplan_number

\n"; - -echo "Click on the channel below that you would like to have directed to your phone
\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME         \n";
-echo "---------------------------------------------------------------------------------------------- \n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "'";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "' and channel_group LIKE \"CL_%\" order by channel_group,parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$park_extension =	sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		$G='';   $EG='';
-		$o=0;
-		$with_color=0;
-		while($o < $group_selected)
-			{
-				if (eregi("$groupselect[$o]",$channel_group))
-					{
-					$G=""; $EG='';
-					$with_color++;
-					}
-				$o++;
-			}
-		if ($with_color)
-			{
-			if (eregi('CL_GAL',$row[2]))
-				{
-				echo "$G$channel$server$channel_group$park_extension                     $parked_time $EG\n";
-				}
-			else
-				{
-				echo "$G$channel$server$channel_group$park_extension$parked_by$parked_time $EG\n";
-				}
-			}
-#	
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "*************************************** NO PARKED CALLS ************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	}
-
-echo "  \n\n";
-echo "looking for calls on these groups:\n";
-$o=0;
-while($o < $group_selected)
-{
-	$group_print =		sprintf("%-20s", $groupselect[$o]);
-	echo "             - $group_print\n";
-	$o++;
-}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial/closer_dispo.php b/LANG_www/vicidial/closer_dispo.php deleted file mode 100644 index 54e61219..00000000 --- a/LANG_www/vicidial/closer_dispo.php +++ /dev/null @@ -1,329 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer disposition screen of a call that has been grabbed. This allows the closer to modify customer information and disposition the call -# CHANGES -# -# 60619-1641 - Added variable filtering to eliminate SQL injection attack threat -# - -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["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["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"];} - - -$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; - -$ext_context = 'demo'; -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 > 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 "Invalid Username/Password: |$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 CLOSER: Call Disposition -\n"; -?> - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### 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) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . 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); - - ### 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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from live_channels where server_ip='$server_ip' and channel='" . mysql_real_escape_string($channel) . "' and extension like \"%" . mysql_real_escape_string($extension) . "%\""; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $parked_count = $row[0]; - - if ($parked_count > 0) - { - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Hangup','$DTqueryCID','Channel: " . mysql_real_escape_string($channel) . "','','','','','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Hangup command sent for channel $channel       $NOW_TIME\n

\n"; - - echo "\n"; - } - else - { - echo "Hangup command FAILED for channel $channel       $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 * 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 "
Call information: $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     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for 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/LANG_www/vicidial/closer_popup.php b/LANG_www/vicidial/closer_popup.php deleted file mode 100644 index e12f02c3..00000000 --- a/LANG_www/vicidial/closer_popup.php +++ /dev/null @@ -1,453 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1029 - Added variable filtering to eliminate SQL injection attack threat -# - -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["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -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["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -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"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -#$DB=1; -$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; - -$ext_context = 'demo'; - - $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 "Invalid Username/Password: |$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); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - $stmt="DELETE from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - - #$monitor_channel = eregi_replace('Zap/', "", $channel); - $monitor_channel = eregi_replace('-1', "", $channel); - $SIPexten = $extension; - $filename = "$REC_TIME$US$SIPexten"; - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: $monitor_channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$monitor_channel','$server_ip','SIP/$SIPexten','$NOW_TIME','$STARTtime','$filename')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $recording_id = $row[0]; - -# echo "Recording command sent for channel $channel - $filename - $recording_id
\n"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($parked_by) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $parked_by - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$parked_by&channel=$channel&server_ip=$server_ip&extension=$extension&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - - $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='" . mysql_real_escape_string($extension) . "',user='$PHP_AUTH_USER' where parked_time='" . mysql_real_escape_string($parked_time) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and channel='" . mysql_real_escape_string($channel) . "'"; - if ($DB) {echo "|$stmt|\n";} - $fp = fopen ("./closer_SQL_updates.txt", "a"); - fwrite ($fp, "$date|$PHP_AUTH_USER|$stmt|\n"); - fclose($fp); - - - $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='" . mysql_real_escape_string($parked_by) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

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


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial/dbconnect.php b/LANG_www/vicidial/dbconnect.php deleted file mode 100644 index 5247e166..00000000 --- a/LANG_www/vicidial/dbconnect.php +++ /dev/null @@ -1,49 +0,0 @@ - LICENSE: GPLv2 -# -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("^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_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -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 - -?> diff --git a/LANG_www/vicidial/listloader.php b/LANG_www/vicidial/listloader.php deleted file mode 100644 index b6e8ae5e..00000000 --- a/LANG_www/vicidial/listloader.php +++ /dev/null @@ -1,926 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# 60822-1105 - fixed for nonwritable directories -# 60906-1059 - added filter of non-digits in alt_phone field -# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme -# 61128-1046 - 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 -# -# 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.0.3'; -$build = '770417-1059'; - -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']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} -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"];} - - -#$DB=1; -#$DBX=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); - - -$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('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - - -$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"; - - -?> - - - - - -
method=post enctype="multipart/form-data"> - - - - - - - - - - - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
Lead Duplicate Check:
Lead Time Zone Lookup:
CLICK HERE TO GO TO THE SUPER LEAD LOADER (BETA VERSION)     BACK TO ADMIN
-
-document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - if ($WeBRooTWritablE > 0) - { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "./vicidial_temp_file.txt"; - } - else - { - $lead_file = "$LF_path"; - } - $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $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 "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $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 = $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]); - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$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++;} - } - } - - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) - { - $US='_'; - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_list .= "$phone_number$US$list_id|"; - - if (strlen($phone_code)<1) {$phone_code = '1';} - - $postalgmt_found=0; - if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) - { - if (preg_match('/^1$/', $phone_code)) - { - $stmt="select * 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 * 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 * 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 * 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 * 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. - #********************************************************************** - - $NA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $NA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $NA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $NA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NA_DST=0; - } else { - $NA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $NA_DST=0; - } else { - $NA_DST=1; - } - } - } else { - $NA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $NA_DST=1; - } elseif ($dd < ($dow+25)) { - $NA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $NA_DST=1; - } else { - $NA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $NA_DST=1; - } else { - $NA_DST=0; - } - } - } else { - $NA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $NA_DST\n";} - if ($NA_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-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 == '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++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $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','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } - else - { - if ($bad < 10) {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 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
DUPLICATE: $dup       POSTAL MATCH: $post
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - diff --git a/LANG_www/vicidial/log_test.php b/LANG_www/vicidial/log_test.php deleted file mode 100644 index cd7a86b7..00000000 --- a/LANG_www/vicidial/log_test.php +++ /dev/null @@ -1,37 +0,0 @@ - LICENSE: GPLv2 -# - - -$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;} - - -$fp = fopen ("./closer_SQL_updates.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - fwrite ($fp, "CLOSER SQL UPDATE|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - - -exit; - - - -?> - - -Hello - - diff --git a/LANG_www/vicidial/phone_stats.php b/LANG_www/vicidial/phone_stats.php deleted file mode 100644 index 0daaf2fd..00000000 --- a/LANG_www/vicidial/phone_stats.php +++ /dev/null @@ -1,245 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 60927-1548 - Changed to vicidial_users for authentication -# - -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["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["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -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"];} - -$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"); -$admin_page = './admin.php'; - -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';"; - $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-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$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'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL ADMIN: Phone Stats - - -
- - - - - - - -\n"; -echo "
  VICIDIAL ADMIN: Administration  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
  \n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "CALL TIME AND CHANNELS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
CHANNEL GROUP COUNT HOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LAST 1000 CALLS FOR DATE RANGE:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_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"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
NUMBER CHANNEL GROUP DATE LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_www/vicidial/record_conf_1_hour.php b/LANG_www/vicidial/record_conf_1_hour.php deleted file mode 100644 index d184e457..00000000 --- a/LANG_www/vicidial/record_conf_1_hour.php +++ /dev/null @@ -1,156 +0,0 @@ - LICENSE: GPLv2 -### -# grab: $server_ip $station $session_id -# -# CHANGES -# -# 60620-1011 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -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["station"])) {$station=$_GET["station"];} - elseif (isset($_POST["station"])) {$station=$_POST["station"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["NEW_RECORDING"])) {$NEW_RECORDING=$_GET["NEW_RECORDING"];} - elseif (isset($_POST["NEW_RECORDING"])) {$NEW_RECORDING=$_POST["NEW_RECORDING"];} -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"];} - -$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 "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$MYSQL_datetime = date("Y-m-d H:i:s"); -$FILE_datetime = date("Ymd-His_"); -$secX = $STARTtime; - - $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 "Invalid Username/Password: |$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'"; - $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]; - - } - - - - -?> - - -VICIDIAL RECORD CONFERENCE: 1 hour -\n"; -?> - - -
- - 8) && (strlen($session_id) > 3) && (strlen($station) > 3) ) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $conf_silent_prefix = '7'; - $ext_context = 'demo'; - - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','RB$FILE_datetime" . mysql_real_escape_string($station) . "','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: 8309','Priority: 1','Callerid: $FILE_datetime" . mysql_real_escape_string($station) . "','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('" . mysql_real_escape_string($session_id) . "','" . mysql_real_escape_string($server_ip) . "','" . mysql_real_escape_string($station) . "','$MYSQL_datetime','$secX','$FILE_datetime" . mysql_real_escape_string($station) . "')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "Recording started\n

\n"; - echo "Back to main recording screen\n

\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$station|\n

\n"; - echo "Back to main recording screen\n

\n"; - } -} -else -{ -echo "
Start recording a conference for 1 hour: \n"; -echo "\n"; -echo "server_ip: | \n"; -echo "session_id: | \n"; -echo "station: | \n"; -echo "\n"; -echo "


\n"; - - - -} -?> - - \ No newline at end of file diff --git a/LANG_www/vicidial/server_stats.php b/LANG_www/vicidial/server_stats.php deleted file mode 100644 index 8e509383..00000000 --- a/LANG_www/vicidial/server_stats.php +++ /dev/null @@ -1,97 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# 61101-1331 - Added SIP/IAX listen/barge links -# - -require("dbconnect.php"); - -$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 > 6;"; - 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|\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;} - -$stmt="select * from servers;"; -$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]; - $i++; - } -?> - - - - - -VICIDIAL: Server Stats and Reports -VICIDIAL: Server Stats and Reports                           -BACK TO ADMIN

- - -
- - $o) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o++; - } - -?> -
SERVERDESCRIPTIONIP ADDRESSACTIVEVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_www/vicidial/user_stats.php b/LANG_www/vicidial/user_stats.php deleted file mode 100644 index ecd457f8..00000000 --- a/LANG_www/vicidial/user_stats.php +++ /dev/null @@ -1,408 +0,0 @@ - LICENSE: GPLv2 -### -# 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 -# - -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["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -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"];} - -$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';"; - $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 "Invalid Username/Password: |$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); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
" ?>   VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo " - VICIDIAL Time Sheet\n"; -echo " - User Status\n"; -echo " - Modify User\n"; - - -echo "
\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); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "TALK TIME AND STATUS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT 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'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
STATUSCOUNTHOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LOGIN/LOGOUT TIME:\n"; -echo "\n"; -echo "\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 ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\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 = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $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 ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = 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 ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
EVENT DATE CAMPAIGN GROUPHOURS:MINUTES
$row[0] $row[2] $row[3] $row[4]
$row[0] $row[2] $row[3] $row[4] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
TOTAL $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "\n"; -echo "\n"; - - $stmt="select * 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 ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - } - - -echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; - - - -echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "\n"; -echo "\n"; - - $stmt="select * 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; - 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 ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - } - - -echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; - - - - -echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "\n"; -echo "\n"; - - $stmt="select * 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)>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 "\n"; - - } - - -echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location  
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_www/vicidial/user_status.php b/LANG_www/vicidial/user_status.php deleted file mode 100644 index ecffbc5c..00000000 --- a/LANG_www/vicidial/user_status.php +++ /dev/null @@ -1,242 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -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["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"];} - -$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';"; - $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 "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign 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]; - 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,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 * 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]; - $i++; - } - - } - -$stmt="select * 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++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
" ?>   VICIDIAL ADMIN: User Status for  
  \n"; - -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
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Campaign: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name \n"; -echo "       GROUP: $user_group

\n"; - -echo "VICIDIAL Time Sheet\n"; -echo " - User Stats\n"; -echo " - Modify User\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_www/vicidial/voice_lab.php b/LANG_www/vicidial/voice_lab.php deleted file mode 100644 index 2ce3a2a9..00000000 --- a/LANG_www/vicidial/voice_lab.php +++ /dev/null @@ -1,312 +0,0 @@ - LICENSE: GPLv2 -### -# -# CHANGES -# -# 61220-1050 - First Build -# 70115-1246 - Added ability to define an exten to play -# - -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["message"])) {$message=$_GET["message"];} - elseif (isset($_POST["message"])) {$message=$_POST["message"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_GET["NEW_VOICE_LAB"];} - elseif (isset($_POST["NEW_VOICE_LAB"])) {$NEW_VOICE_LAB=$_POST["NEW_VOICE_LAB"];} -if (isset($_GET["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_GET["KILL_VOICE_LAB"];} - elseif (isset($_POST["KILL_VOICE_LAB"])) {$KILL_VOICE_LAB=$_POST["KILL_VOICE_LAB"];} -if (isset($_GET["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_GET["PLAY_MESSAGE"];} - elseif (isset($_POST["PLAY_MESSAGE"])) {$PLAY_MESSAGE=$_POST["PLAY_MESSAGE"];} -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"];} - -$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"); -$MYSQL_datetime = date("Y-m-d H:i:s"); -$FILE_datetime = date("Ymd-His_"); -$secX = $STARTtime; - -$local_DEF = 'Local/'; -$local_AMP = '@'; -$ext_context = 'demo'; - - $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 "Invalid Username/Password: |$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'"; - $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]; - - } - - -##### 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++; - } - - - - -?> - - -VICIDIAL VOICE LAB: Admin -\n"; -?> - - -
- - 0) -{ - if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) - { - echo "


TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
\n"; - - echo "
or, you can enter an extension that you want played below
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Message Extension\n"; - echo "\n"; - echo "


\n"; - - $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]";} - $remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id"; - - $thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y")); - $past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old); - - $stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $agents_to_loop = mysql_num_rows($rslt); - $agents_sessions[0]=''; - $agents_servers[0]=''; - $agents_users[0]=''; - - $o=0; - while ($agents_to_loop > $o) - { - $rowx=mysql_fetch_row($rslt); - $agents_sessions[$o] = "$rowx[0]"; - $agents_servers[$o] = "$rowx[1]"; - $agents_users[$o] = "$rowx[2]"; - $o++; - } - - $o=0; - while ($agents_to_loop > $o) - { - if ($agents_servers[$o] == "$server_ip") - {$dial_string = $session_id;} - else - {$dial_string = $remote_dialstring;} - - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n"; - - $o++; - } - - - - echo "
Kill a Voice Lab Session: 8600900
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$campaign_id|\n

\n"; - echo "Back to main voicelab screen\n

\n"; - } -} -else -{ - if ($PLAY_MESSAGE > 0) - { - if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) ) - { - echo "


TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW
\n"; - - echo "
or, you can enter an extension that you want played below
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Message Extension\n"; - echo "\n"; - echo "


\n"; - - $nn='99'; - $n='9'; - - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "MESSAGE $message played at session $session_id on server $server_ip\n"; - - echo "
Kill a Voice Lab Session: 8600900
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$campaign_id|\n

\n"; - echo "Back to main voicelab screen\n

\n"; - } - } -else - { - echo "
Start a Voice Lab Session: 8600900
\n"; - echo "\n"; - echo "\n"; - echo "Your Server: \n"; - echo "
\n"; - echo "Campaign: "; - echo "
\n"; - echo "\n"; - echo "


\n"; - - - echo "
Kill a Voice Lab Session: 8600900
\n"; - echo "\n"; - echo "\n"; - echo "Your Server: \n"; - echo "
\n"; - echo "Campaign: "; - echo "
\n"; - echo "\n"; - echo "


\n"; - } -} - - -if ($KILL_VOICE_LAB > 1) -{ - if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) - { - $kill_dial_string = "5555$session_id"; - $hangup_exten='8300'; - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$campaign_id|\n

\n"; - echo "Back to main voicelab screen\n

\n"; - } - -} - -?> - - \ No newline at end of file diff --git a/LANG_www/vicidial/vtiger_search.php b/LANG_www/vicidial/vtiger_search.php deleted file mode 100644 index 6eaaf1bf..00000000 --- a/LANG_www/vicidial/vtiger_search.php +++ /dev/null @@ -1,313 +0,0 @@ - LICENSE: GPLv2 -### -# 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 4.2 -# -# CHANGES -# 60719-1615 - First version -# 60801-2304 - added mysql debug and auto-forward -# 60802-1111 - added insertion of not-found record into vtiger system -# - -#Asterisk/VICIDIAL Server (ASTERISK) -#Internal : 10.10.10.15 -#External : 55.55.55.55 - -#vtiger Server(TEST1) -#Internal : 10.10.10.16 -#External : 55.55.55.56 - - -### alter to connect to your vtiger database -$link=mysql_connect("10.10.10.16", "cron",'1234'); -if (!$link) {die('Could not connect: ' . mysql_error());} -echo 'Connected successfully'; -mysql_select_db("vtigercrm4_2"); - - -$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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -#$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -#$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -#$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; - -# $ext_context = 'default'; defined in dbconnect file - -# $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -# 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($user)<2) or (strlen($pass)<2) or (!$auth)) -# { -# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); -# Header("HTTP/1.0 401 Unauthorized"); -# echo "Invalid Username/Password: |$user|$pass|\n"; -# exit; -# } -# else -# { -# -# if($auth>0) -# { -# $office_no=strtoupper($user); -# $password=strtoupper($pass); -# $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; -# 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|$user|$pass|$ip|$browser|$LOGfullname|\n"); -# fclose($fp); -# -# if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) -# { -# echo "\n\n"; -# echo "\n\n"; -# -# } -# else -# { -# echo "Bad channel: $customer_zap_channel\n"; -# echo "Make sure the Zap channel is live and try again\n"; -# exit; -# } -# -# } -# else -# { -# fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); -# fclose($fp); -# } -# } - -echo "\n"; -echo "\n"; -echo "VICIDIAL Vtiger Lookup\n"; -echo "\n"; - - -$stmt="SELECT count(*) from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -if (!$rslt) { - die('Could not execute: ' . mysql_error()); -} -$row=mysql_fetch_row($rslt); -$found_count = $row[0]; - -#echo "
\n|$phone|$found_count|\n"; - -if ($found_count < 1) -{ - echo "\n"; - echo "\n"; - echo "
\n"; - echo "$phone not found, creating account...\n"; - - if ($DB) {echo "
";}
-	$stmt="SELECT id from users where user_name='$user';";
-	if ($DB) {echo "$stmt\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$user_id = $row[0];
-	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-	$stmt = "INSERT INTO crmentity (smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$user_id', '$user_id', 0, 'Accounts', NULL, '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, 0, 1, 1);";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$recordID = mysql_insert_id($link);
-	if ($DB) {echo "|$recordID|\n";}
-	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-#	$stmt = "INSERT INTO accountscf (accountid, cf_393, cf_397, cf_403, cf_405, cf_407, cf_409, cf_411) VALUES ('$recordID', NULL, NULL, NULL, NULL, NULL, NULL, NULL);";
-#	if ($DB) {echo "|$stmt|\n";}
-#	$rslt=mysql_query($stmt, $link);
-#	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-	$stmt = "INSERT INTO account (accountid,accountname,contactname,phone,otherphone,email1) values('$recordID','$last_name, $first_name','$first_name $last_name','$phone','$alt_phone','$email');";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-	$stmt = "INSERT INTO accountbillads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-	$stmt = "INSERT INTO accountshipads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	if (!$rslt) {die('Could not execute: ' . mysql_error());}
-
-	if ($DB) {echo "DONE\n";}
-
-	$account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$recordID";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "
\n"; - - echo "
";
-	echo "account created!\n";
-	echo "accountid:   $recordID\n";
-	echo "phone:       $phone\n";
-	echo "

"; - -} -else -{ - $stmt="SELECT accountid,accountname,contactname from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $accountid = $row[0]; - $accountname = $row[1]; - $contactname = $row[2]; - - $account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$accountid"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - - echo "
";
-	echo "account found!\n";
-	echo "accountid:   $accountid\n";
-	echo "phone:       $phone\n";
-	echo "accountname: $accountname\n";
-	echo "contactname: $contactname\n";
-	echo "

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


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial_de/AST_CLOSER_service_level.php b/LANG_www/vicidial_de/AST_CLOSER_service_level.php new file mode 100644 index 00000000..ddd60707 --- /dev/null +++ b/LANG_www/vicidial_de/AST_CLOSER_service_level.php @@ -0,0 +1,956 @@ + 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 +# + +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$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); +$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 "Unzulässiges Username/Kennwort:|$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 from vicidial_inbound_groups;"; +$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++; + } +?> + + + + + +\n"; +echo "VICIDIAL: VDAD Closer Service Level Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ÄNDERN Sie | REPORTS \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\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 "VICIDIAL: Closer Service-Level Stats                      $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 "---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE ANTWORT (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/LANG_www/vicidial_de/AST_CLOSERstats.php b/LANG_www/vicidial_de/AST_CLOSERstats.php index 35c1298b..76fbc443 100644 --- a/LANG_www/vicidial_de/AST_CLOSERstats.php +++ b/LANG_www/vicidial_de/AST_CLOSERstats.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_CLOSERstats.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat @@ -10,6 +10,16 @@ # 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 # require("dbconnect.php"); @@ -20,24 +30,58 @@ $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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["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';} - $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); +############################################# +##### 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); - $auth=$row[0]; + $non_latin = $row[0]; + $i++; + } +##### 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); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = ($local_gmt * 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)) { @@ -52,16 +96,56 @@ $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 from vicidial_inbound_groups;"; $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); - $groups[$i] =$row[0]; + $LISTgroups[$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("--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++; } ?> @@ -79,36 +163,80 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: VDAD Genauerer Notfall\n"; +echo "VICIDIAL: VDAD Genauerer Notfall\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 "Zeitraum:
\n"; echo "\n"; -echo "\n"; +echo "
\n"; +echo "Inbound Gruppen: \n"; +echo "\n"; +echo "\n"; -echo "\n"; +echo "           "; +echo "ÄNDERN Sie | "; +echo "REPORTS | "; +echo "IVR REPORT \n"; +echo "\n"; + +echo "
\n"; + +#echo "\n"; +echo "Shift: \n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; +echo "   \n"; +echo "
\n"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if ($groups_to_print < 1)
 {
 echo "\n\n";
-echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n";
+echo "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
 }
 
 else
@@ -133,38 +261,124 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
-echo "VICIDIAL: Automobil-Vorwahlknopf Genauerer Notfall                      $NOW_TIME\n";
+echo "VICIDIAL: Automobil-Vorwahlknopf Genauerer Notfall: $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='" . mysql_real_escape_string($group) . "';";
+$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');";
+$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]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+$IVRcalls =	sprintf("%10s", $rowx[0]);
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
+	{$average_call_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);
+	$average_call_seconds = ($TOTALsec / $row[0]);
+	$average_call_seconds = round($average_call_seconds, 0);
+	$average_call_seconds =	sprintf("%10s", $average_call_seconds);
+	}
+$ANTWORTEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($ANTWORTEDcalls < 1) or ($TOTALcalls < 1) )
+	{$ANTWORTEDpercent = '0';}
+else
+	{
+	$ANTWORTEDpercent = (($ANTWORTEDcalls / $TOTALcalls) * 100);
+	$ANTWORTEDpercent = round($ANTWORTEDpercent, 0);
+	}
+if ( ($rowy[0] < 1) or ($ANTWORTEDcalls < 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 "Gesamtanrufe gesetzt von dieser Kampagne:                       $TOTALcalls\n";
-echo "Average Call Length for all Calls:            $average_hold_seconds seconds\n";
+
+echo "Insgesamt fordert die in dieser In-Gruppe:       $TOTALcalls\n";
+echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
+echo "Answered Calls:                               $ANTWORTEDcalls  $ANTWORTEDpercent%\n";
+echo "Average queue time for Answered Calls:        $average_answer_seconds seconds\n";
+echo "Calls taken into the IVR for this In-Gruppe:  $IVRcalls\n";
+
 
 echo "\n";
 echo "---------- DROPS\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='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
+$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);
@@ -179,101 +393,111 @@ else
 	}
 
 if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+	{
+	$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 ( ($ANTWORTEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_ANTWORTEDpercent = '0';}
+else
+	{
+	$DROP_ANTWORTEDpercent = (($DROPcalls / $ANTWORTEDcalls) * 100);
+	$DROP_ANTWORTEDpercent = round($DROP_ANTWORTEDpercent, 0);
+	}
 
-echo "Gesamt-TROPFEN Anrufe:                                          $DROPcalls  $DROPpercent%\n";
+echo "Gesamt-TROPFEN Anrufe:                                          $DROPcalls  $DROPpercent%               drop/answered: $DROP_ANTWORTEDpercent%\n";
 echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
 
 
 
-##############################
-#########  CALL STATUS STATS
 
-$TOTALcalls = 0;
+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;";
+	$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;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_two = $row[0];
+
+	if ( ($ANTWORTEDcalls > 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 / $ANTWORTEDcalls) * 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 / $ANTWORTEDcalls) * 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 "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "---------- CUSTOM INDICATORS\n";
+echo "GDE (Answered/Gesamtanrufe genommenin to this In-Group):  $ANTWORTEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_ANTWORTEDpercent%\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";
 
-$stmt="SELECT * from vicidial_statuses order by status";
-$rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
 
-$o=0;
-while ($statuses_to_print > $o) 
-	{
-	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="SELECT * from vicidial_campaign_statuses 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),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) . "' group by status;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+# 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);
-$i=0;
-while ($i < $statuses_to_print)
+$p=0;
+while ($p < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
-
-	$TOTALcalls = ($TOTALcalls + $row[0]);
-
-	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[1];
-	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}	
-		}
-	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');}	
-		}
-
-
-	echo "| $status | $status_name | $STATUScount |\n";
-
-	$i++;
+	$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++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
-
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
-
-
-
-
+##############################
+#########  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='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
+$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);
@@ -310,6 +534,563 @@ echo "Average QUEUE Length for queue calls:         $average_queue_seconds secon
 echo "Average QUEUE Length across all calls:        $average_total_queue_seconds seconds\n";
 
 
+
+##############################
+#########  CALL HOLD TIME BREAKDOWN IN SECONDS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN\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 ANTWORTED 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') 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 "---------- CALL HANGUP GRUND STATS\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          | KATEGORIE             | 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_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
+
+	$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_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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 KATEGORIE STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| KATEGORIE             | 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";
+
+
 ##############################
 #########  USER STATS
 
@@ -324,7 +1105,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| MITTEL                   | CALLS      | TIME M   | AVRG M |\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='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+$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);
@@ -343,23 +1124,25 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$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";
+	$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
 	$USERtotTALK_MS =		sprintf("%8s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$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 = eregi_replace('-','',$USERavgTALK_MS);
 	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
 
 	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
@@ -367,22 +1150,25 @@ while ($i < $users_to_print)
 	$i++;
 	}
 
-if (!$TOTcalls) {$TOTcalls = 1;}
-$TOTavg = ($TOTtime / $TOTcalls);
-$TOTavg = round($TOTavg, 0);
-$TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
-$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
-$TOTavg_S = ($TOTavg_S * 60);
-$TOTavg_S = round($TOTavg_S, 0);
-if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
-$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
-$TOTavg =		sprintf("%6s", $TOTavg_MS);
+if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
+else
+	{
+	$TOTavg = ($TOTtime / $TOTcalls);
+	$TOTavg = round($TOTavg, 0);
+	$TOTavg_M = ($TOTavg / 60);
+	$TOTavg_M_int = round($TOTavg_M, 2);
+	$TOTavg_M_int = intval("$TOTavg_M_int");
+	$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
+	$TOTavg_S = ($TOTavg_S * 60);
+	$TOTavg_S = round($TOTavg_S, 0);
+	if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
+	$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	}
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -408,69 +1194,86 @@ echo "---------- TIME STATS\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",$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)
 	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
+	$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;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
+	$drop_count[$i] = $Fdrop[$i];
 	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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)
@@ -482,7 +1285,7 @@ else
 	}
 
 echo "\n";
-echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN DER GESAMTANRUFE GESETZTVON DIESER KAMPAGNE\n";
+echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN TAKEN INTO THIS IN-GROUP\n";
 
 $k=1;
 $Mk=0;
@@ -597,13 +1400,99 @@ while ($i <= 96)
 	$h++;
 	}
 
-
 echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
 
 
 
 
 
+
+##### Answered wait time breakdown
+echo "\n";
+echo "---------- CALL ANTWORTED 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";
@@ -611,7 +1500,9 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 
 
+
 ?>
 
+
- \ No newline at end of file + diff --git a/LANG_www/vicidial_de/AST_IVRfilter.php b/LANG_www/vicidial_de/AST_IVRfilter.php new file mode 100644 index 00000000..74b96767 --- /dev/null +++ b/LANG_www/vicidial_de/AST_IVRfilter.php @@ -0,0 +1,248 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# + +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["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); + +############################################# +##### 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 "Unzulässiges Username/Kennwort:|$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 "Zeitraum:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "REPORTS\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 "| KATEGORIE             | 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='INBOUND_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='INBOUND_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='INBOUND_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='INBOUND_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='INBOUND_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 MITTEL  | $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/LANG_www/vicidial_de/AST_IVRstats.php b/LANG_www/vicidial_de/AST_IVRstats.php new file mode 100644 index 00000000..6005c22c --- /dev/null +++ b/LANG_www/vicidial_de/AST_IVRstats.php @@ -0,0 +1,684 @@ + 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 +# + +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["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); + +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); +$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 "Unzulässiges Username/Kennwort:|$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 from vicidial_inbound_groups;"; +$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++; + } + +$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 "VICIDIAL: IVR 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 "Zeitraum:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "Inbound Gruppen: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ÄNDERN Sie | "; +echo "REPORTS | "; +echo "GENAUERER 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 "Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden\n";
+}
+
+else
+{
+
+
+echo "VICIDIAL: IVR Stats: $group_string          $NOW_TIME\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 CALLS 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 "---------- TIME STATS\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 "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN 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/LANG_www/vicidial_de/AST_VDADstats.php b/LANG_www/vicidial_de/AST_VDADstats.php index 323c167b..b948defc 100644 --- a/LANG_www/vicidial_de/AST_VDADstats.php +++ b/LANG_www/vicidial_de/AST_VDADstats.php @@ -1,14 +1,22 @@ LICENSE: GPLv2 -### -# CHANGES +# AST_VDADstats.php +# +# Copyright (C) 2009 Matt Florell 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 # header ("Content-type: text/html; charset=utf-8"); @@ -18,27 +26,51 @@ 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["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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} $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); +############################################# +##### 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); - $auth=$row[0]; + $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)) { @@ -53,18 +85,52 @@ $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";} -$groups_to_print = mysql_num_rows($rslt); +$campaigns_to_print = mysql_num_rows($rslt); $i=0; -while ($i < $groups_to_print) +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_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_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++; + } ?> @@ -80,33 +146,62 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: VDAD Stats\n"; +echo "VICIDIAL: VDAD Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + echo "
\n"; +echo "
Termine:
"; +echo "\n"; +echo "\n"; echo "\n"; -echo "\n"; +echo "
Kampagnen:
"; +echo "\n"; +echo "
Shift:
"; echo "\n"; +echo "

\n"; echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " ÄNDERN Sie | \n"; + echo " REPORTS \n"; + } +else + { + echo " CAMPAIGNS | \n"; + echo " REPORTS \n"; + } +echo "
"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if (strlen($group[0]) < 1)
 {
 echo "\n\n";
 echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n";
@@ -134,7 +229,7 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
@@ -144,27 +239,29 @@ 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_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 
 $TOTALcalls =	sprintf("%10s", $row[0]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
 	{$average_hold_seconds = '         0';}
 else
 	{
-	$average_hold_seconds = ($row[1] / $row[0]);
+	$average_hold_seconds = ($TOTALsec / $row[0]);
 	$average_hold_seconds = round($average_hold_seconds, 2);
 	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
 	}
 echo "Gesamtanrufe gesetzt von dieser Kampagne:                       $TOTALcalls\n";
 echo "Durchschnittliche Anruf-Länge für alle benennt in den Sekunden: $average_hold_seconds\n";
 
+
 echo "\n";
 echo "---------- DROPS\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -172,11 +269,56 @@ $DROPcalls =	sprintf("%10s", $row[0]);
 $DROPcallsRAW =	$row[0];
 $DROPseconds =	$row[1];
 
-$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');";
+
+# 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]";
+	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) {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]";
+	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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
-$ANSWERcalls =	$row[0];
+$ANTWORTcalls =	$row[0];
 
 if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
 	{$DROPpercent = '0';}
@@ -186,12 +328,12 @@ else
 	$DROPpercent = round($DROPpercent, 2);
 	}
 
-if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
-	{$DROPANSWERpercent = '0';}
+if ( ($DROPcalls < 1) or ($ANTWORTcalls < 1) )
+	{$DROPANTWORTpercent = '0';}
 else
 	{
-	$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
-	$DROPANSWERpercent = round($DROPANSWERpercent, 2);
+	$DROPANTWORTpercent = (($DROPcallsRAW / $ANTWORTcalls) * 100);
+	$DROPANTWORTpercent = round($DROPANTWORTpercent, 2);
 	}
 
 if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
@@ -204,13 +346,56 @@ else
 	}
 
 echo "Gesamt-TROPFEN Anrufe:                                          $DROPcalls  $DROPpercent%\n";
-echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ANSWERcalls  $DROPANSWERpercent%\n";
+echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ANTWORTcalls  $DROPANTWORTpercent%\n";
 echo "Durchschnittliche Länge für TROPFEN Anrufe in den Sekunden:     $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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$TOTALanswers = ($row[0] + $ANTWORTcalls);
+
+
+$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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$agent_non_pause_sec = $row[0];
+
+if ($agent_non_pause_sec > 0)
+	{
+	$AVG_ANTWORTagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+	$AVG_ANTWORTagent_non_pause_sec = round($AVG_ANTWORTagent_non_pause_sec, 2);
+	}
+else
+	{$AVG_ANTWORTagent_non_pause_sec=0;}
+$AVG_ANTWORTagent_non_pause_sec = sprintf("%10s", $AVG_ANTWORTagent_non_pause_sec);
+
+echo "Productivity Rating:                          $AVG_ANTWORTagent_non_pause_sec\n";
+
+
+
+
 echo "\n";
 echo "----------AUTO-DIAL KEINE ANTWORTEN\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
+$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','B') and (length_in_sec <= 60 or length_in_sec is null);";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -237,6 +422,49 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls  $NApercent%\n";
 echo "Durchschnittliche Anruf-Länge für Na benennt in den Sekunden:   $average_na_seconds\n";
 
 
+##############################
+#########  CALL HANGUP REASON STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CALL HANGUP GRUND STATS\n";
+echo "+----------------------+------------+\n";
+echo "| HANGUP REASON        | CALLS      |\n";
+echo "+----------------------+------------+\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) {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 ANTWORT           ';}
+	if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
+
+	echo "| $reason | $REASONcount |\n";
+
+	$i++;
+	}
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "+----------------------+------------+\n";
+echo "| TOTAL:               | $TOTALcalls |\n";
+echo "+----------------------+------------+\n";
+
+
+
+
+
 ##############################
 #########  CALL STATUS STATS
 
@@ -244,36 +472,25 @@ $TOTALcalls = 0;
 
 echo "\n";
 echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
+echo "|        |                      |                      |            |      CALL TIME                   |MITTELTIME|\n";
+echo "| STATUS | DESCRIPTION          | KATEGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
 
-$stmt="SELECT * from vicidial_statuses order by status";
+
+## 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' $group_SQLand and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
 $rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
-
-$o=0;
-while ($statuses_to_print > $o) 
+$Ctally_to_print = mysql_num_rows($rslt);
+if ($Ctally_to_print > 0) 
 	{
 	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
+	$AGENTsec = "$rowx[0]";
 	}
 
-$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+## get counts and time totals for all statuses in this campaign
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END'  $group_SQLand group by status;";
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -283,34 +500,180 @@ while ($i < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
 
-	$TOTALcalls = ($TOTALcalls + $row[0]);
+	$STATUScount =	$row[0];
+	$RAWstatus =	$row[1];
+	$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 + $row[0]);
+	$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );
+		$STATUSrate =	sprintf("%.2f", $STATUSrate);
+	$AGENTrate =	($STATUScount / ($AGENTsec / 3600) );
+		$AGENTrate =	sprintf("%.2f", $AGENTrate);
+
+	$STATUShours_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
 
 	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[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);}
+	$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);}	
+		$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');}	
+		$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 | $STATUScount |\n";
+	echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
 
 	$i++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+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_H =	($AGENTsec / 3600);
+	$aTOTALhours_H_int = round($aTOTALhours_H, 2);
+	$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
+	$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
+	$aTOTALhours_M = ($aTOTALhours_M * 60);
+	$aTOTALhours_M_int = round($aTOTALhours_M, 2);
+	$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
+	$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
+	$aTOTALhours_S = ($aTOTALhours_S * 60);
+	$aTOTALhours_S = round($aTOTALhours_S, 0);
+	if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
+	if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
+	$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
+
+	$TOTALhours_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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);}
+
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+echo "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |          |\n";
+echo "|   MITTELTIME                                                      | $aTOTALhours |                     | $aTOTALrate |\n";
+echo "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
+
+
+
+##############################
+#########  STATUS CATEGORY STATS
+
+echo "\n";
+echo "---------- CUSTOM STATUS KATEGORIE STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| KATEGORIE             | 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";
 
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
 
 
 ##############################
@@ -327,7 +690,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| MITTEL                   | CALLS      | TIME M   | AVRG M |\n";
 echo "+--------------------------+------------+----------+--------+\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' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
+$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) {echo "$stmt\n";}
@@ -354,8 +717,8 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
 	$USERtotTALK_S = ($USERtotTALK_S * 60);
 	$USERtotTALK_S = round($USERtotTALK_S, 0);
@@ -364,8 +727,8 @@ while ($i < $users_to_print)
 	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
 	$USERavgTALK_S = ($USERavgTALK_S * 60);
 	$USERavgTALK_S = round($USERavgTALK_S, 0);
@@ -382,8 +745,8 @@ if (!$TOTcalls) {$TOTcalls = 1;}
 $TOTavg = ($TOTtime / $TOTcalls);
 $TOTavg = round($TOTavg, 0);
 $TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
+$TOTavg_M_int = round($TOTavg_M, 2);
+$TOTavg_M_int = intval("$TOTavg_M_int");
 $TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
 $TOTavg_S = ($TOTavg_S * 60);
 $TOTavg_S = round($TOTavg_S, 0);
@@ -392,8 +755,8 @@ $TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
 $TOTavg =		sprintf("%6s", $TOTavg_MS);
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -406,15 +769,15 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {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_M_int = round($AVGwait_M, 2);
+$AVGwait_M_int = intval("$AVGwait_M_int");
 $AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
 $AVGwait_S = ($AVGwait_S * 60);
 $AVGwait_S = round($AVGwait_S, 0);
@@ -442,14 +805,14 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -457,42 +820,42 @@ while ($i <= 96)
 	$i++;
 
 
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -643,5 +1006,6 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php index 0e9147e8..d492bd3d 100644 --- a/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_VICIDIAL_hopperlist.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat diff --git a/LANG_www/vicidial_de/AST_admin_log_display.php b/LANG_www/vicidial_de/AST_admin_log_display.php index 77371200..176a50b9 100644 --- a/LANG_www/vicidial_de/AST_admin_log_display.php +++ b/LANG_www/vicidial_de/AST_admin_log_display.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_admin_log_display.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); @@ -106,7 +106,7 @@ echo "\n\n"; echo "
\n\n";
 
 
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
+echo "VICIDIAL Änderung der Registrierung ADMIN                             $NOW_TIME\n";
 
 #passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
 passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
diff --git a/LANG_www/vicidial_de/AST_agent_days_detail.php b/LANG_www/vicidial_de/AST_agent_days_detail.php
new file mode 100644
index 00000000..270eb9a3
--- /dev/null
+++ b/LANG_www/vicidial_de/AST_agent_days_detail.php
@@ -0,0 +1,601 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 90206-2202 - First build
+# 90225-1051 - Added CSV download option
+# 90310-0752 - Added admin header
+#
+
+
+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["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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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 "Unzulässiges Username/Kennwort:|$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 "VICIDIAL: Agent Tage Status\n";
+	echo "";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+	echo "\n";
+	echo "\n";
+	echo "
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo "Bitte wählen Sie einen Benutzernamen und Datum-Zeit oben ein und klicken dann SUBMIT\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 "VICIDIAL: Agent Days Detail: $user                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- MITTELDetails -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Days Detail: $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 "CALL 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Termine:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Kampagnen:
"; +echo "\n"; +echo "
User:
"; +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 " BENUTZER | \n";} +echo "REPORTS \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/LANG_www/vicidial_de/AST_agent_performance.php b/LANG_www/vicidial_de/AST_agent_performance.php
index 3915fd31..edfeb075 100644
--- a/LANG_www/vicidial_de/AST_agent_performance.php
+++ b/LANG_www/vicidial_de/AST_agent_performance.php
@@ -1,8 +1,8 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance.php
+# 
+# Copyright (C) 2008  Matt Florell     LICENSE: AGPLv2
+#
 # CHANGES
 #
 # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
diff --git a/LANG_www/vicidial_de/AST_agent_performance_detail.php b/LANG_www/vicidial_de/AST_agent_performance_detail.php
index d860d02c..9312a72f 100644
--- a/LANG_www/vicidial_de/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_de/AST_agent_performance_detail.php
@@ -1,13 +1,21 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance_detail.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,28 +25,53 @@ $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["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
+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["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["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["SUBMIT"]))					{$SUBMIT=$_GET["SUBMIT"];}
+	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
+
 
 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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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];
+$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))
 	{
@@ -48,14 +81,15 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     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;";
-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);
@@ -67,7 +101,6 @@ while ($i < $campaigns_to_print)
 	$i++;
 	}
 $stmt="select user_group from vicidial_user_groups;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $user_groups_to_print = mysql_num_rows($rslt);
@@ -93,9 +126,18 @@ while ($i < $user_groups_to_print)
 
 \n";
-echo "VICIDIAL: Agent Performance\n";
+echo "VICIDIAL: Agent Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + echo "
\n"; -echo "\n"; +echo "\n"; +echo "\n"; +echo " to \n"; echo "
+ \ No newline at end of file diff --git a/LANG_www/vicidial_de/AST_agent_status_detail.php b/LANG_www/vicidial_de/AST_agent_status_detail.php new file mode 100644 index 00000000..1d9cd3da --- /dev/null +++ b/LANG_www/vicidial_de/AST_agent_status_detail.php @@ -0,0 +1,665 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# + + +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["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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Unzulässiges Username/Kennwort:|$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++; + } +$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 + { + $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 "VICIDIAL: Agent Tage Status\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 "Bitte wählen Sie eine Kampagne oder Benutzergruppe und Datum-Zeit oben ein und klicken dann SUBMIT\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 "VICIDIAL: Agent Status Detail                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- MITTELDetails -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Status Detail                     $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) )
+			{
+			$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 "CALL 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=$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 ( ($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 |";
+				}
+			### 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Termine:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Kampagnen:
"; +echo "\n"; +echo "
Benutzer-Gruppen:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " REPORTS \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/LANG_www/vicidial_de/AST_agent_time_sheet.php b/LANG_www/vicidial_de/AST_agent_time_sheet.php
index 5bf7c948..785bfde1 100644
--- a/LANG_www/vicidial_de/AST_agent_time_sheet.php
+++ b/LANG_www/vicidial_de/AST_agent_time_sheet.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
-###
+# AST_agent_time_sheet.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,13 +19,15 @@ $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"];}
+	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"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
+	elseif (isset($_POST["SUBMIT"]))	{$SUBMIT=$_POST["SUBMIT"];}
+
+$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);
@@ -62,11 +66,32 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 \n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "VICIDIAL ADMIN: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Ändern Sie Benutzer\n";
+echo "VICIDIAL: Agent Time Sheet";
+
+
+##### 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 "AgentTime Sheetfor: $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";
@@ -97,7 +122,7 @@ if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $full_name = $row[0];
 
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
+echo "VICIDIAL: AgentTime Sheet                            $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- MITTELTIME SHEET: $agent - $full_name -------------\n\n";
@@ -277,6 +302,104 @@ $login_time = ($end - $start);
 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 LOGIN/LOGOUT ZEIT:</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>FALL </td><td align=right><font size=2>DATUM</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:MINUTES</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 = ($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><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_int:$event_minutes_int";
+			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 = ($total_login_time / 3600);
+$total_login_hours_int = round($total_login_hours, 2);
+$total_login_hours_int = intval("$total_login_hours_int");
+$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";}
+
+	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_int:$total_login_minutes_int  </td></tr>\n";
+
+echo "</TABLE>\n";
+
+
+
 }
 
 
diff --git a/LANG_www/vicidial_de/AST_inboundEXTstats.php b/LANG_www/vicidial_de/AST_inboundEXTstats.php
index bf046253..bdcc19db 100644
--- a/LANG_www/vicidial_de/AST_inboundEXTstats.php
+++ b/LANG_www/vicidial_de/AST_inboundEXTstats.php
@@ -1,7 +1,7 @@
 <? 
 # AST_inboundEXTstats.php
 # 
-# Copyright (C) 2006  Matt Florell <vicidial@gmail.com>    LICENSE: GPLv2
+# Copyright (C) 2008  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
 #
 # CHANGES
 # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
@@ -76,7 +76,7 @@ while ($i < $inbound_to_print)
  </STYLE>
 
 <? 
-echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
+echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
 #echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
 echo "<TITLE>ASTERISK: Inbound Anruf-Notfall\n";
 echo "
\n"; diff --git a/LANG_www/vicidial_de/AST_server_performance.php b/LANG_www/vicidial_de/AST_server_performance.php index d727c21a..cf90e55b 100644 --- a/LANG_www/vicidial_de/AST_server_performance.php +++ b/LANG_www/vicidial_de/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - 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 # require("dbconnect.php"); @@ -16,8 +18,6 @@ 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["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"];} @@ -54,9 +54,8 @@ $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($begin_query_time)) {$begin_query_time = '09:00:00';} -if (!isset($end_query_time)) {$end_query_time = '15:30:00';} +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;"; @@ -85,11 +84,18 @@ while ($i < $servers_to_print) \n"; -echo "VICIDIAL: Server Performance\n"; +echo "VICIDIAL: Server Performance\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + + echo "\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; +echo "Date/Time Range: \n"; +echo "to \n"; echo "Server:
+ \ No newline at end of file diff --git a/LANG_www/vicidial_de/AST_timeonVDAD.php b/LANG_www/vicidial_de/AST_timeonVDAD.php index 5c3948f6..87dc08c5 100644 --- a/LANG_www/vicidial_de/AST_timeonVDAD.php +++ b/LANG_www/vicidial_de/AST_timeonVDAD.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonVDAD.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # live real-time stats for the VICIDIAL Auto-Dialer # # CHANGES @@ -10,6 +10,9 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -110,8 +113,15 @@ if ($closer_display>0) \n"; echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
+echo "VICIDIAL: Time On VDAD\n";
+
+$short_header=1;
+
+require("admin_header.php");
+
+echo "
"; + +echo "
";
 
 ###################################################################################
 ###### SERVER INFORMATION
@@ -137,15 +147,15 @@ echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    0)
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 }
 else
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+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;";
@@ -158,18 +168,77 @@ $talking_to_print = mysql_num_rows($rslt);
 	while ($i < $talking_to_print)
 		{
 		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
+		$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])) 
 			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('R/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
 			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
+		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", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
+		$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) )
 			{
@@ -177,8 +246,8 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cc[$i]++;
 			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
 			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
+		$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) )
 			{
@@ -186,10 +255,10 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cd[$i]++;
 			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
 			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
+		$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);
@@ -206,7 +275,7 @@ $talking_to_print = mysql_num_rows($rslt);
 			$G = '';		$EG = '';
 			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
+			if (eregi("PAUSED",$Sstatus[$i])) 
 				{
 				if ($call_time_M_int >= 1) 
 					{$i++; continue;} 
@@ -214,7 +283,7 @@ $talking_to_print = mysql_num_rows($rslt);
 					{$G=''; $EG='';}
 				}
 			$agentcount++;
-			echo "| $G$extension[$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";
+			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++;
 		}
@@ -259,18 +328,18 @@ $talking_to_print = mysql_num_rows($rslt);
 		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
 
-			echo "| $G$extension[$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";
+			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 "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 		echo "  $i Mittel geloggt innen auf Bediener $server_ip\n\n";
 	#	echo "             - 5 Minuten oder mehr beim Anruf\n";
 	#	echo "             - Über 10 Minuten beim Anruf\n";
 		}
 	else
 		{
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
 		echo "  $agentcount Mittel geloggt innen auf Bediener $server_ip\n\n";
 
 		echo "             - Pausierte Mittel\n";
@@ -370,5 +439,6 @@ $parked_to_print = mysql_num_rows($rslt);
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_de/AST_timeonVDADall.php b/LANG_www/vicidial_de/AST_timeonVDADall.php index f74eda63..0a84bd4c 100644 --- a/LANG_www/vicidial_de/AST_timeonVDADall.php +++ b/LANG_www/vicidial_de/AST_timeonVDADall.php @@ -1,826 +1,1662 @@ - LICENSE: GPLv2 -# -# 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 (Chris Doyle) -# 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 -# - -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["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -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($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} -if (!isset($usergroup)) {$usergroup='';} -if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes -if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name -if (!isset($orderby)) {$orderby='timeup';} -if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes - -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]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $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); - - -$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 "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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++; - } - -$stmt="select * from vicidial_user_groups;"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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=''; - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Kampagne: $group\n"; -echo "\n"; -echo "VICIDIAL Kampagne: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -if ($UGdisplay > 0) - { - echo "\n"; - } -echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       ÄNDERN Sie | \n"; -echo "SUMMARY | \n"; -echo "REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $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) from vicidial_campaigns;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select count(*) from vicidial_hopper;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="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),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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 LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "
"; - -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -if ($UGdisplay>0) - { - echo "       Verberge USER GROUP"; - } -else - { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       Zeige MITTELID"; - } -else - { - echo "       Zeige MITTELNAME"; - } -if ($SERVdisplay>0) - { - echo "       Verberge BEDIENERINFO"; - } -else - { - echo "       Zeige BEDIENERINFO"; - } -echo "
"; - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if ($campaign_allow_inbound > 0) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} - $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;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - 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"; - } - else - { - echo "KEIN PHASENCANKLOPFEN\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Kampagne: $group $NOW_TIME\n\n"; - - -$HDbegin = "+"; -$HTbegin = "|"; -$HDstation = "------------+"; -$HTstation = " STATION |"; -$HDuser = "--------------------+"; -$HTuser = " USER |"; -$HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; -$HDsessionid = "------------------+"; -$HTsessionid = " SESSIONID |"; -$HDbarge = "-------+"; -$HTbarge = " BARGE |"; -$HDstatus = "----------+"; -$HTstatus = " STATUS |"; -$HDserver_ip = "-----------------+"; -$HTserver_ip = " BEDIENERIP |"; -$HDcall_server_ip = "-----------------+"; -$HTcall_server_ip = " CALL BEDIENERIP |"; -$HDtime = "---------+"; -$HTtime = " MM:SS |"; -$HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; - -if ($UGdisplay < 1) - { - $HDusergroup = ''; - $HTusergroup = ''; - } -if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) - { - $HDsessionid = "-----------+"; - $HTsessionid = " SESSIONID |"; - } -if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) - { - $HDbarge = ''; - $HTbarge = ''; - } -if ($SERVdisplay < 1) - { - $HDserver_ip = ''; - $HTserver_ip = ''; - $HDcall_server_ip = ''; - $HTcall_server_ip = ''; - } - - - -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; -$Aecho .= "$Aline"; -$Aecho .= "$Bline"; -$Aecho .= "$Aline"; - -if ($orderby=='timeup') {$orderSQL='status,last_call_time';} -if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} -if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';} -if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';} -if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';} -if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time 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 ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} -if (strlen($usergroup)<1) {$usergroupSQL = '';} -else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} - -$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - -#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;"; - -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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]; - } - if ($non_latin < 1) - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - } - else - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-40s", $extension); - while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} - } - $Luser = $row[1]; - $user = sprintf("%-18s", $row[1]); - $Lsessionid = $row[2]; - $sessionid = sprintf("%-9s", $row[2]); - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $comments= $row[11]; - - if (eregi("INCALL",$Lstatus)) - { - if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) - {$CM='A';} - else - { - if (eregi("INBOUND",$comments)) - {$CM='I';} - else - {$CM='M';} - } - } - else {$CM=' ';} - - if ($UGdisplay > 0) - { - if ($non_latin < 1) - { - $user_group = sprintf("%-12s", $row[9]); - while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} - } - else - { - $user_group = sprintf("%-40s", $row[9]); - 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("%-18s", $row[10]); - while(strlen($user)>18) {$user = substr("$user", 0, -1);} - } - else - { - $user = sprintf("%-40s", $row[10]); - while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} - } - } - 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 ($Lstatus=='INCALL') - { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - } - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - $G=''; $EG=''; - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$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_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$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 ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} - else {$UGD = "";} - - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} - else {$SVD = "";} - - $agentcount++; - - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "$Aline"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load 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"; - - 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 "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "KEINE MITTEL BEI DEN ANRUFEN\n";
-	}
-
-?>
-
- - + 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 +# + +$version = '2.0.5-36'; +$build = '90310-0906'; + +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["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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +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["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} + +############################################# +##### 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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +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=0;} # 0=id, 1=name +if (!isset($orderby)) {$orderby='timeup';} +if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 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='N';} # 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]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $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); + + +$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 "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DAY = date("Y-m-d"); +$NOW_HOUR = date("H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id,campaign_name 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; + $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++; + } +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)"; + } + +#if ( (eregi('ALL-ACTIVE',$group_string)) and ($with_inbound=='O') and ($outbound_autodial_active > 0) ) +# {$with_inbound='N';} + +$stmt="select * 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_list .= ""; +$select_list .= "
Select Kampagnen:
"; +$select_list .= ""; +$select_list .= "
(Um mehr als 1 Kampagne, halten Sie die Strg-Taste gedrückt und klicken Sie auf)"; +$select_list .= "
"; +$select_list .= "Fenster schließen

"; + +if ($UGdisplay > 0) + { + $select_list .= "Select Benutzer-Gruppe:
"; + $select_list .= "

"; + } + +$select_list .= "   Inbound:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "VERSION: $version   BAU: $build"; +$select_list .= "
"; + +$open_list = "
Wählen Sie Report anzeigen Optionen
"; + +?> + + + + + + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id IN($group_SQL) and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Kampagne: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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 "VICIDIAL Real-Time                                                                          \n"; +echo "\n"; +echo "
\n"; +echo "Wählen Sie Report anzeigen Optionen"; +echo "
\n"; +echo "
\n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ÄNDERN Sie | \n"; + } +else + { + echo "       ÄNDERN Sie | \n"; + } +echo "SUMMARY \n"; +echo "\n\n"; + + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$multi_drop=0; + +##### INBOUND ONLY ### +if (ereg('O',$with_inbound)) + { + $multi_drop++; + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + if ($adastats>1) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ANTWORTagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ANTWORTagent_non_pause_sec = round($AVG_ANTWORTagent_non_pause_sec, 2); + $AVG_ANTWORTagent_non_pause_sec = sprintf("%01.2f", $AVG_ANTWORTagent_non_pause_sec); + } + else + {$AVG_ANTWORTagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ANTWORTagent_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  
ANTWORTS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + + } + + $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);"; + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + + + if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";} + + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_pause_codes_active = $row[0]; + + $rslt=mysql_query($stmtC, $link); + $row=mysql_fetch_row($rslt); + $agent_non_pause_sec = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ANTWORTagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ANTWORTagent_non_pause_sec = round($AVG_ANTWORTagent_non_pause_sec, 2); + $AVG_ANTWORTagent_non_pause_sec = sprintf("%01.2f", $AVG_ANTWORTagent_non_pause_sec); + } + else + {$AVG_ANTWORTagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ANTWORTagent_non_pause_sec=0; + } + + 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 ""; + } + +##### NOT INBOUND ONLY ### +else + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $multi_drop++; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; + + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; + } + else + { + if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} + + if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) + { + $multi_drop++; + $stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $c=0; + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active 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) 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]; + $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); + $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); + $agent_pause_codes_active = $row[19]; + + + $stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select count(*) from vicidial_hopper;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDhop = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $DAleads = $row[0]; + $callsTODAY = $row[1]; + $dropsTODAY = $row[2]; + $drpctTODAY = $row[3]; + $diffONEMIN = $row[4]; + $agentsONEMIN = $row[5]; + $balanceFILL = $row[6]; + $answersTODAY = $row[7]; + if ($multi_drop > 0) + { + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + } + $VSCcat1 = $row[8]; + $VSCcat1tally = $row[9]; + $VSCcat2 = $row[10]; + $VSCcat2tally = $row[11]; + $VSCcat3 = $row[12]; + $VSCcat3tally = $row[13]; + $VSCcat4 = $row[14]; + $VSCcat4tally = $row[15]; + + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } + else {$diffpctONEMIN = '0.00';} + + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $balanceSHORT = $row[0]; + + 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  
ANTWORTS TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_ANTWORTagent_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 ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANTWORTED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "       Verberge User Group"; + } +else + { + echo "       VIEW User Group"; + } +if ($UidORname>0) + { + echo "       Zeige MITTELID"; + } +else + { + echo "       Zeige MITTELNAME"; + } +if ($SERVdisplay>0) + { + echo "       Verberge BEDIENERINFO"; + } +else + { + echo "       Zeige BEDIENERINFO"; + } +if ($CALLSdisplay>0) + { + echo "       Verberge WAITING CALLS"; + } +else + { + echo "       Zeige WAITING CALLS"; + } +if ($PHONEdisplay>0) + { + echo "       Verberge PHONES"; + } +else + { + echo "       Zeige PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       Verberge CUSTPHONES"; + } +else + { + echo "       Zeige CUSTPHONES"; + } +echo "
"; + +echo "\n\n"; +} +################################################################################### +###### INBOUND/OUTBOUND CALLS +################################################################################### +if ($campaign_allow_inbound > 0) + { + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $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); + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; + } +else + { + if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} + else {$UgroupSQL = " and campaign_id IN($group_SQL)";} + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;"; + } +if ($CALLSdisplay > 0) + { + $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority"; + } +else + { + $stmtA = "SELECT status"; + } + + +$k=0; +$stmt = "$stmtA $stmtB"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + $in_ivr=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + { + $out_live++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + else + { + if (eregi("IVR",$row[0])) + { + $in_ivr++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + + $out_total++; + $i++; + } + + ##### MIDI alert audio file test ##### + # $test_midi=1; + # if ($test_midi > 0) + # { + # # echo ""; + # # echo ""; + # 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 "KEIN PHASENCANKLOPFEN\n"; + } + + + +################################################################################### +###### CALLS WAITING +################################################################################### + +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY |\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-12s", $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]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_M = ($Ccall_time_S / 60); + $Ccall_time_M = round($Ccall_time_M, 2); + $Ccall_time_M_int = intval("$Ccall_time_M"); + $Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int); + $Ccall_time_SEC = ($Ccall_time_SEC * 60); + $Ccall_time_SEC = round($Ccall_time_SEC, 0); + if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";} + $Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC"; + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + $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 |\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: Agents Time On Calls Kampagne: $group_string $NOW_TIME\n"; + + +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "------------+"; +$HTstation = " STATION |"; +$HDphone = "------------+"; +$HTphone = " PHONE |"; +$HDuser = "--------------------+"; +$HTuser = " USER |"; +$HDusergroup = "--------------+"; +$HTusergroup = " User Group |"; +$HDsessionid = "------------------+"; +$HTsessionid = " SESSIONID |"; +$HDbarge = "-------+"; +$HTbarge = " BARGE |"; +$HDstatus = "----------+"; +$HTstatus = " STATUS |"; +$HDcustphone = "------------+"; +$HTcustphone = " CUST PHONE |"; +$HDserver_ip = "-----------------+"; +$HTserver_ip = " BEDIENERIP |"; +$HDcall_server_ip = "-----------------+"; +$HTcall_server_ip = " CALL BEDIENERIP |"; +$HDtime = "---------+"; +$HTtime = " MM:SS |"; +$HDcampaign = "------------+"; +$HTcampaign = " CAMPAIGN |"; +$HDcalls = "-------+"; +$HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; + +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) && ($IAXmonitorLINK<1) ) + { + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; + } +if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) + { + $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\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\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 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]; + + $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'"; + } + + $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]=$Acall_finish[$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("%-10s", $extension); + while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} + } + else + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-40s", $extension); + while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} + } + + $phone = sprintf("%-10s", $phone_split[0]); + $custphone = sprintf("%-10s", $custphone); + $Luser = $Auser[$i]; + $user = sprintf("%-18s", $Auser[$i]); + $Lsessionid = $Asessionid[$i]; + $sessionid = sprintf("%-9s", $Asessionid[$i]); + $Lstatus = $Astatus[$i]; + $status = sprintf("%-6s", $Astatus[$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)) + { + ### temporarily deactivate DEAD calls display until bug is fixed + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } + + if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) + {$CM='A';} + else + { + if (eregi("INBOUND",$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("%-18s", $Afull_name[$i]); + while(strlen($user)>18) {$user = substr("$user", 0, -1);} + } + else + { + $user = sprintf("%-40s", $Afull_name[$i]); + while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} + } + } + if (!eregi("INCALL|QUEUE",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Acall_finish[$i]);} + else + {$call_time_S = ($STARTtime - $Acall_time[$i]);} + + $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 ($Lstatus=='INCALL') + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$G=''; $EG='';} + # if ($call_time_M_int >= 10) {$G=''; $EG='';} + } + if ($Lstatus=='DEAD') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_dead++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + } + } + if ($Lstatus=='DISPO') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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)) ) {$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_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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 ($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 campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' 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[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 .= " System Load 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 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 Agenten in fordert Toten      \n"; + + echo "
";
+		echo "";
+		echo "$Cecho";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo "KEINE MITTEL BEI DEN ANRUFEN\n";
+	echo "
$Cecho";
+	}
+
+?>
+
+
+ + diff --git a/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php index 44368875..b552873b 100644 --- a/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -13,6 +13,8 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -104,7 +106,14 @@ if (!isset($RR)) {$RR=4;} \n"; -echo "VICIDIAL: Realtime All Kampagnen Summary\n"; +echo "VICIDIAL: Realtime All Kampagnen Summary\n"; + + $short_header=1; + + require("admin_header.php"); + +echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -305,6 +314,7 @@ $parked_to_print = mysql_num_rows($rslt); $out_total=0; $out_ring=0; $out_live=0; + $in_ivr=0; while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); @@ -313,6 +323,8 @@ $parked_to_print = mysql_num_rows($rslt); {$out_live++;} else { + if (eregi("IVR",$row[0])) + {$in_ivr++;} if (eregi("CLOSER",$row[0])) {$nothing=1;} else @@ -334,6 +346,7 @@ $parked_to_print = mysql_num_rows($rslt); 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 { @@ -438,5 +451,6 @@ $k++; ?> +
"; + echo "VICIDIAL: Realtime All Kampagnen Summary           \n"; echo "STOP | "; echo "SLOW | "; @@ -234,7 +243,7 @@ echo "
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DROPPED / ANTWORTED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
diff --git a/LANG_www/vicidial_de/AST_timeonpark.php b/LANG_www/vicidial_de/AST_timeonpark.php index 91ba6e0f..adae33b1 100644 --- a/LANG_www/vicidial_de/AST_timeonpark.php +++ b/LANG_www/vicidial_de/AST_timeonpark.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonpark.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60620-1042 - Added variable filtering to eliminate SQL injection attack threat diff --git a/LANG_www/vicidial_de/admin.php b/LANG_www/vicidial_de/admin.php index b4f3166a..9dd6910a 100644 --- a/LANG_www/vicidial_de/admin.php +++ b/LANG_www/vicidial_de/admin.php @@ -1,14 +1,11 @@ LICENSE: GPLv2 # - +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); - ###################################################################################################### ###################################################################################################### ####### static variable settings for display options @@ -16,7 +13,7 @@ require("dbconnect.php"); ###################################################################################################### $page_width='770'; -$section_width='720'; +$section_width='750'; $header_font_size='3'; $subheader_font_size='2'; $subcamp_font_size='2'; @@ -32,22 +29,16 @@ $scripts_color = '#99FFCC'; $filters_color = '#CCCCCC'; $admin_color = '#FF99FF'; $reports_color = '#99FF33'; -#$users_color = '#FFFF99'; -#$campaigns_color = '#FFFF99'; -#$lists_color = '#FFFF99'; -#$ingroups_color = '#FFFF99'; -#$remoteagent_color ='#FFFF99'; -#$usergroups_color = '#FFFF99'; -#$scripts_color = '#FFFF99'; -#$filters_color = '#FFFF99'; -#$admin_color = '#FFFF99'; -#$reports_color = '#FFFF99'; $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'; +$subcamp_color = '#FF9933'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -64,9 +55,32 @@ $reports_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; $status_font = 'BLACK'; -$subcamp_color = '#FF9933'; $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'; +$subcamp_color = '#C6C6C6'; +### + + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -178,6 +192,8 @@ if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec 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"];} @@ -292,8 +308,8 @@ if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seco 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_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} +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"];} @@ -428,8 +444,8 @@ 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["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} +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"];} @@ -472,6 +488,8 @@ if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["update 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"];} @@ -570,7 +588,8 @@ if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["ca 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["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"];} @@ -669,6 +688,272 @@ 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($script_id)) {$script_id= strtoupper($script_id);} @@ -680,6 +965,26 @@ if (strlen($dial_status) > 0) $status = $dial_status; } +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,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]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -750,7 +1055,6 @@ $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); $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); @@ -782,7 +1086,6 @@ $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); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); $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); @@ -807,10 +1110,49 @@ $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); + +### 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("[^\n0-9]","",$phone_numbers); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -818,24 +1160,39 @@ $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); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); $selectable = ereg_replace("[^NY]","",$selectable); $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$use_campaign_dnc = ereg_replace("[^NY]","",$use_campaign_dnc); $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); -$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $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); +$disable_alter_custphone = ereg_replace("[^NY]","",$disable_alter_custphone); +$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); + +$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); + ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -853,10 +1210,19 @@ $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_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); $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); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -866,6 +1232,7 @@ $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); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -913,8 +1280,8 @@ $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); +$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); @@ -940,11 +1307,61 @@ $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); +$hold_time_option_callback_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_option_callback_filename); +$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); + +### 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 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); @@ -954,6 +1371,7 @@ $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); @@ -977,6 +1395,15 @@ $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); ### 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); @@ -994,15 +1421,36 @@ $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pas $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); +$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); + +### 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); + +### 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); +$globals_string = ereg_replace(";","",$globals_string); +$dialplan_entry = ereg_replace(";","",$dialplan_entry); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url # $admin_home_url +# $qc_web_form_address +# $vtiger_url ### VARIABLES not filtered at all ### # $script_text @@ -1141,17 +1589,74 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 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 # -# # 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.0.4-119'; -$build = '71125-1751'; +$admin_version = '2.0.5-172'; +$build = '90310-2203'; $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); @@ -1169,11 +1674,28 @@ if ($force_logout) exit; } - $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); +############################################# +##### 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); - $auth=$row[0]; + $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 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");} @@ -1196,46 +1718,50 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * 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[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]; + $stmt="SELECT * 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]; - $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]; + $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|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); } } @@ -1265,25 +1791,32 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} if ($ADD=="1") {$hh='users'; echo "Addieren Sie Neuen Benutzer";} -if ($ADD=="1A") {$hh='users'; echo "Copy Benutzer";} +if ($ADD=="1A") {$hh='users'; echo "KopierenBenutzer";} if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Addieren Sie Neue Kampagne";} -if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Kampagne";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "KopierenKampagne";} if ($ADD==111) {$hh='lists'; echo "Addieren Sie Neue Liste";} if ($ADD==121) {$hh='lists'; echo "Addieren Sie Neues DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Addieren Sie Neue In-Gruppe";} -if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Gruppe";} +if ($ADD==1211) {$hh='ingroups'; echo "KopierenIn-Gruppe";} +if ($ADD==1311) {$hh='ingroups'; echo "Add NewDID";} +if ($ADD==1411) {$hh='ingroups'; echo "KopierenDID";} if ($ADD==11111) {$hh='remoteagent'; echo "Addieren Sie Neue Remotemittel";} if ($ADD==111111) {$hh='usergroups'; echo "Addieren Sie Neue Benutzer-Gruppe";} if ($ADD==1111111) {$hh='scripts'; echo "Addieren Sie Neuen Index";} if ($ADD==11111111) {$hh='filters'; echo "Addieren Sie Neuen Filter";} if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Füge neue Anrufzeit hinzu";} +if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Add NewShift";} if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Füge neue landesspezifische Anrufzeit hinzu";} if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADDIEREN SIE NEUES TELEFON";} +if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW TEL ALIAS";} +if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN SIE NEUEN BEDIENER";} +if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Neue CONF TEMPLATE";} +if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "ADD NEW CARRIER";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN SIE NEUE KONFERENZ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD=="2") {$hh='users'; echo "Neue Benutzer-Hinzufügung";} -if ($ADD=="2A") {$hh='users'; echo "Neue Kopierte Benutzer-Hinzufügung";} +if ($ADD=='2') {$hh='users'; echo "Neue Benutzer-Hinzufügung";} +if ($ADD=='2A') {$hh='users'; echo "Neue Kopierte Benutzer-Hinzufügung";} if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Neue Kopierte Kampagne Hinzufügung";} if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Neue Kampagne Hinzufügung";} if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Neue Kampagne Status-Hinzufügung";} @@ -1296,34 +1829,55 @@ if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung F if ($ADD==211) {$hh='lists'; echo "Neue Liste Hinzufügung";} if ($ADD==2111) {$hh='ingroups'; echo "Neue In-Gruppe Hinzufügung";} if ($ADD==2011) {$hh='ingroups'; echo "Neue Kopierte In-Gruppe Hinzufügung";} +if ($ADD==2311) {$hh='ingroups'; echo "Neue DID-Zusatz";} +if ($ADD==2411) {$hh='ingroups'; echo "Neue Copied DID-Zusatz";} if ($ADD==21111) {$hh='remoteagent'; echo "Neue Remotemittel-Hinzufügung";} if ($ADD==211111) {$hh='usergroups'; echo "Neue Benutzer-Gruppe Hinzufügung";} if ($ADD==2111111) {$hh='scripts'; echo "Neue Index-Hinzufügung";} if ($ADD==21111111) {$hh='filters'; echo "Neue Filter-Hinzufügung";} if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "Neue Anrufzeit hinzufügen";} +if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "Neue Shift Zusatz";} if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "Neue landesspezifische Anrufzeit hinzufügen";} if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDIEREN DES NEUEN TELEFONS";} +if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "Neue TEL ALIAS";} +if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "Neue GROUP ALIAS";} if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN BEDIENERS";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN STAMM-SATZES DES BEDIENER-VICIDIAL";} +if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Neue CONF TEMPLATE";} +if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Neue CARRIER";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN DER NEUEN KONFERENZ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDIEREN VON VON VICIDIAL SYSTEMSTATUS";} if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDIEREN VON VON VICIDIAL STATUS-KATEGORIE";} +if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "HINZUFÜGEN VICIDIAL QC-Statuscode";} if ($ADD==3) {$hh='users'; echo "Ändern Sie Benutzer";} if ($ADD==30) {$hh='campaigns'; echo "Kampagne Nicht Erlaubt";} if ($ADD==31) - { - $hh='campaigns'; $sh='detail'; echo "Ändern Sie Kampagne - Detail - $campaign_id"; - if ($SUB==22) {echo " - Statuses";} - if ($SUB==23) {echo " - HotKeys";} - if ($SUB==25) {echo " -Leitung Bereiten AufEntries";} - if ($SUB==26) {echo " - Auto Alt Dial Statuses";} - if ($SUB==27) {echo " - Agent Pause Codes";} - if ($SUB==29) {echo " - List Mixes";} - } + { + $hh='campaigns'; $sh='detail'; echo "Ändern Sie Kampagne - Detail - $campaign_id"; + if ($SUB==22) {echo " - Status";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Leitung Bereiten AufEntries";} + if ($SUB==26) {echo " - Auto Alt Dial Status";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - US-Mixes";} + if ($SUB=='20A') {echo " - Umfrage";} + } +if ($ADD==34) + { + $hh='campaigns'; $sh='basic'; echo "Ändern Sie Kampagne - Grundlegende Ansicht - $campaign_id"; + if ($SUB==22) {echo " - Status";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Leitung Bereiten AufEntries";} + if ($SUB==26) {echo " - Auto Alt Dial Status";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - US-Mixes";} + if ($SUB=='20A') {echo " - Umfrage";} + } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Kampagne Status";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Kampagne HotKeys";} -if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Kampagne Leitung Bereiten Eintragungen Auf";} if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Kampagne Selbstalt Vorwahlknopf-Status";} if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Kampagne Mittel-Pause Codes";} @@ -1331,20 +1885,27 @@ if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-St if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischungen";} if ($ADD==311) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==3111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} +if ($ADD==3311) {$hh='ingroups'; echo "ÄndernDID";} if ($ADD==31111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} if ($ADD==311111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} if ($ADD==3111111) {$hh='scripts'; echo "Ändern Sie Index";} if ($ADD==31111111) {$hh='filters'; echo "Ändern Sie Filter";} if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Bearbeite Anrufzeit";} if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Bearbeite Anrufzeit Landdefinitions-Liste";} +if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Ändern Shift";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Bearbeite landesspezifische Anrufzeit";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "ÄNDERN SIE TELEFON";} +if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFY TEL ALIAS";} +if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "ÄNDERN SIE BEDIENER";} +if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "MODIFY CONF TEMPLATE";} +if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL SYSTEMSTATUS";} if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL STATUS-KATEGORIE";} +if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC-Statuscode";} if ($ADD=="4A") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} if ($ADD=="4B") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} if ($ADD==4) {$hh='users'; echo "Ändern Sie Benutzer";} @@ -1354,41 +1915,56 @@ if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Ändern Sie Kampagne HotKe if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Ändern Sie Kampagne Leitung Aufbereiten";} if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Ändern Sie Mittel-Pause Code";} +if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Ändern Kampagne QC Einstellungen";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Ändern Sie Kampagne Liste Mischung";} +if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Ändern Sie den Kampagnen";} if ($ADD==411) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==4111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} +if ($ADD==4311) {$hh='ingroups'; echo "ÄndernDID";} if ($ADD==41111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} if ($ADD==411111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} if ($ADD==4111111) {$hh='scripts'; echo "Ändern Sie Index";} if ($ADD==41111111) {$hh='filters'; echo "Ändern Sie Filter";} if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Bearbeite Anrufzeit";} +if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Ändern Shift";} if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Bearbeite landesspezifische Anrufzeit";} if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "ÄNDERN SIE TELEFON";} +if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFY TEL ALIAS";} +if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "ÄNDERN SIE BEDIENER";} if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "ÄNDERN SIE STAMM-SATZ DES BEDIENER-VICIDIAL";} +if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "MODIFY CONF TEMPLATE";} +if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL SYSTEMSTATUS";} if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL STATUS-KATEGORIEN";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Kampagne";} +if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC-Statuscode";} +if ($ADD==5) {$hh='users'; echo "LöschenUser";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "LöschenKampagne";} if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout-Mittel";} if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==511) {$hh='lists'; echo "LöschenList";} +if ($ADD==5111) {$hh='ingroups'; echo "LöschenIn-Group";} +if ($ADD==5311) {$hh='ingroups'; echo "LöschenDID";} if ($ADD==51111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} if ($ADD==511111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} if ($ADD==5111111) {$hh='scripts'; echo "Löschung-Index";} if ($ADD==51111111) {$hh='filters'; echo "Löschung-Filter";} if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Lösche Anrufzeit";} +if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Löschen Shift";} if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Lösche landesspezifische Anrufzeit";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE TEL ALIAS";} +if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";} if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "DELETE CONF TEMPLATE";} +if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";} 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 "Delete User";} -if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Kampagne";} +if ($ADD==6) {$hh='users'; echo "LöschenUser";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "LöschenKampagne";} if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout-Mittel";} if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Löschung-Leitung Bereiten Auf";} @@ -1396,21 +1972,31 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Selbstalt Vorwahlknopf-St if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Löschung-Mittel-Pause Code";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status Entfernt";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung Entfernte";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==611) {$hh='lists'; echo "LöschenList";} +if ($ADD==6111) {$hh='ingroups'; echo "LöschenIn-Group";} +if ($ADD==6311) {$hh='ingroups'; echo "LöschenDID";} if ($ADD==61111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} if ($ADD==611111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} if ($ADD==6111111) {$hh='scripts'; echo "Löschung-Index";} if ($ADD==61111111) {$hh='filters'; echo "Löschung-Filter";} if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Lösche Anrufzeit";} +if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Löschen Shift";} if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Lösche landesspezifische Anrufzeit";} if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE TEL ALIAS";} +if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";} if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "STAMM-SATZ DES LÖSCHUNG-BEDIENER-VICIDIAL";} +if ($ADD==621111111111) {$hh='admin'; $sh='templates'; echo "DELETE CONF TEMPLATE";} +if ($ADD==621111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";} 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 "Anzahl anrufbarer Anschlüsse";} if ($ADD==7111111) {$hh='scripts'; echo "Vorbetrachtung-Index";} +if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL Änderung der Registrierung ADMIN";} +if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL USER ADMIN Änderung der Registrierung";} +if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL ABSCHNITT ADMIN Änderung der Registrierung";} +if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL DETAIL ADMIN Änderung der Registrierung";} if ($ADD==0) {$hh='users'; echo "Benutzer-Liste";} if ($ADD==8) {$hh='users'; echo "Wiederholungsbesuche Innerhalb Des Mittels";} if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Wiederholungsbesuche Innerhalb Der Kampagne";} @@ -1419,14 +2005,20 @@ if ($ADD==8111) {$hh='usergroups'; echo "Wiederholungsbesuche Innerhalb Der Be if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Kampagnen";} if ($ADD==100) {$hh='lists'; echo "Listen";} if ($ADD==1000) {$hh='ingroups'; echo "In-Gruppen";} +if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} if ($ADD==10000) {$hh='remoteagent'; echo "Remotemittel";} if ($ADD==100000) {$hh='usergroups'; echo "Benutzer-Gruppen";} if ($ADD==1000000) {$hh='scripts'; echo "Indexe";} if ($ADD==10000000) {$hh='filters'; echo "Filter";} if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Anrufzeiten";} +if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Verschiebungen";} if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "Landesspezische Anrufzeiten";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "TELEFON-LISTE";} +if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "TEL ALIAS LISTE";} +if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "GROUP ALIAS LISTE";} if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "BEDIENER-LISTE";} +if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "CONF Vorlagenliste";} +if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "CARRIER LISTE";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "KONFERENZ-LISTE";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL KONFERENZ-LISTE";} if ($ADD==550) {$hh='users'; echo "Suchform";} @@ -1507,7 +2099,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) @@ -1522,30 +2114,40 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($campaigns_to_print > $o) { - $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$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]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else - {$calls_today=0; $SELECT_campaign_rank=0;} + {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { 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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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); } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $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); } @@ -1600,8 +2202,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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></tr>\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 ##### @@ -1609,7 +2214,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD ##### BEGIN get inbound groups listing for checkboxes ##### $xfer_groupsSQL=''; - if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) + 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); @@ -1659,12 +2264,13 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $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>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($groups_to_print > $o) @@ -1678,14 +2284,17 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($groups_to_print > $o) { - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$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]; + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else {$calls_today=0; $SELECT_group_rank=0;} @@ -1693,15 +2302,23 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { 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' where group_id='$group_id_values[$o]' and user='$user';"; + $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); } 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';"; + $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); } @@ -1741,7 +2358,12 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $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"; @@ -1754,8 +2376,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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></tr>\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 .= " -";} @@ -1769,16 +2394,26 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) ) { - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';"; + $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]; + $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-CAMPAIGNS-"'; + $qc_campaigns_value=''; + $qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPAIGNS-"'; + $qc_groups_value=''; + $qc_groups_list='<B><input type="checkbox" name="qc_groups[]" value="-ALL-GROUPS-"'; $p=0; while ($p<100) { @@ -1787,9 +2422,21 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_list.=" CHECKED"; $campaigns_value .= " -ALL-CAMPAIGNS- -"; } + if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) + { + $qc_campaigns_list.=" CHECKED"; + $qc_campaigns_value .= " -ALL-CAMPAIGNS- -"; + } + if (eregi('ALL-GROUPS',$qc_groups[$p])) + { + $qc_groups_list.=" CHECKED"; + $qc_groups_value .= " -ALL-GROUPS- -"; + } $p++; } $campaigns_list.="> ALL-CAMPAIGNS - BENUTZER KÖNNEN JEDE MÖGLICHE KAMPAGNE ANSEHEN</B><BR>\n"; + $qc_campaigns_list.="> ALL-CAMPAIGNS - Benutzer können alle Kampagnen, QC</B><BR>\n"; + $qc_groups_list.="> ALL-GROUPS - Benutzer können QC JEDENFALLS INBOUND GROUP</B><BR>\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); @@ -1802,6 +2449,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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<100) { @@ -1811,18 +2459,52 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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<100) + { + if ($group_id_value == $qc_groups[$p]) + { + $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) ) + 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"; @@ -1900,6 +2582,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Telefon-Durchlauf -</B> Für hier ist, wo Sie einen RückstellungTelefon-Durchlaufwert wenn die Benutzermaschinenbordbücher invicidial.php einstellen können. Dieser Wert bevölkert die phone_passautomatisch wenn die Benutzermaschinenbordbücher innen mit ihrerBenutzer-überschreiten-Kampagne auf dem vicidial.php LOGON-Schirm. +<BR> +<A NAME="vicidial_users-active"> +<BR> +<B>Aktive - </B> Dieses Feld legt fest, ob der Benutzer in das System und können VICIDIAL Ressourcen. Der Standardwert ist Y + <BR> <A NAME="vicidial_users-hotkeys_active"> <BR> @@ -1935,31 +2622,53 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Vicidial Übertragungen -</B> Diese Wahl kann verhindern, daß einMittel die Übertragung - Konferenzlernabschnitt von vicidial öffnet.Wenn dieses untauglich ist, kann das Mittel nicht dritterParteianruf, oder blinde Übertragung irgendeine benennt. -<BR> -<A NAME="vicidial_users-closer_default_blended"> -<BR> -<B>Genauere Rückstellung gemischt -</B> Diese Wahl fällt einfach dasgemischte checkbox auf einem GENAUEREN LOGON-Schirm zurück. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-closer_default_blended"> + <BR> + <B>Genauere Rückstellung gemischt -</B> Diese Wahl fällt einfach dasgemischte checkbox auf einem GENAUEREN LOGON-Schirm zurück. + <? + } +?> <BR> <A NAME="vicidial_users-vicidial_recording_override"> <BR> <B>VICIDIAL Aufnahme-Übersteuerung -</B> diese Wahl läuft über, was auchimmer die Wahl in der Kampagne für Aufnahme ist. UNTAUGLICH läuftnicht die Kampagne Aufnahmeeinstellung über. NIE sperrt Aufnahme aufdem Klienten. ONDEMAND ist die Rückstellung und erlaubt dem Vertreterzu notieren zu beginnen und, zu stoppen, wie gebraucht. ALLCALLSbeginnt Aufnahme auf dem Klienten, wann immer ein Anruf zu einemMittel geschickt wird. ALLFORCE beginnt Aufnahme auf dem Klienten,wann immer ein Anruf zu einem Mittel geschickt wird, das dem Mittelkeine Wahl gibt, um zu notieren zu stoppen. Für ALLCALLS und ALLFORCEgibt es eine Wahl, zum der Aufnahme zu benutzen verzögert, um untenauf sehr kurze Aufnahmen und recude Anlagen-Belastung zu schneiden. +<BR> +<A NAME="vicidial_users-agent_shift_enforcement_override"> +<BR> +<B>Agent Shift Vollstreckung Override -</B> Diese Einstellung überschreibt, was die Benutzer Benutzer-Gruppe hat für die Vollstreckung Shift. DEAKTIVIERT wird die Benutzergruppe Einstellung. AUS wird nicht in allen Schichten durchzusetzen. START wird nur die Durchsetzung der Login-Zeit, sondern wirkt sich nicht auf einen Vertreter, der mit über die Verlagerung, wenn sie bereits eingeloggt ALL wird durchzusetzen Verlagerung starten und meldet einen Agenten aus, nachdem sie über das Ende ihrer Schicht Zeit. Option ist standardmäßig deaktiviert. + +<BR> +<A NAME="vicidial_users-alert_enabled"> +<BR> +<B>Alarm aktiv - </B> Dieses Feld zeigt an, ob der Agent hat Warnungen Web-Browser aktiviert, wenn Anrufe in Berührung kommen, ihre vicidial.php Sitzung. Der Standardwert ist 0 für NO. + <BR> <A NAME="vicidial_users-vicidial_users-campaign_ranks"> <BR> -<B>Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird. +<B>Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird. Auch in diesem Abschnitt sind die WEB VARs für jede Kampagne. Diese ermöglichen es jedem Agenten zu haben, eine andere Variable Zeichenfolge, die hinzugefügt werden können, um die Web-Formular oder SCRIPT Registerkarte URLs, indem Sie einfach setzen - A - web_vars - B - wie Sie würde jedem anderen Bereich. <BR> <A NAME="vicidial_users-closer_campaigns"> <BR> -<B>Inbound Gruppen -</B> Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. SieSIND auch in der Lage, den Rank oder Fähigkeit Niveaueinzustellen, in diesem Abschnitt für jede der inbound Gruppen sowieIn der LageSEIN, die Zahl den Anrufen zu sehen, die von jeder inboundGruppe für dieses spezifische Mittel empfangen werden. Auch in diesem Abschnitt ist die Fähigkeit, dem Mittel einen Rankfür jede inbound Gruppe zu geben. Diese Rank können für bevorzugteAnrufwegewahl verwendet werden, wenn diese Wahl auf dem IngruppeSchirm vorgewählt wird. +<B>Inbound Gruppen -</B> Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. SieSIND auch in der Lage, den Rank oder Fähigkeit Niveaueinzustellen, in diesem Abschnitt für jede der inbound Gruppen sowieIn der LageSEIN, die Zahl den Anrufen zu sehen, die von jeder inboundGruppe für dieses spezifische Mittel empfangen werden. Auch in diesem Abschnitt ist die Fähigkeit, dem Mittel einen Rankfür jede inbound Gruppe zu geben. Diese Rank können für bevorzugteAnrufwegewahl verwendet werden, wenn diese Wahl auf dem IngruppeSchirm vorgewählt wird. Auch in diesem Abschnitt sind die WEB VARs für jede Kampagne. Diese ermöglichen es jedem Agenten zu haben, eine andere Variable Zeichenfolge, die hinzugefügt werden können, um die Web-Formular oder SCRIPT Registerkarte URLs, indem Sie einfach setzen - A - web_vars - B - wie Sie würde jedem anderen Bereich. <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> <B>Mittel ändern Kunde Daten-Übersteuerung -</B> diese Wahl läuft über,was auch immer die Wahl in der Kampagne für das Ändern von KundeDaten ist. NOT_ACTIVE verwendet, was auch immer Einstellung für dieKampagne anwesend ist. ALLOW_ALTER darf immer, damit das Mittel dieKunde Daten ändert, egal was die Kampagne Einstellung ist.Rückstellung ist NOT_ACTIVE. +<BR> +<A NAME="vicidial_users-alter_custphone_override"> +<BR> +<B>Agent Alter Kunden Telefon Override - </B> Mit dieser Option werden die unabhängig von der Option ist in der Kampagne für die Änderung der Kunde die Rufnummer ein. NOT_ACTIVE wird unabhängig Einstellung ist für die Kampagne. ALLOW_ALTER wird immer für den Agenten, um die Kunden-Nummer, egal, was die Kampagne Einstellung. Der Standardwert ist NOT_ACTIVE. + <BR> <A NAME="vicidial_users-alter_agent_interface_options"> <BR> @@ -1995,10 +2704,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Löschung-Remotemittel -</B> Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, vicidial Remotemittel aus dem System zu löschen. -<BR> -<A NAME="vicidial_users-load_leads"> -<BR> -<B>Last führt -</B> Diese Wahl, wenn Satz bis 1 dem Benutzer erlaubt,vicidial Leitungen in die vicidial_list Tabelle über die Netzgegründete Leitung Ladevorrichtung zu laden. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-load_leads"> + <BR> + <B>Last führt -</B> Diese Wahl, wenn Satz bis 1 dem Benutzer erlaubt,vicidial Leitungen in die vicidial_list Tabelle über die Netzgegründete Leitung Ladevorrichtung zu laden. + <? + } +?> <BR> <A NAME="vicidial_users-campaign_detail"> @@ -2030,10 +2746,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Ändern Sie Vertreter-Kampagne -</B> Diese Wahl, wenn Satz bis 1 demBenutzer erlaubt, die Kampagne zu ändern, daß ein Mittel in geloggtwird, während sie in es geloggt werden. -<BR> -<A NAME="vicidial_users-delete_filters"> -<BR> -<B>Löschung filtert -</B> Diese Wahl erlaubt dem Benutzer, in der LagezuSEIN, vicidial Leitung Filter aus dem System zu löschen. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-delete_filters"> + <BR> + <B>Löschung filtert -</B> Diese Wahl erlaubt dem Benutzer, in der LagezuSEIN, vicidial Leitung Filter aus dem System zu löschen. + <? + } +?> <BR> <A NAME="vicidial_users-delete_call_times"> @@ -2053,7 +2776,83 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_users-view_reports"> <BR> -<B>Ansicht berichtet -</B> diese Wahl erlaubt dem Benutzer, die VICIDIALReports anzusehen. +<B>Ansicht berichtet -</B> diese Wahl erlaubt dem Benutzer, die VICIDIALBerichte anzusehen. + +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-qc_enabled"> + <BR> + <B>QC aktiv - </B> Diese Option ermöglicht es dem Benutzer, um sich in der Quality Control Agent-Bildschirm. + + <BR> + <A NAME="vicidial_users-qc_user_level"> + <BR> + <B>QC-Benutzer-Niveau - </B> Diese Einstellung legt fest, was die Qualität der User-Agent ist. Dies wird diktieren der Ebene der Funktionalität für den Agenten in der QC-Abschnitt:<BR> + 1 - Nichts ändern<BR> + 2 - Ändern Sie nichts außer Status<BR> + 3 - Ändern Sie alle Felder<BR> + 4 - Überprüfen ersten QC<BR> + 5 - QC Statistiken anzeigen<BR> + 6 - Möglichkeit, Aufzeichnungen FINISHED<BR> + 7 - Manager Level<BR> + + <BR> + <A NAME="vicidial_users-qc_pass"> + <BR> + <B>QC-Datensatz Pass - </B> Diese Option ermöglicht es dem Agenten, um anzugeben, dass ein Datensatz hat die erste Runde der QC nach Überprüfung der Aufnahme. + + <BR> + <A NAME="vicidial_users-qc_finish"> + <BR> + <B>QC-Datensatz Finish - </B> Diese Option ermöglicht es dem Agenten, um anzugeben, dass eine Aufzeichnung beendet ist die zweite Runde der QC nach Überprüfung durch die Aufnahme. + + <BR> + <A NAME="vicidial_users-qc_commit"> + <BR> + <B>QC-Datensatz Commit - </B> Diese Option ermöglicht es dem Agenten festlegen, dass ein Datensatz wurde, die in QC. Es kann nicht mehr geändert werden, indem man. + <? + } +?> + +<BR> +<A NAME="vicidial_users-add_timeclock_log"> +<BR> +<B>AddTimeclock Log Record - </B> Diese Option ermöglicht es dem Benutzer, um an das timeclock Log. + +<BR> +<A NAME="vicidial_users-modify_timeclock_log"> +<BR> +<B>ÄndernTimeclock Log Record - </B> Diese Option ermöglicht es dem Benutzer zu ändern, Einträge in der Log-timeclock. + +<BR> +<A NAME="vicidial_users-delete_timeclock_log"> +<BR> +<B>Löschen der RegistrierungTimeclock Record - </B> Diese Option ermöglicht es dem Benutzer zu löschen, Einträge in der Log-timeclock. + +<BR> +<A NAME="vicidial_users-vdc_agent_api_access"> +<BR> +<B>Agent API-Zugang - </B> Diese Option ermöglicht es, das Konto für die Verwendung mit der vicidial Agenten-API-Befehle. + +<BR> +<A NAME="vicidial_users-manager_shift_enforcement_override"> +<BR> +<B>Shift Manager Vollstreckung Override -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager, um ihre Benutzer und Kennwort für ein Agent-Bildschirm, um die Verlagerung Beschränkungen auf einen Agenten Sitzung, wenn der Agent versucht, sich außerhalb ihrer Schicht. Der Standardwert ist 0. + +<BR> +<A NAME="vicidial_users-download_lists"> +<BR> +<B>Download Listen -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager zu klicken Sie auf den Download-Link-Liste am unteren Rand einer Liste Änderung Bildschirm zu exportieren den gesamten Inhalt eines Verzeichnisses auf eine flache Datei. Der Standardwert ist 0. + +<BR> +<A NAME="vicidial_users-export_reports"> +<BR> +<B>Exportieren von Berichten -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager für den Zugriff auf die Ausfuhr rufen Berichte über die Berichte Bildschirm. Der Standardwert ist 0. Für die Export-Bericht fordert, um das folgende Feld wird für die Ausfuhr: <BR>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 + + @@ -2108,7 +2907,12 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> -<B>Netz-Form -</B> Dieses ist, wo Sie die kundenspezifische Webseiteeinstellen können, die geöffnet ist, wenn der Benutzer an dieNETZ-FORM-Taste klickt. +<B>Netz-Form -</B> Dieses ist, wo Sie die kundenspezifische Webseiteeinstellen können, die geöffnet ist, wenn der Benutzer an dieNETZ-FORM-Taste klickt. So passen Sie die Abfragezeichenfolge nach dem Web-Formular, einfach beginnen, die Web-Formular mit VAR und dann die URL, die Sie verwenden möchten, ersetzt die Variablen mit den Variablen-Namen, die Sie verwenden möchten - A - phone_number - B -- genau wie in der Registerkarte INDEXE Abschnitt. + +<BR> +<A NAME="vicidial_campaigns-web_form_target"> +<BR> +<B>Netz-Form-Target-</B> Hier können Sie die eigene Web-Seite, dass der Rahmen Web-Formular wird geöffnet, wenn der Nutzer auf die Netz-Form-Taste. Der Standardwert ist _blank. <BR> <A NAME="vicidial_campaigns-allow_closers"> @@ -2125,96 +2929,261 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Gewährte Übergangsgruppen - mit diesen checkbox Auflistungen könnenSie die Gruppen vorwählen, denen Mittel in dieser Kampagne bringenkönnen Anrufe zu. Erlauben Sie Closers muß ermöglicht werden, damitdiese Wahl oben darstellt. -<BR> -<A NAME="vicidial_campaigns-campaign_allow_inbound"> -<BR> -<B>Erlauben Sie Inbound und gemischt - dieses ist, wo Sie einstellenkönnen, ob die Benutzer dieser Kampagne die Wahl haben, zum von voninbound Anrufen mit dieser Kampagne zu nehmen. Wenn Sie gemischtesinbound und outbound tun möchten dann, muß dieses auf Y eingestelltwerden. Wenn Sie nur das outbound Wählen auf dieser Kampagne tunmöchten einstellten dieses auf N. Default sind N. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_campaigns-campaign_allow_inbound"> + <BR> + <B>Erlauben Sie Inbound und gemischt - dieses ist, wo Sie einstellenkönnen, ob die Benutzer dieser Kampagne die Wahl haben, zum von voninbound Anrufen mit dieser Kampagne zu nehmen. Wenn Sie gemischtesinbound und outbound tun möchten dann, muß dieses auf Y eingestelltwerden. Wenn Sie nur das outbound Wählen auf dieser Kampagne tunmöchten einstellten dieses auf N. Default sind N. -<BR> -<A NAME="vicidial_campaigns-dial_status"> -<BR> -<B>Vorwahlknopf-Status -</B> Dieses ist, wohin Sie die Status einstellen,die Sie an innerhalb der Listen wählen wünschen, die für dieKampagne unten aktiv sind. Um einen anderen Status Vorwahlknopf hinzuzufügen, wählen Sie ihnvon der Drop-Down-Liste vor und Klicken FÜGT hinzu. Um einen derVorwahlknopfstatus zu entfernen, klicken Sie an dieENTFERNENVERBINDUNG nahe bei dem Status, den Sie entfernen möchten. + <BR> + <A NAME="vicidial_campaigns-dial_status"> + <BR> + <B>Vorwahlknopf-Status -</B> Dieses ist, wohin Sie die Status einstellen,die Sie an innerhalb der Listen wählen wünschen, die für dieKampagne unten aktiv sind. Um einen anderen Status Vorwahlknopf hinzuzufügen, wählen Sie ihnvon der Drop-Down-Liste vor und Klicken FÜGT hinzu. Um einen derVorwahlknopfstatus zu entfernen, klicken Sie an dieENTFERNENVERBINDUNG nahe bei dem Status, den Sie entfernen möchten. -<BR> -<A NAME="vicidial_campaigns-lead_order"> -<BR> -<B>Liste Auftrag -</B> Dieses Menü ist, wo Sie vorwählen, wie dieLeitungen, die die Status zusammenbringen, die oben vorgewähltwerden, in den Leitung Zufuhrbehälter eingesetzt werden: - <BR>   - DOWN: wählen Sie die ersten Leitungen vor, die in die vicidial_list Tabellegeladen werden - <BR>   - UP: wählen Sie die letzten Leitungen vor, die in die vicidial_listTabelle geladen werden - <BR>   - UP PHONE: wählen Sie die höchste Telefonnummer und die Arbeiten seine Weiseunten vor - <BR>   - DOWN PHONE: wählen Sie die niedrigste Telefonnummer und die Arbeiten seine Weiseoben vor - <BR>   - UP LAST NAME: Anfänge mit letzten Namen beginnend mit Z und Arbeiten seine Weiseunten - <BR>   - DOWN LAST NAME: Anfänge mit letzten Namen beginnend mit A und Arbeiten seine Weiseoben - <BR>   - UP COUNT: Anfänge mit benannten Leitungen und Arbeiten seine Weise unten - <BR>   - DOWN COUNT: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weiseoben - <BR>   - DOWN COUNT 2nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder anderen Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus - <BR>   - DOWN COUNT 3nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder dritten Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus - <BR>   - DOWN COUNT 4th NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jedem einsetzt weiter, führen Sie - darfNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus + <BR> + <A NAME="vicidial_campaigns-lead_order"> + <BR> + <B>Liste Auftrag -</B> Dieses Menü ist, wo Sie vorwählen, wie dieLeitungen, die die Status zusammenbringen, die oben vorgewähltwerden, in den Leitung Zufuhrbehälter eingesetzt werden: + <BR>   - DOWN: wählen Sie die ersten Leitungen vor, die in die vicidial_list Tabellegeladen werden + <BR>   - UP: wählen Sie die letzten Leitungen vor, die in die vicidial_listTabelle geladen werden + <BR>   - UP PHONE: wählen Sie die höchste Telefonnummer und die Arbeiten seine Weiseunten vor + <BR>   - DOWN PHONE: wählen Sie die niedrigste Telefonnummer und die Arbeiten seine Weiseoben vor + <BR>   - UP LAST NAME: Anfänge mit letzten Namen beginnend mit Z und Arbeiten seine Weiseunten + <BR>   - DOWN LAST NAME: Anfänge mit letzten Namen beginnend mit A und Arbeiten seine Weiseoben + <BR>   - UP COUNT: Anfänge mit benannten Leitungen und Arbeiten seine Weise unten + <BR>   - DOWN COUNT: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weiseoben + <BR>   - DOWN COUNT 2nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder anderen Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus + <BR>   - DOWN COUNT 3nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder dritten Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus + <BR>   - DOWN COUNT 4th NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jedem einsetzt weiter, führen Sie - darfNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus -<BR> -<A NAME="vicidial_campaigns-hopper_level"> -<BR> -<B>Zufuhrbehälter waagerecht ausgerichtet -</B> Dieses ist, wieviele dieVDhopper Indexversuche führt, um in der vicidial_hopper Tabelle fürdiese Kampagne zu halten. Wenn Sie VDhopper Index jede Minute laufenlassen, bilden Sie dieses etwas grösser als die Zahl Leitungen, dieSie in eine Minute durchmachen. + <BR> + <A NAME="vicidial_campaigns-hopper_level"> + <BR> + <B>Zufuhrbehälter waagerecht ausgerichtet -</B> Dieses ist, wieviele dieVDhopper Indexversuche führt, um in der vicidial_hopper Tabelle fürdiese Kampagne zu halten. Wenn Sie VDhopper Index jede Minute laufenlassen, bilden Sie dieses etwas grösser als die Zahl Leitungen, dieSie in eine Minute durchmachen. -<BR> -<A NAME="vicidial_campaigns-lead_filter_id"> -<BR> -<B>Leitung Filter -</B> Dieses ist eine Methode der Entstörung IhrerLeitungen mit einem Fragment einer SQL Frage. Benutzen Sie dieseFunktion mit Vorsicht, es ist einfach mit, der geringfügigstenÄnderung zur SQL Aussage versehentlich zu wählen zu stoppen.Rückstellung ist KEINE. + <BR> + <A NAME="vicidial_campaigns-lead_filter_id"> + <BR> + <B>Leitung Filter -</B> Dieses ist eine Methode der Entstörung IhrerLeitungen mit einem Fragment einer SQL Frage. Benutzen Sie dieseFunktion mit Vorsicht, es ist einfach mit, der geringfügigstenÄnderung zur SQL Aussage versehentlich zu wählen zu stoppen.Rückstellung ist KEINE. -<BR> -<A NAME="vicidial_campaigns-force_reset_hopper"> -<BR> -<B>Kraft-Zurückstellen des Zufuhrbehälters -</B> erlaubt dieses Ihnen,aus dem Zufuhrbehälterinhalt nach Formunterordnung abzuwischen. Essollte wieder gefüllt werden, wenn der VDhopper Index läuft. + <BR> + <A NAME="vicidial_campaigns-force_reset_hopper"> + <BR> + <B>Kraft-Zurückstellen des Zufuhrbehälters -</B> erlaubt dieses Ihnen,aus dem Zufuhrbehälterinhalt nach Formunterordnung abzuwischen. Essollte wieder gefüllt werden, wenn der VDhopper Index läuft. -<BR> -<A NAME="vicidial_campaigns-dial_method"> -<BR> -<B>Vorwahlknopf-Methode -</B> Dieses fangen ist die Weise, wie auf das Wählen zu definieren, stattfinden soll. Wenn HANDBUCH dann das auto_dial_level bei 0 verschlossen ist, es sei denn Vorwahlknopf-Methode geändert wird. Wenn VERHÄLTNIS dann der Normal, der eine Zeilenzahl für aktive Mittel wählt. ADAPT_HARD_LIMIT wählt predictively bis zum fallengelassenen Prozentsatz und dann erlaubt nicht das konkurrenzfähige Wählen, sobald die Tropfenbegrenzung erreicht wird, bis der Prozentsatz unten wieder geht. ADAPT_TAPERED läßt laufenden Überschuß den fallengelassenen Prozentsatz zur Hälfte erste der Verschiebung zu - wie durch das call_time definiert, das für Kampagne vorgewählt wird und erhält strenger, während die Verschiebung weitergeht. ADAPT_AVERAGE versucht, einen Durchschnitt oder den fallengelassenen Prozentsatz beizubehalten so, die konkurrenzfähig harte Begrenzungen nicht wie die anderen zwei Methoden auferlegen. Sie können nicht das Selbstvorwahlknopf-Niveau ändern, wenn Sie in irgendwelchen der ANPASSENVORWAHLKNOPFMETHODEN sind. Nur der Dialer kann das Vorwahlknopfniveau ändern wenn im vorbestimmten wählenden Modus. + <BR> + <A NAME="vicidial_campaigns-dial_method"> + <BR> + <B>Vorwahlknopf-Methode -</B> Dieses fangen ist die Weise, wie auf das Wählen zu definieren, stattfinden soll. Wenn HANDBUCH dann das auto_dial_level bei 0 verschlossen ist, es sei denn Vorwahlknopf-Methode geändert wird. Wenn VERHÄLTNIS dann der Normal, der eine Zeilenzahl für aktive Mittel wählt. ADAPT_HARD_LIMIT wählt predictively bis zum fallengelassenen Prozentsatz und dann erlaubt nicht das konkurrenzfähige Wählen, sobald die Tropfenbegrenzung erreicht wird, bis der Prozentsatz unten wieder geht. ADAPT_TAPERED läßt laufenden Überschuß den fallengelassenen Prozentsatz zur Hälfte erste der Verschiebung zu - wie durch das call_time definiert, das für Kampagne vorgewählt wird und erhält strenger, während die Verschiebung weitergeht. ADAPT_AVERAGE versucht, einen Durchschnitt oder den fallengelassenen Prozentsatz beizubehalten so, die konkurrenzfähig harte Begrenzungen nicht wie die anderen zwei Methoden auferlegen. Sie können nicht das Selbstvorwahlknopf-Niveau ändern, wenn Sie in irgendwelchen der ANPASSENVORWAHLKNOPFMETHODEN sind. Nur der Dialer kann das Vorwahlknopfniveau ändern wenn im vorbestimmten wählenden Modus. INBOUND_MAN ermöglicht es dem Agenten, um manuelle Einwahl Anrufe von einer Kampagne Liste, während in der Lage, die eingehenden Anrufe zwischen manuelle Einwahl fordert. -<BR> -<A NAME="vicidial_campaigns-auto_dial_level"> -<BR> -<B>Selbstvorwahlknopf-Niveau -</B> Dieses ist, wohin Sie einstellen,wieviele VICIDIAL sollte pro Mittel 0 verwenden des aktiven Mittelsnull zeichnet, Automobil, daswählen aus ist und die Mittel klicken,um jede Nummer zu wählen. Andernfalls hält VICIDIALWählverbindungen gleich den aktiven Mitteln, die mit demVorwahlknopfniveau multipliziert werden, um zu, wievielen Linien zukommen diese Kampagne auf jedem Bediener erlauben sollte. Das ANPASSENÜBERSTEUERUNG checkbox erlaubt Ihnen, ein neuesVorwahlknopfniveau zu zwingen, obwohl die Vorwahlknopfmethode in einemANPASSENMODUS ist. Dieses ist nützlich, wenn es eine drastischeVerschiebung in der Qualität der Leitungen gibt und Sie dasdial_level drastisch manuell ändern möchten. + <BR> + <A NAME="vicidial_campaigns-auto_dial_level"> + <BR> + <B>Selbstvorwahlknopf-Niveau -</B> Dieses ist, wohin Sie einstellen,wieviele VICIDIAL sollte pro Mittel 0 verwenden des aktiven Mittelsnull zeichnet, Automobil, daswählen aus ist und die Mittel klicken,um jede Nummer zu wählen. Andernfalls hält VICIDIALWählverbindungen gleich den aktiven Mitteln, die mit demVorwahlknopfniveau multipliziert werden, um zu, wievielen Linien zukommen diese Kampagne auf jedem Bediener erlauben sollte. Das ANPASSENÜBERSTEUERUNG checkbox erlaubt Ihnen, ein neuesVorwahlknopfniveau zu zwingen, obwohl die Vorwahlknopfmethode in einemANPASSENMODUS ist. Dieses ist nützlich, wenn es eine drastischeVerschiebung in der Qualität der Leitungen gibt und Sie dasdial_level drastisch manuell ändern möchten. -<BR> -<A NAME="vicidial_campaigns-available_only_ratio_tally"> -<BR> -<B>Vorhandenes nur Tally -</B> dieses fangen auf, wenn Satz zu YINCALL und WARTESCHLANGE Statusmittel ausläßt, wenn er die ZahlAnrufen zum Vorwahlknopf wenn nicht in MANUELLEN Vorwahlknopfmoduserrechnet. Rückstellung ist N. + <BR> + <A NAME="vicidial_campaigns-available_only_ratio_tally"> + <BR> + <B>Vorhandenes nur Tally -</B> dieses fangen auf, wenn Satz zu YINCALL und WARTESCHLANGE Statusmittel ausläßt, wenn er die ZahlAnrufen zum Vorwahlknopf wenn nicht in MANUELLEN Vorwahlknopfmoduserrechnet. Rückstellung ist N. -<BR> -<A NAME="vicidial_campaigns-adaptive_dropped_percentage"> -<BR> -<B>Tropfen-Prozentsatz-Begrenzung -</B> dieses fangen ist auf, wohinSie die Begrenzung auf den Prozentsatz der fallengelassenen Anrufe,die einstellten Sie beim Verwenden eineranpassungsfähig-vorbestimmten Vorwahlknopfmethode möchten, nichtMANUELL oder des VERHÄLTNISSES. + <BR> + <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> + <BR> + <B>Tropfen-Prozentsatz-Begrenzung -</B> dieses fangen ist auf, wohinSie die Begrenzung auf den Prozentsatz der fallengelassenen Anrufe,die einstellten Sie beim Verwenden eineranpassungsfähig-vorbestimmten Vorwahlknopfmethode möchten, nichtMANUELL oder des VERHÄLTNISSES. -<BR> -<A NAME="vicidial_campaigns-adaptive_maximum_level"> -<BR> -<B>Maximum paßt den waagerecht ausgerichteten Vorwahlknopf an -</B> diesesfangen ist auf, wohin Sie die Begrenzung auf die Begrenzungauf das numbr der Linien, die einstellten Sie gewählt pro Mittel beimVerwenden einer anpassungsfähig-vorbestimmten Vorwahlknopfmethodemöchten, nicht MANUELL oder des VERHÄLTNISSES. Diese Zahl kann alsdas Selbstvorwahlknopf-Niveau höher sein, wenn Ihre Kleinteile esstützen. Wert muß eine positive Nr. grösser als eine sein und kannDezimalstellen Rückstellung 3.0 haben. + <BR> + <A NAME="vicidial_campaigns-adaptive_maximum_level"> + <BR> + <B>Maximum paßt den waagerecht ausgerichteten Vorwahlknopf an -</B> diesesfangen ist auf, wohin Sie die Begrenzung auf die Begrenzungauf das numbr der Linien, die einstellten Sie gewählt pro Mittel beimVerwenden einer anpassungsfähig-vorbestimmten Vorwahlknopfmethodemöchten, nicht MANUELL oder des VERHÄLTNISSES. Diese Zahl kann alsdas Selbstvorwahlknopf-Niveau höher sein, wenn Ihre Kleinteile esstützen. Wert muß eine positive Nr. grösser als eine sein und kannDezimalstellen Rückstellung 3.0 haben. -<BR> -<A NAME="vicidial_campaigns-adaptive_latest_server_time"> -<BR> -<B>Neueste Bediener-Zeit -</B> dieses fangen wird verwendet nurdurch die ADAPT_TAPERED Vorwahlknopfmethode auf. Sie sollten in dieStunde hereinkommen und Minute, um der Sie stoppen, diese Kampagne zuersuchen, 2100 würde bedeuten, daß Sie stoppen, diese Kampagne bei9PM Bedienerzeit zu wählen. Dieses läßt den sich verjüngendenAlgorithmus entscheiden wie konkurrenzfähig zum Vorwahlknopf durch,wie lang Sie haben, bis Sie fertiges Benennen sind. + <BR> + <A NAME="vicidial_campaigns-adaptive_latest_server_time"> + <BR> + <B>Neueste Bediener-Zeit -</B> dieses fangen wird verwendet nurdurch die ADAPT_TAPERED Vorwahlknopfmethode auf. Sie sollten in dieStunde hereinkommen und Minute, um der Sie stoppen, diese Kampagne zuersuchen, 2100 würde bedeuten, daß Sie stoppen, diese Kampagne bei9PM Bedienerzeit zu wählen. Dieses läßt den sich verjüngendenAlgorithmus entscheiden wie konkurrenzfähig zum Vorwahlknopf durch,wie lang Sie haben, bis Sie fertiges Benennen sind. -<BR> -<A NAME="vicidial_campaigns-adaptive_intensity"> -<BR> -<B>Passen Sie Intensität Modifizierfaktor an -</B> dieses fangenwird verwendet, die vorbestimmte höhere oder niedrigere Intensitätzu justieren entweder auf. Das höhere eine positive Zahl, die Sievorwählen, grösser der Dialer den schreitenen Anruf erhöht, wenn esgeht oben und langsam der Dialer den schreitenen Anruf verringert,wenn es geht unten. Das niedriger die negative Zahl, Sie vorwählenhier, langsam erhöht der Dialer den schreitenen Anruf und schnellersenkt der Dialer den schreitenen Anruf, wenn es geht unten.Rückstellung ist 0. Dieses fangen wird verwendet nicht durchden HANDBUCH- oder VERHÄLTNIS-Vorwahlknopf Methoden auf. + <BR> + <A NAME="vicidial_campaigns-adaptive_intensity"> + <BR> + <B>Passen Sie Intensität Modifizierfaktor an -</B> dieses fangenwird verwendet, die vorbestimmte höhere oder niedrigere Intensitätzu justieren entweder auf. Das höhere eine positive Zahl, die Sievorwählen, grösser der Dialer den schreitenen Anruf erhöht, wenn esgeht oben und langsam der Dialer den schreitenen Anruf verringert,wenn es geht unten. Das niedriger die negative Zahl, Sie vorwählenhier, langsam erhöht der Dialer den schreitenen Anruf und schnellersenkt der Dialer den schreitenen Anruf, wenn es geht unten.Rückstellung ist 0. Dieses fangen wird verwendet nicht durchden HANDBUCH- oder VERHÄLTNIS-Vorwahlknopf Methoden auf. -<BR> -<A NAME="vicidial_campaigns-adaptive_dl_diff_target"> -<BR> -<B>Vorwahlknopf-waagerecht ausgerichtetes Unterschied-Ziel -</B> diesesfangen wird verwendet zu definieren auf, ob Sie Haben einerspezifischen Anzahl von den Mitteln zielen möchten, die Anruf- oderAnklopfenmittel warten. Z.B. wenn Sie immer auf Durchschnitt einerMittel haben möchten frei, Anrufe sofort zu nehmen, würden Siedieses bis -1 einstellen, wenn Sie ein immer haben zielen möchtenersuchen um den Einfluß, der ein Mittel wartet, das Sie dieses bis 1einstellen würden. Rückstellung ist 0. Dieses fangen wirdverwendet nicht durch den HANDBUCH- oder VERHÄLTNIS-VorwahlknopfMethoden auf. + <BR> + <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> + <BR> + <B>Vorwahlknopf-waagerecht ausgerichtetes Unterschied-Ziel -</B> diesesfangen wird verwendet zu definieren auf, ob Sie Haben einerspezifischen Anzahl von den Mitteln zielen möchten, die Anruf- oderAnklopfenmittel warten. Z.B. wenn Sie immer auf Durchschnitt einerMittel haben möchten frei, Anrufe sofort zu nehmen, würden Siedieses bis -1 einstellen, wenn Sie ein immer haben zielen möchtenersuchen um den Einfluß, der ein Mittel wartet, das Sie dieses bis 1einstellen würden. Rückstellung ist 0. Dieses fangen wirdverwendet nicht durch den HANDBUCH- oder VERHÄLTNIS-VorwahlknopfMethoden auf. -<BR> -<A NAME="vicidial_campaigns-concurrent_transfers"> -<BR> -<B>Gleichzeitige Übertragungen -</B> diese Einstellung wird benutzt, um dieZahl Anrufen zu definieren, die zu den Mitteln gleichzeitig geschicktwerden können. Es wird empfohlen, daß diese Einstellung am AUTOMOBILgelassen wird. Dieses fangen wird verwendet nicht durch dieMANUELLE Vorwahlknopfmethode auf. + <BR> + <A NAME="vicidial_campaigns-concurrent_transfers"> + <BR> + <B>Gleichzeitige Übertragungen -</B> diese Einstellung wird benutzt, um dieZahl Anrufen zu definieren, die zu den Mitteln gleichzeitig geschicktwerden können. Es wird empfohlen, daß diese Einstellung am AUTOMOBILgelassen wird. Dieses fangen wird verwendet nicht durch dieMANUELLE Vorwahlknopfmethode auf. -<BR> -<A NAME="vicidial_campaigns-auto_alt_dial"> -<BR> -<B>Wählende SelbstAlt-zahl -</B> diese Einstellung wird benutzt, umwechselnde Nummer automatisch zu wählen auffängt, beimWählen im VERHÄLTNIS und ANPASST Vorwahlknopfmethoden, wenn eskeinen Kontakt an der Haupttelefonnummer für eine Leitung, die Na, B,DC und N Status gibt. Diese Einstellung wird nicht durch die MANUELLEVorwahlknopfmethode benutzt. + <BR> + <A NAME="vicidial_campaigns-queue_priority"> + <BR> + <B>Queue-Priorität - </B> Diese Einstellung wird verwendet, um die Reihenfolge, in der die Anrufe von diesem ausgehende Kampagne zu beantworten in Bezug auf die eingehenden Anrufe, wenn diese Kampagne ist in Blended-Modus. + + <BR> + <A NAME="vicidial_campaigns-auto_alt_dial"> + <BR> + <B>Wählende SelbstAlt-zahl -</B> diese Einstellung wird benutzt, umwechselnde Nummer automatisch zu wählen auffängt, beimWählen im VERHÄLTNIS und ANPASST Vorwahlknopfmethoden, wenn eskeinen Kontakt an der Haupttelefonnummer für eine Leitung, die Na, B,DC und N Status gibt. Diese Einstellung wird nicht durch die MANUELLEVorwahlknopfmethode benutzt. EXTENDED stellvertretenden Zahlen sind die Zahlen in das System außerhalb der Standard-Bildschirm führen. Mit Extended können Sie Hunderte von Telefonnummern für einen einzigen Kunden aufnehmen. + + <BR> + <A NAME="vicidial_campaigns-dial_timeout"> + <BR> + <B>Vorwahlknopf-Abschaltung -</B> Wenn Sie, Anrufe, die normalerweiseHängezustand wurden, nachdem die Abschaltung, die in extensions.confanstatt Abschaltung an dieser Menge Sekunden definiert wurde wurde,wenn sie kleiner ist, als die extensions.conf Abschaltung definiertwerden. Dieses läßt schnell ändernde Vorwahlknopfabschaltungen vomBediener zum Bediener und zum Begrenzen der Effekte zu einer einzelnenKampagne zu. Wenn Sie eine Menge antwortende Maschine oder VoicemailAnrufe haben, können Sie diesen Wert, bis zwischen 21-26 zu ändernversuchen und sehen wünschen, wenn Resultate verbessern. + + <BR> + <A NAME="vicidial_campaigns-campaign_vdad_exten"> + <BR> + <B>Kampagne VDAD Erweiterung -</B> Dieses Feld erlaubt eine kundenspezifische Erweiterung VDAD Übertragung. Auf diese Weise können Sie verschiedene Call-Handling-Methoden je nach Ihrer Kampagne. +- 8364 - wie 8368 +- 8365 - wird die Forderung nur einem Agenten auf demselben Server wie der Anruf auf +- 8366 - Wird für die Presse-1 und Umfrage-Kampagnen +- 8367 - wird versuchen, zunächst schicken Sie die Forderung nach einem Agenten auf dem lokalen Server, dann wird es sich auf einem anderen Server + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on +- 8369 - Wird für Anrufbeantworter-Erkennung nach, dass ein gleiches Verhalten wie 8368 +- 8373 - Wird für Anrufbeantworter-Erkennung, die nach dem gleichen Verhalten wie 8366 + + <BR> + <A NAME="vicidial_campaigns-am_message_exten"> + <BR> + <B>Antwortende Maschine Anzeige -</B> Dieses fangen ist für dasHereinkommen auf, in eine Verlängerung, zum von von Übergangsanrufenzu blind zu machen, wenn das Mittel eine antwortende Maschine erhältund an die antwortende Maschine Anzeige Taste imÜbergangskonferenzrahmen klickt. Sie müssen dieses einstellen extenoben im dial plan - extensions.conf - und sicherstellen, daß esspielt, eine Audioakte dann oben hängt. + + <BR> + <A NAME="vicidial_campaigns-amd_send_to_vmx"> + <BR> + <B>AMD senden zu VM exten -</B> erlaubt dieses Menü Ihnen zu definieren,ob eine Anzeige auf einer antwortenden Maschine gelassen wird, wennihr der Anruf wird sofort nachgeschickt zur Antworten-Maschine-AnzeigeVerlängerung ermittelt wird, wenn AMD aktiv ist und es festgestelltwird, daß der Anruf eine antwortende Maschine ist. + + <BR> + <A NAME="vicidial_campaigns-cpd_amd_action"> + <BR> + <B>CPD AMD Action - </B> Wenn Sie die Sangoma ParaXip Rufen Fortschritte Detection-Software, dann werden Sie zum Aktivieren dieser Einstellung, entweder sie DISPO, die Disposition der Anruf als AA und hängen Sie es, wenn der Anruf wird bearbeitet und wurde nicht gesendet, um noch ein Agent oder eine Nachricht zu senden, die den Aufruf der Anrufbeantworter die Nachricht für diese Kampagne. Standardwert ist deaktiviert. + + <BR> + <A NAME="vicidial_campaigns-alt_number_dialing"> + <BR> + <B>Numerisches Wählen des Mittel-Alt -</B> erlaubt diese Wahl einemVertreter, die wechselnde Telefonnummer manuell zu wählen, oderaddress3 fangen auf, nachdem die Hauptzahl benannt wordenist. + + <BR> + <A NAME="vicidial_campaigns-drop_call_seconds"> + <BR> + <B>Sekunden zur Verbindung -</B> Anzahl der Sekunden vom Abnehmen des Kunden bis zur Erkennung als Verbindung, betrifft nur abgehende Verbindungen. + + <BR> + <A NAME="vicidial_campaigns-drop_action"> + <BR> + <B>Drop-Aktion - </B> Mit diesem Menü können Sie wählen, was passiert, wenn er einen Anruf wartet seit mehr als das, was ist in der Drop-Call Sekunden ein. HANGUP einfach auflegen, das Gespräch, MESSAGE wird die Forderung der Drop-Erweiterung, die Sie definiert haben, unten, Voicemail wird der Anruf an die Voicemail-Box, die Sie definiert haben, und unter IN_GROUP wird der Aufruf an die Inbound-Gruppe, die weiter unten definiert ist + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_exten"> + <BR> + <B>Sicherheitsnebenstelle -</B> Dies ist die Wählplan Nebenstelle, wo sich die gewünschte Sicherheits-Audiodatei auf Ihrem Server befindet. + + <BR> + <A NAME="vicidial_campaigns-voicemail_ext"> + <BR> + <B>Voicemail -</B> Wenn sie definiert werden, würden Anrufe, dienormalerweise FALLEN würden, anstatt auf diesen voicemail Kastenverwiesen, um eine Anzeige zu hören und zu lassen. + + <BR> + <A NAME="vicidial_campaigns-drop_inbound_group"> + <BR> + <B>Drop-Transfer-Fraktion - </B> Wenn Drop-Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie erreicht Drop Call Sekunden. + + <BR> + <A NAME="vicidial_campaigns-no_hopper_leads_logins"> + <BR> + <B>Gewähren Sie Kein-Zufuhrbehälter-Führt LOGON -</B> wenn Satz zu Y,Mittel zum LOGON zur Kampagne erlaubt, selbst wenn es keine Leitungengibt, die in den Zufuhrbehälter für diese Kampagne geladen werden.Diese Funktion wird nicht in den CLOSER-type Kampagnen benötigt.Rückstellung ist N. + + <BR> + <A NAME="vicidial_campaigns-list_order_mix"> + <BR> + <B>Liste Auftrag Mischung - läuft den Leitung Auftrag über undVorwahlknopf-Status fängt auf. Verwendet die Liste undStatusparameter für die vorgewählte Liste Mischung Eintragung imListe Mischung Unterseebootabschnitt anstatt. Rückstellung istUNTAUGLICH. + + <BR> + <A NAME="vicidial_campaigns-vcl_id"> + <BR> + <B>Liste Mischung Identifikation - Identifikation der Liste Mischung.Muß von 2-20 Buchstaben lang ohne Räume oder andere spezielleInterpunktion sein. + + <BR> + <A NAME="vicidial_campaigns-vcl_name"> + <BR> + <B>Liste Mischung Name - beschreibender Name der Liste Mischung. Muß von2-50 Buchstaben lang sein. + + <BR> + <A NAME="vicidial_campaigns-list_mix_container"> + <BR> + <B>Liste Mischung Detail - der Aufbau der Liste Mischung Eintragung.Enthält die Liste Identifikation, Mischung Auftrag, Prozentsätze undStatus, die diese Liste Mischung bilden. Die Prozentsätze müssen bis100 immer addieren, und alle Listen müssen aktiv und eingestellt aufdie Kampagne sein, damit die Auftrag Mischung Eintragung aktiviertwerden kann. + + <BR> + <A NAME="vicidial_campaigns-mix_method"> + <BR> + <B>Liste Mischung Methode - die Methode von alle Teile des Liste MischungDetails zusammen mischen. EVEN_MIX mischt Leitungen von jedem Teil,das mit den anderen Teilen, wie diese 1.2.3.1.2.3.1.2.3 durchgeschobenwird. IN_ORDER setzt die Leitungen in den Auftrag ein, in dem sie aufdem Liste Mischung Detailschirm 1.1.1.2.2.2.3.3.3 verzeichnet werden.GELEGENTLICHER Wille setzte sie in GELEGENTLICHEN Auftrag1.3.2.1.1.3.2.1.3 ein. Rückstellung ist IN_ORDER. + + <BR> + <A NAME="vicidial_campaigns-agent_extended_alt_dial"> + <BR> + <B>Agent Screen Erweiterte Alt Dial - </B> Diese Funktion erlaubt es Agenten für den Zugriff auf erweiterte stellvertretenden Telefonnummern führt über die Standard-Telefon-und Alt Address3 Felder, die verwendet werden können in VICIDIAL für Telefonnummern außerhalb der Haupt-Telefonnummer. Die Ausdehnung Telefonnummern gewählt werden können automatisch über die Auto-Alt-Dial-Funktion in VICIDIAL Kampagne Einstellungen, aber die Aktivierung dieser Agent Screen-Funktion wird auch für den Agenten, um diese Zahlen aus ihrer Bevollmächtigten Bildschirm sowie Informationen zu bearbeiten. + + <BR> + <A NAME="vicidial_campaigns-survey_first_audio_file"> + <BR> + <B>Umfrage Erste Audio-Datei - </B> Dies ist der Audio-Datei, die gespielt wird, sobald der Kunde nimmt das Telefon, wenn Sie eine Umfrage Kampagne. + + <BR> + <A NAME="vicidial_campaigns-survey_dtmf_digits"> + <BR> + <B>Umfrage DTMF Digits - </B> Dieses Feld ist, in dem Sie die Zahlen, dass ein Kunde kann Presse als eine Option auf eine Umfrage-Kampagne. gültig von DTMF-Ziffern sind0123456789*# + + <BR> + <A NAME="vicidial_campaigns-survey_ni_digit"> + <BR> + <B>Umfrage nicht interessiert Digit - </B> Dieses Feld ist, wo Sie den Kunden Ziffer gedrückt wird, dass sie nicht daran interessiert sind. + + <BR> + <A NAME="vicidial_campaigns-survey_ni_status"> + <BR> + <B>Umfrage nicht interessiert Status - </B> Dieses Feld ist, wo Sie den Status, der für die nicht interessiert. Wenn DNC verwendet wird und die Kampagne für die Verwendung DNC dann die Telefonnummer wird automatisch auf die interne VICIDIAL DNC Liste.und möglicherweise die Kampagne-spezifische DNC Liste. + + <BR> + <A NAME="vicidial_campaigns-survey_opt_in_audio_file"> + <BR> + <B>Umfrage Opt-in Audio-Datei - </B> Dies ist der Audio-Datei, die gespielt wird, wenn der Kunde hat sich bei der Erhebung, sich nicht-oder nicht reagiert, wenn die Nicht-Antwort-Aktion ist auf OptOut. Nach dieser Audio-Datei gespielt wird, die Umfrage-Methode Maßnahmen ergriffen werden. + + <BR> + <A NAME="vicidial_campaigns-survey_ni_audio_file"> + <BR> + <B>Umfrage nicht interessiert Audio Datei - </B> Dies ist der Audio-Datei, die gespielt wird, wenn der Kunde hat sich aus der Umfrage, nicht Opt-in ist oder nicht reagiert, wenn die Nicht-Antwort-Aktion ist auf OptIn. Nach dieser Audio-Datei gespielt wird, wird der Anruf wird dann. + + <BR> + <A NAME="vicidial_campaigns-survey_method"> + <BR> + <B>Umfrage-Methode - </B> Diese Option legt fest, was geschieht, auf eine Ausschreibung nach den Kunden hat sich in. AGENT_XFER wird der Anruf an den nächsten verfügbaren Agenten. VOICEMAIL wird der Anruf an die Voicemail-Box, die in den Bereich Voicemail. AUSDEHNUNG wird der Kunde auf die Ausdehnung der Definition in der Umfrage XFER Erweiterung Bereich. HANGUP hängt die Kunden. CAMPREC_60_WAV wird der Kunde auf eine Aufnahme, die mit ihrer Antwort, diese Aufnahme wird in einem Ordner mit dem Namen, wie sich die Kampagne innerhalb der Umfrage Kampagne Aufnahme Directory. + + <BR> + <A NAME="vicidial_campaigns-survey_no_response_action"> + <BR> + <B>Umfrage Nr.-Response Action - </B> Hier wird definiert, was passieren wird, wenn es keine Reaktion auf die Umfrage Frage. OptIn wird nur dann den Aufruf an die an der Umfrage-Methode, wenn der Kunde Pressen eine DTMF-Ziffern. OptOut wird der Kunde auf die Umfrage-Methode, auch wenn sie nicht drücken Sie eine DTMF-Ziffern. + + <BR> + <A NAME="vicidial_campaigns-survey_response_digit_map"> + <BR> + <B>Antworten Digit Karte - </B> Das ist der Abschnitt, in dem Sie eine Beschreibung zu jedem DTMF-Ziffern Option, dass der Kunde auswählen kann. + + <BR> + <A NAME="vicidial_campaigns-survey_xfer_exten"> + <BR> + <B>Umfrage XFER Extension - </B>, wenn die Methode der Erhebung AUSDEHNUNG ausgewählt ist dann der Kunde Aufruf richten Sie bitte an dieser dialplan Erweiterung. + + <BR> + <A NAME="vicidial_campaigns-survey_camp_record_dir"> + <BR> + <B>Umfrage Kampagne Aufnahme der Dienststellen - </B>, wenn die Methode der Erhebung CAMPREC_60_WAV ausgewählt ist dann der Kunde Reaktion wird erfasst und in ein Verzeichnis mit dem Namen nach der Kampagne innerhalb dieses Verzeichnisses. + + <? + } +?> <BR> <A NAME="vicidial_campaigns-next_agent_call"> @@ -2232,11 +3201,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Ortsgespräch-Zeit -</B> Dieses ist, wohin Sie während welcherStunden Sie wählen möchten, wie bis zum der lokalen Zeit infestgestellt sind einstellten in, welchem Sie benennen. Dieses wirddurch Ortsnetzkennzahl gesteuert und wird auf Tageslicht-SparungenZeit eingestellt, wenn anwendbar. Allgemeine Richtlinien in den USAfür Geschäft zum Geschäft ist 9am bis 5pm und Geschäft zu denVerbraucheranrufen ist 9am bis 9pm. -<BR> -<A NAME="vicidial_campaigns-dial_timeout"> -<BR> -<B>Vorwahlknopf-Abschaltung -</B> Wenn Sie, Anrufe, die normalerweiseHängezustand wurden, nachdem die Abschaltung, die in extensions.confanstatt Abschaltung an dieser Menge Sekunden definiert wurde wurde,wenn sie kleiner ist, als die extensions.conf Abschaltung definiertwerden. Dieses läßt schnell ändernde Vorwahlknopfabschaltungen vomBediener zum Bediener und zum Begrenzen der Effekte zu einer einzelnenKampagne zu. Wenn Sie eine Menge antwortende Maschine oder VoicemailAnrufe haben, können Sie diesen Wert, bis zwischen 21-26 zu ändernversuchen und sehen wünschen, wenn Resultate verbessern. - <BR> <A NAME="vicidial_campaigns-dial_prefix"> <BR> @@ -2252,11 +3216,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Kampagne CallerID -</B> Dieses fangen zuläßt das Senden einer kundenspezifischen callerid Zahl bei den outbound Anrufen auf. Dieses ist die Zahl, die oben auf dem callerid der Person darstellen würde, die, Sie anrufen. Die Rückstellung ist UNBEKANNT. Wenn Sie T1 benutzen, oder Eß, zum dieser Wahl heraus zu wählen nur vorhanden ist, wenn Sie PRIs verwenden - ISDN Tß oder Eß - die die kundenspezifische callerid Eigenschaft haben, die eingeschaltet wird, arbeitet dieses nicht mit Berauben-Spitze Service - RBS- Stromkreise. Dieses arbeitet auch durch das meiste VOIP - SIP oder IAX Stammversorger, die dynamisches outbound callerID erlauben. Das kundenspezifische callerID trifft nur auf die Anrufe zu, die direkt für die VICIDIAL Kampagne gesetzt werden, benennt jede mögliche 3. Partei, oder Übertragungen senden nicht das kundenspezifische callerID. ANMERKUNG: UNBEKANNT oder PRIVAT in auffangen manchmal sich setzen erbringt das Senden Ihrer Rückstellung callerID Zahl durch Ihre Fördermaschine mit den Anrufen. Sie können dieses prüfen wünschen und fangen 0000000000 in das callerid sich zu setzen anstatt auf, wenn Sie nicht Ihnen CallerID schicken möchten. -<BR> -<A NAME="vicidial_campaigns-campaign_vdad_exten"> -<BR> -<B>Kampagne VDAD Verlängerung -</B> Dieses fangen zuläßt eineGewohnheit VDAD Übergangsverlängerung auf. Dieses erlaubt Ihnen,unterschiedliche VDADtransfer... agi Indexe zu benutzen, abhängendnach Ihrer Kampagne. Die Rückstellung Übertragung AGI - exten 8365agi-VDADtransfer.agi - gerade sendet sofort ersucht zu den Mitteln,sobald sie aufgehoben werden. Eine zusätzliches BeispielpolitischeÜbersicht AGI ist auch jetzt eingeschlossenes - 8366agi-VDADtransferSURVEY.agi - dieses Spiele eine Anzeige zurangerufenen Person und läßt sie eine Wahl treffen, indem sie Tastenbetätigt - effektiv Vorsiebung die Leitung -. Merken Sie bitte dasaußer Übersichten, politische Anrufe und Nächstenliebe diese Formdes Benennens ist in den Vereinigten Staaten ungültig. - <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -2287,51 +3246,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Erhalten Sie Anruf-Produkteinführung -</B> Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. -<BR> -<A NAME="vicidial_campaigns-am_message_exten"> -<BR> -<B>Antwortende Maschine Anzeige -</B> Dieses fangen ist für dasHereinkommen auf, in eine Verlängerung, zum von von Übergangsanrufenzu blind zu machen, wenn das Mittel eine antwortende Maschine erhältund an die antwortende Maschine Anzeige Taste imÜbergangskonferenzrahmen klickt. Sie müssen dieses einstellen extenoben im dial plan - extensions.conf - und sicherstellen, daß esspielt, eine Audioakte dann oben hängt. - -<BR> -<A NAME="vicidial_campaigns-amd_send_to_vmx"> -<BR> -<B>AMD senden zu VM exten -</B> erlaubt dieses Menü Ihnen zu definieren,ob eine Anzeige auf einer antwortenden Maschine gelassen wird, wennihr der Anruf wird sofort nachgeschickt zur Antworten-Maschine-AnzeigeVerlängerung ermittelt wird, wenn AMD aktiv ist und es festgestelltwird, daß der Anruf eine antwortende Maschine ist. - <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> <BR> <B>Xfer-Conf DTMF -</B> Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. Wenn Sie beratende Übertragungen erlauben möchten, ein fronter zueinem genauerem, können Sie CXFER setzen, da eins derZahl-zu-Vorwahlknopf Voreinstellungen und des korrekten dial stringsgesendet wird, um eine lokale beratende Übertragung, dann dieMitteldose gerechtes LEAVE-3WAY-CALL und Bewegung an zu tun zu ihremfolgenden Anruf. Wenn Sie blinde Übertragungen der Kunden auf einenVICIDIAL AGI Index für die Protokollierung oder ein IVR erlaubenmöchten, legen Sie dann AXFER in den Zahl-zu-Vorwahlknopfauffangen. Sie können eine kundenspezifische Verlängerungnach dem AXFER oder dem CXFER auch spezifizieren, zum Beispiel wennSie interne beratende Übertragungen anstelle vom Einheimischen tunmöchten, würden Sie CXFER90009 in den Zahl-zu-Vorwahlknopfauffangen einsetzen. -<BR> -<A NAME="vicidial_campaigns-alt_number_dialing"> -<BR> -<B>Numerisches Wählen des Mittel-Alt -</B> erlaubt diese Wahl einemVertreter, die wechselnde Telefonnummer manuell zu wählen, oderaddress3 fangen auf, nachdem die Hauptzahl benannt wordenist. - <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Zeitlich geplante Wiederholungsbesuche -</B> Diese Wahl erlaubt einemMittel zur Einteilung einen Anruf als CALLBK und wählt die Daten unddie Zeit, an denen die Leitung reaktiviert wird. -<BR> -<A NAME="vicidial_campaigns-drop_call_seconds"> -<BR> -<B>Sekunden zur Verbindung -</B> Anzahl der Sekunden vom Abnehmen des Kunden bis zur Erkennung als Verbindung, betrifft nur abgehende Verbindungen. - -<BR> -<A NAME="vicidial_campaigns-voicemail_ext"> -<BR> -<B>Voicemail -</B> Wenn sie definiert werden, würden Anrufe, dienormalerweise FALLEN würden, anstatt auf diesen voicemail Kastenverwiesen, um eine Anzeige zu hören und zu lassen. - -<BR> -<A NAME="vicidial_campaigns-safe_harbor_message"> -<BR> -<B>Sicherheitsnachricht -</B> Wenn auf Y gesetzt wird dem Kunden nach Ablauf der Sekunden zur Verbindung, ohne zu einem Agenten verbunden worden zu sein, eine Nachricht abgespielt. Diese Einstellung setzt die Option Senden zu einer Voicemail Kasten ausser Kraft, wenn diese auf Y steht. - -<BR> -<A NAME="vicidial_campaigns-safe_harbor_exten"> -<BR> -<B>Sicherheitsnebenstelle -</B> Dies ist die Wählplan Nebenstelle, wo sich die gewünschte Sicherheits-Audiodatei auf Ihrem Server befindet. - <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -2347,6 +3271,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Interne DNC Liste des Gebrauch-</B>- definiert dieses, ob dieseKampagne Leitungen gegen die interne DNC Liste filtern soll. Wenn esauf Y eingestellt wird, sucht der Zufuhrbehälter nach jederTelefonnummer in der DNC Liste, bevor er sie in den Zufuhrbehälterlegt. Wenn er in der DNC Liste ist, dann, das sie dieses führt Statuszu DNCL also ändert, kann sie nicht gewählt werden. Rückstellungist N. +<BR> +<A NAME="vicidial_campaigns-use_campaign_dnc"> +<BR> +<B>Verwenden Sie Kampagne DNC List - </B> Diese legt fest, ob dieser Kampagne ist es, Filter führt gegen eine DNC-Liste, die sich speziell auf die Kampagne nur. Wenn es auf Y, der Trichter wird für jede Telefonnummer in der Kampagne-spezifische DNC-Liste, bevor sie in den Trichter. Wenn es in der Kampagne-spezifische DNC Liste, dann wird sich ändern, die Status DNCC, so kann er nicht gewählt werden. Der Standardwert ist N. + <BR> <A NAME="vicidial_campaigns-closer_campaigns"> <BR> @@ -2355,7 +3284,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-agent_pause_codes_active"> <BR> -<B>Mittel-Pause kodiert aktives -</B> läßt Mittel einen Pause Codevorwählen, wenn sie an die PAUSE Taste in vicidial.php klicken. PauseCodes sind pro Kampagne am unteren Bildschirmrand KampagneAnsichtdetail definierbar und sie werden in der vicidial_agent_logTabelle gespeichert. Rückstellung ist N. +<B>Mittel-Pause kodiert aktives -</B> läßt Mittel einen Pause Codevorwählen, wenn sie an die PAUSE Taste in vicidial.php klicken. PauseCodes sind pro Kampagne am unteren Bildschirmrand KampagneAnsichtdetail definierbar und sie werden in der vicidial_agent_logTabelle gespeichert. Rückstellung ist N. FORCE wird erzwungen, dass der Makler, um eine PAUSE-Code, wenn sie klicken Sie auf die PAUSE-Taste. <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> @@ -2363,40 +3292,113 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Sperren Sie ändern Kunde Daten -</B> wenn Satz zu Y, nicht irgendwelchedes Kunde Datensatzes wenn Einteilungen eines Mittels der Anrufändert. Rückstellung ist N. <BR> -<A NAME="vicidial_campaigns-no_hopper_leads_logins"> +<A NAME="vicidial_campaigns-disable_alter_custphone"> <BR> -<B>Gewähren Sie Kein-Zufuhrbehälter-Führt LOGON -</B> wenn Satz zu Y,Mittel zum LOGON zur Kampagne erlaubt, selbst wenn es keine Leitungengibt, die in den Zufuhrbehälter für diese Kampagne geladen werden.Diese Funktion wird nicht in den CLOSER-type Kampagnen benötigt.Rückstellung ist N. +<B>Deaktivieren Alter Customer Telefon - </B> Bei der Einstellung Y, ändert nichts an den Kunden die Telefonnummer, wenn ein Agent Verfügungen den Anruf zu tätigen. Der Standardwert ist Y. <BR> -<A NAME="vicidial_campaigns-list_order_mix"> +<A NAME="vicidial_campaigns-display_queue_count"> <BR> -<B>Liste Auftrag Mischung - läuft den Leitung Auftrag über undVorwahlknopf-Status fängt auf. Verwendet die Liste undStatusparameter für die vorgewählte Liste Mischung Eintragung imListe Mischung Unterseebootabschnitt anstatt. Rückstellung istUNTAUGLICH. - -<BR> -<A NAME="vicidial_campaigns-vcl_id"> -<BR> -<B>Liste Mischung Identifikation - Identifikation der Liste Mischung.Muß von 2-20 Buchstaben lang ohne Räume oder andere spezielleInterpunktion sein. - -<BR> -<A NAME="vicidial_campaigns-vcl_name"> -<BR> -<B>Liste Mischung Name - beschreibender Name der Liste Mischung. Muß von2-50 Buchstaben lang sein. - -<BR> -<A NAME="vicidial_campaigns-list_mix_container"> -<BR> -<B>Liste Mischung Detail - der Aufbau der Liste Mischung Eintragung.Enthält die Liste Identifikation, Mischung Auftrag, Prozentsätze undStatus, die diese Liste Mischung bilden. Die Prozentsätze müssen bis100 immer addieren, und alle Listen müssen aktiv und eingestellt aufdie Kampagne sein, damit die Auftrag Mischung Eintragung aktiviertwerden kann. - -<BR> -<A NAME="vicidial_campaigns-mix_method"> -<BR> -<B>Liste Mischung Methode - die Methode von alle Teile des Liste MischungDetails zusammen mischen. EVEN_MIX mischt Leitungen von jedem Teil,das mit den anderen Teilen, wie diese 1.2.3.1.2.3.1.2.3 durchgeschobenwird. IN_ORDER setzt die Leitungen in den Auftrag ein, in dem sie aufdem Liste Mischung Detailschirm 1.1.1.2.2.2.3.3.3 verzeichnet werden.GELEGENTLICHER Wille setzte sie in GELEGENTLICHEN Auftrag1.3.2.1.1.3.2.1.3 ein. Rückstellung ist IN_ORDER. +<B>Agent Anzeige Queue Count - </B> Wenn Sie auf Y, wenn ein Kunde wartet auf einen Agenten, der Queue fordert Anzeige oben auf der Agenten-Bildschirm wird rot und zeigen die Anzahl der wartenden Anrufe. Der Standardwert ist Y. <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> <BR> <B>Manuelle Vorwahlknopf-Liste Identifikation - das verwendet zu werdenRückstellung list_id, wenn ein Mittel placces ein manueller Anruf undeine neue Leitung Aufzeichnung im vicidial_list verursacht wird.Rückstellung ist 999. Dieses fangen kann nur Stellenenthalten auf. +<BR> +<A NAME="vicidial_campaigns-manual_dial_filter"> +<BR> +<B>Manual Dial Filter - </B> Auf diese Weise können Sie zum Filtern der Anrufe, die Agenten sind im manuellen Modus wählen Sie für diese Kampagne durch eine Kombination der folgenden: DNC - die Kick Out, CAMPAIGNLISTEN - die Zahl muss innerhalb der Listen für die Kampagne KEINE - kein Filter auf manuelle Einwahl oder schnelle Einwahl Listen. + +<BR> +<A NAME="vicidial_campaigns-agent_clipboard_copy"> +<BR> +<B>Agent Screen Zwischenablage kopieren - </B> Diese Funktion ist derzeit nur in die Lage für den Internet Explorer. Diese Funktion ermöglicht es Ihnen, wählen Sie einen Bereich, der kopiert werden an den Computer Zwischenablage des Maklers Computer auf einen Anruf wird an einen Agenten. Häufig verwendet für diese sind, damit für die einfache Einfügen von Kontonummern oder Telefonnummern in Legacy-Anwendungen auf dem Client-Agent-Computer. + +<BR> +<A NAME="vicidial_campaigns-three_way_call_cid"> +<BR> +<B>3-Wege-Call Outbound CallerID - </B> Diese legt fest, was gesendet wird, wie der Ausgang CallerID Reihe von 3-Wege-Anrufe, die von den Agenten, die Kampagne verwendet die eigene Kampagne CallerID, Kunde nutzt die Zahl der Kunden ist, dass aktive auf dem Bildschirm und Agenten AGENT_PHONE verwendet die CallerID für das Telefon, dass der Agent angemeldet ist, in. AGENT_CHOOSE ermöglicht es dem Agenten zu entscheiden, welche CallerID, die für 3-Wege-Anrufe aus einer Liste von Optionen. + +<BR> +<A NAME="vicidial_campaigns-three_way_dial_prefix"> +<BR> +<B>3-Wege-Call-Vorwahl - </B> Diese legt fest, was als Vorwahl für 3-Wege-Anrufe, standardmäßig ist leer, so dass die Kampagne Vorwahl verwendet wird, so können Sie passthru Klingelton hören ist 88. + +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_campaigns-qc_enabled"> + <BR> + <B>QC aktiv - </B> Wenn Sie diesen Bereich auf Y-Agent ermöglicht die Quality Control Funktionen zur Verfügung stehen. Der Standardwert ist N. + + <BR> + <A NAME="vicidial_campaigns-qc_statuses"> + <BR> + <B>QC-Status - </B> Dieser Bereich ist, in dem Sie auswählen, welche Zustände führt sollte weg von der QC-System. Aktivieren Sie das Kontrollkästchen neben den Status, die Sie wollen, QC, zu überprüfen. + + <BR> + <A NAME="vicidial_campaigns-qc_shift_id"> + <BR> + <B>QC-Shift - </B> Das ist die Verlagerung Zeitrahmen für die Pull-QC-Datensätze für eine Kampagne. Die Tage der Woche sind nicht für diese Funktionen. + + <BR> + <A NAME="vicidial_campaigns-qc_get_record_launch"> + <BR> + <B>QC Get Record Launch-</B> Auf diese Weise können Sie eine der folgenden Aktionen ausgelöst werden dürfte, auf einem QC Agenten erhalten einen neuen Rekord. + + <BR> + <A NAME="vicidial_campaigns-qc_show_recording"> + <BR> + <B>QC Show-Aufnahme - </B> Auf diese Weise können für eine Aufnahme, die im Zusammenhang mit der QC-Datensatz werden in der QC-Agent-Bildschirm. + + <BR> + <A NAME="vicidial_campaigns-qc_web_form_address"> + <BR> + <B>QC WebForm Adresse - </B> Dies ist die Website-Adresse, dass ein QC Agenten können sich an, wenn Sie auf den Link WebForm in der QC-Bildschirm. + + <BR> + <A NAME="vicidial_campaigns-qc_script"> + <BR> + <B>QC-Script - </B> Das ist das Skript, das verwendet werden kann, indem QC Agenten in den SCRIPT Registerkarte in der QC-Bildschirm. + <? + } +?> + +<BR> +<A NAME="vicidial_campaigns-vtiger_search_category"> +<BR> +<B>Vtiger Suche Kategorie - </B> Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung definieren, wo die vtiger_search.php Seite wird nach der Telefonnummer, die eingegeben wurde. Es gibt 4 Möglichkeiten, die genutzt werden kann in diesem Bereich: Lead-Diese Option wird die Suche durch die vtiger führt nur, Konto-Diese Option wird durch die Suche und vtiger alle Kontakte und sub-Kontakte für die Telefonnummer, Vendor-Diese Option wird nur durch die Suche vtiger Lieferanten, ACCTID-Diese Option funktioniert nur für Konten, und es wird die vicidial vendor_lead_code Bereich und versuchen Sie es um die Suche nach der vtiger-Konto-ID. Wenn es erfolglos versucht, andere Methoden zu finden, die Sie ausgewählt haben. Mehrere Optionen können verwendet werden, für jede Suche, sondern auf großen Datenbanken ist dies nicht empfohlen. Der Standardwert ist BLEI. + +<BR> +<A NAME="vicidial_campaigns-vtiger_create_call_record"> +<BR> +<B>Vtiger Erstellen Call Record - </B> Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung festlegen, ob eine neue vtiger Aktivität wird für den Anruf, wenn der Agent geht an die vtiger_search Seite. Der Standardwert ist Y. + +<BR> +<A NAME="vicidial_campaigns-vtiger_create_lead_record"> +<BR> +<B>Vtiger Erstellen Lead Record - </B> Wenn vtiger Integration aktiviert ist in den System-Einstellungen und vtiger Suche Kategorie umfasst BLEI, dann wird diese Einstellung festlegen, ob eine neue vtiger führen wird erstellt, wenn der Agent geht an die vtiger_search Seite und wird nicht festgestellt, dass die Call-Telefonnummer. Der Standardwert ist Y. + +<BR> +<A NAME="vicidial_campaigns-vtiger_screen_login"> +<BR> +<B>Vtiger Login Screen - </B> Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung festlegen, ob der Benutzer angemeldet ist in der vtiger-Schnittstelle automatisch, wenn sie zur Anmeldung VICIDIAL. Der Standardwert ist Y. + +<BR> +<A NAME="vicidial_campaigns-agent_allow_group_alias"> +<BR> +<B>Alias-Gruppe erlaubt - </B> Wenn Sie möchten, dass Ihre Agenten zu verwenden Gruppe Aliase dann müssen Sie diese Gruppe Y. Aliases werden mehr in der Admin-Bereich, sie zuzulassen, um verschiedene callerIDs Handbuch für ausgehende Anrufe dass sie Platz. Der Standardwert ist N. + +<BR> +<A NAME="vicidial_campaigns-default_group_alias"> +<BR> +<B>Standard-Fraktion Alias - </B> Wenn Sie erlaubt Gruppe Aliases, dann ist dies die Gruppe Alias, die zuerst ausgewählten standardmäßig aktiviert, wenn der Agent sich für eine Gruppe Alias für einen ausgehenden Anruf Handbuch. Der Standardwert ist Keine oder leer. + + @@ -2445,7 +3447,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_list-dnc"> <BR> -<B>VICIDIAL DNC Liste -</B> Dieses benennen nicht Liste enthält jedeLeitung, die auf einen Status von DNC im System eingestellt wordenist. Durch die LISTEN - FÜGEN Sie ZAHL DNC Seite hinzu, die Sie inder LageSIND, eine Zahl dieser Liste manuell hinzuzufügen, damit sienicht durch Kampagnen benannt wird, die die interne DNC Listebenutzen. +<B>VICIDIAL DNC Liste - </B> Diese Dont Call Liste enthält alle führen, die auf einen Status der DNC in das System. Durch die Listen - ADD Nummer DNC Seite können Sie manuell hinzufügen, Zahlen zu dieser Liste, so dass sie nicht durch Kampagnen, die die interne Liste DNC. Es besteht auch die Option, mit der Sie führt zu der Kampagne DNC-spezifische Listen für die Kampagnen, die sie. @@ -2489,6 +3491,12 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - campaign_rank: Aufträge durch den Rank gegeben zum Mittel für dieKampagne. Stark zu am niedrigsten. <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> + +<BR> +<A NAME="vicidial_inbound_groups-queue_priority"> +<BR> +<B>Queue Priority -</B> 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. + <A NAME="vicidial_inbound_groups-fronter_display"> <BR> <B>Fronter Anzeige -</B> Dieses fangen feststellt auf, ob dasinbound VICIDIAL Mittel den fronter Namen - wenn es einen gibt -angezeigt im Status auffangen haben würde, wann der Anrufzum Mittel kommt. @@ -2511,22 +3519,27 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> -<B>Sekunden zur Verbindung -</B> Anzahl der Sekunden vom Abnehmen des Kunden bis zur Erkennung als Verbindung, betrifft nur abgehende Verbindungen. +<B>Drop Call Sekunden - </B> Die Anzahl der Sekunden eines Gesprächs bleibt in der Warteschlange, bevor sie als DROP. <BR> -<A NAME="vicidial_inbound_groups-voicemail_ext"> +<A NAME="vicidial_inbound_groups-drop_action"> <BR> -<B>Voicemail -</B> Wenn sie definiert werden, würden Anrufe, dienormalerweise FALLEN würden, anstatt auf diesen voicemail Kastenverwiesen, um eine Anzeige zu hören und zu lassen. - -<BR> -<A NAME="vicidial_inbound_groups-drop_message"> -<BR> -<B>Verbindungs-Nachricht-</B> Wenn auf Y gesetzt wird dem Kunden nach Ablauf der Sekunden zur Verbindung, ohne zu einem Agenten verbunden worden zu sein, eine Nachricht abgespielt. Diese Einstellung setzt die Option Senden zu einer Voicemail Kasten ausser Kraft, wenn diese auf Y steht. +<B>Drop-Aktion - </B> Mit diesem Menü können Sie wählen, was passiert, wenn er einen Anruf wartet seit mehr als das, was ist in der Drop-Call Sekunden ein. HANGUP einfach auflegen, das Gespräch, MESSAGE wird die Forderung der Drop-Erweiterung, die Sie definiert haben, unten, Voicemail wird der Anruf an die Voicemail-Box, die Sie definiert haben, und unter IN_GROUP wird der Aufruf an die Inbound-Gruppe, die weiter unten definiert ist. <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> -<B>Verbindungs-Nebenstelle -</B> Dies ist die Wählplan-Nebenstelle, wo sich die gewünschte Audiodatei für die aufgebaute Verbindung auf Ihrem Server befindet. +<B>Drop-Erweiterung - </B> Wenn Drop-Aktion ist auf MESSAGE Dies ist der Plan wählen, dass sich die Aufforderung an, wenn sie erreicht Drop Call Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-voicemail_ext"> +<BR> +<B>Voicemail -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + +<BR> +<A NAME="vicidial_inbound_groups-drop_inbound_group"> +<BR> +<B>Drop-Transfer-Fraktion - </B> Wenn Drop-Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie erreicht Drop Call Sekunden. <BR> <A NAME="vicidial_inbound_groups-call_time_id"> @@ -2536,7 +3549,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-after_hours_action"> <BR> -<B>Nach Stunden Tätigkeit - die Tätigkeit zum durchzuführen, wenn sienach Stunden ist, wie in der Anrufzeit für diese inbound Gruppedefiniert. HÄNGEZUSTAND-Willenssofort Hängezustand der Anruf,MESSASGE spielt die Akte in nach Stunden Anzeige Filenamauffangen, schickt VERLÄNGERUNG den Anruf zu nach StundenVerlängerung im dialplan und VOICEMAIL schickt den Anruf zumvoicemail Kasten, der in nach Stunden Voicemail verzeichnet wird,auffangen. Rückstellung ist ANZEIGE. +<B>After Hours Aktion - </B> Die Aktion durchführen, wenn sie nach Stunden wie in der Ausschreibung für diesen eingehenden Gruppe. HANGUP sofort hangup den Anruf, MESSASGE wird die Datei im After Hours Nachricht Filenam Bereich, AUSDEHNUNG wird die Aufforderung an die After Hours-Erweiterung in der dialplan und Voicemail wird der Anruf an die Voicemail-Box, die in den Bereich After Hours Voicemail , IN_GROUP wird die Aufforderung an die Inbound-Gruppe in der After Hours Transfer-Gruppe Wählen Sie Liste. Der Standardwert ist MESSAGE. <BR> <A NAME="vicidial_inbound_groups-after_hours_message_filename"> @@ -2553,11 +3566,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Nach Stunden Voicemail - der voicemail Kasten, zum des Anrufs zusenden, wenn die Tätigkeit auf VOICEMAIL eingestellt wird. +<BR> +<A NAME="vicidial_inbound_groups-afterhours_xfer_group"> +<BR> +<B>After Hours Transfer Group - </B>, wenn After Hours Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie die in der Gruppe außerhalb der Aufforderung zur Einreichung von Zeitplanung für die in-group. + <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> <BR> <B>Willkommener Anzeige Dateiname - die Audioakte gelegen auf demgespielt zu werden Bediener, wenn der Anruf hereinkommt. Wenn Satz zu---NONE --- dann wird keine Anzeige gespielt. Rückstellung ist---NONE --- +<BR> +<A NAME="vicidial_inbound_groups-play_welcome_message"> +<BR> +<B>Jetzt Grußwort - </B> Diese Einstellungen wählen Sie, wann Sie spielen die definierten Willkommensnachricht, immer spielen sie jedes Mal, nie nie spielen, IF_WAIT_ONLY nur spielen die Willkommen-Nachricht, wenn die Forderung nicht sofort zu einem Agenten , und YES_UNLESS_NODELAY immer spielen die Willkommen-Nachricht, es sei denn, die NO_DELAY Einstellung aktiviert ist. Der Standardwert ist IMMER. + <BR> <A NAME="vicidial_inbound_groups-moh_context"> <BR> @@ -2571,7 +3594,52 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-prompt_interval"> <BR> -<B>Auf Einfluß-Aufforderung Abstand - die Zeitspanne in den Sekunden, zuwarten, bevor an die haltenaufforderung gespielt wird. Rückstellungist 60. +<B>Auf Einfluß-Aufforderung Abstand - die Zeitspanne in den Sekunden, zuwarten, bevor an die haltenaufforderung gespielt wird. Rückstellungist 60. So deaktivieren Sie die On-Hold-Prompt, das Intervall auf 0. + +<BR> +<A NAME="vicidial_inbound_groups-play_place_in_line"> +<BR> +<B>Jetzt in den Line - </B> Diese legt fest, ob die Anrufer hören, ihren Platz in der Zeile, wenn sie in der Warteschlange als auch, wenn sie hören, die announcemend. Der Standardwert ist N. + +<BR> +<A NAME="vicidial_inbound_groups-play_estimate_hold_time"> +<BR> +<B>Jetzt Geschätzte Hold Time - </B> Diese legt fest, ob die Anrufer hören, halten Sie die geschätzte Zeit, bevor sie übertragen werden, zu einem Makler. Der Standardwert ist N. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option"> +<BR> +<B>Hold Time Option - </B> Auf diese Weise können Sie die Weiterleitung von den Anruf halten, wenn die geschätzte Zeit über dem Betrag von Sekunden aus. Der Standardwert ist KEINE. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_seconds"> +<BR> +<B>Hold Time Option Sekunden - </B> Wenn Hold Time-Option ist gesetzt, was aber keiner, das ist die Anzahl der Sekunden des geschätzten halten auslösen wird Zeit, dass die Hold-Zeit-Option. Der Standardwert ist 360 Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_exten"> +<BR> +<B>Hold Time Option Extension - </B> Wenn Hold Time-Option auf Verlängerung, ist dies die dialplan, dass sich die Aufforderung an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> +<BR> +<B>Hold Time Option Voicemail - </B> Wenn Hold Time auf Voicemail, das ist die Voice-Mailbox, dass der Anruf an, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> +<BR> +<B>Hold Time Option Transfer In-Group - </B> Wenn Hold Time-Option ist auf IN_GROUP, das ist die Gruppe, dass die eingehenden Anruf werden, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> +<BR> +<B>Hold Time Option Rückruf Dateiname - </B> Wenn Hold Time-Option ist auf CALLERID_CALLBACK, Dies ist der Dateiname ein, dass gespielt wird, bevor der Anruf wird protokolliert, als eine neue dazu führen, dass die ID-Liste unten, wenn der geschätzte halten länger als die Hold Time Option Sekunden. + +<BR> +<A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> +<BR> +<B>Hold Time Option Liste Rückruf-ID - </B> Wenn Hold Time Option ist auf CALLERID_CALLBACK, Dies ist die Liste der Anruf-ID wird als neues führen, wenn der geschätzte halten länger als die Hold Time Option Sekunden. <BR> <A NAME="vicidial_inbound_groups-agent_alert_exten"> @@ -2588,6 +3656,176 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Rückstellung Übergangsgruppe - dieses fangen ist dieRückstellung In-Gruppe auf, die automatisch vorgewählt wird, wenndas Mittel zum Bringenkonferenz Rahmen in ihrer Mittelschnittstellegeht. +<BR> +<A NAME="vicidial_inbound_groups-ingroup_recording_override"> +<BR> +<B>In-Group-Aufnahme Override - </B> Dieses Feld ermöglicht die zwingende der Kampagne rufen die Aufnahme-Einstellung. Diese Einstellung kann über die Aufnahme überschreiben vicidial_user Einstellung. Behinderte nicht überschreiben die Kampagne die Aufnahme-Einstellung. NIEMALS deaktiviert Aufnahme auf dem Client. OnDemand ist der Standard und ermöglicht es dem Agenten zu starten und stoppen Sie die Aufnahme wie gewünscht. ALLCALLS Starten der Aufnahme wird auf dem Client, wenn ein Anruf an einen Agenten. ALLFORCE Starten der Aufnahme wird auf dem Client, wenn ein Anruf an einen Agenten, die der Agent keine Option um die Aufnahme zu stoppen. + +<BR> +<A NAME="vicidial_inbound_groups-ingroup_rec_filename"> +<BR> +<B>In-Group-Aufnahme Dateiname - </B> Mit diesem Feld werden die Aufnahme der Kampagne Dateibenennungsschemata Regelung, es sei denn, es ist auf Keine eingestellt. Die Variablen sind erlaubt KAMPAGNE CUSTPHONE FullDate TINYDATE EPOCH AGENT. Der Standardwert ist FULLDATE_MITTELund würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, die wie folgt aussehen TESTCAMP_51020103108_3125551212. 50 Zeichen max. Der Standardwert ist KEINE. + +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_inbound_groups-qc_enabled"> + <BR> + <B>QC aktiv - </B> Wenn Sie diesen Bereich auf Y-Agent ermöglicht die Quality Control Funktionen zur Verfügung stehen. Der Standardwert ist N. + + <BR> + <A NAME="vicidial_inbound_groups-qc_statuses"> + <BR> + <B>QC-Status - </B> Dieser Bereich ist, in dem Sie auswählen, welche Zustände führt sollte weg von der QC-System. Aktivieren Sie das Kontrollkästchen neben den Status, die Sie wollen, QC, zu überprüfen. + + <BR> + <A NAME="vicidial_inbound_groups-qc_shift_id"> + <BR> + <B>QC-Shift - </B> Das ist die Verlagerung Zeitrahmen für die Pull-QC-Datensätze für eine inbound_group. Die Tage der Woche sind nicht für diese Funktionen. + + <BR> + <A NAME="vicidial_inbound_groups-qc_get_record_launch"> + <BR> + <B>QC Get Record Launch-</B> Auf diese Weise können Sie eine der folgenden Aktionen ausgelöst werden dürfte, auf einem QC Agenten erhalten einen neuen Rekord. + + <BR> + <A NAME="vicidial_inbound_groups-qc_show_recording"> + <BR> + <B>QC Show-Aufnahme - </B> Auf diese Weise können für eine Aufnahme, die im Zusammenhang mit der QC-Datensatz werden in der QC-Agent-Bildschirm. + + <BR> + <A NAME="vicidial_inbound_groups-qc_web_form_address"> + <BR> + <B>QC WebForm Adresse - </B> Dies ist die Website-Adresse, dass ein QC Agenten können sich an, wenn Sie auf den Link WebForm in der QC-Bildschirm. + + <BR> + <A NAME="vicidial_inbound_groups-qc_script"> + <BR> + <B>QC-Script - </B> Das ist das Skript, das verwendet werden kann, indem QC Agenten in den SCRIPT Registerkarte in der QC-Bildschirm. + <? + } +?> + +<BR> +<A NAME="vicidial_inbound_groups-hold_recall_xfer_group"> +<BR> +<B>Hold Recall Transfer In-Group - </B> Wenn ein Kunde, um zu dieser Gruppe mehr als einmal, und das ist nicht auf None gesetzt wird, dann wird der Anruf automatisch an das In-Gruppe in diesem Bereich ausgewählt . Der Standardwert ist KEINE. + +<BR> +<A NAME="vicidial_inbound_groups-no_delay_call_route"> +<BR> +<B>Nr. Delay Call Route - </B> Wenn Sie diesen auf Y werden alle Wartezeiten und akustische und versuchen, den Anruf zu einem Agenten. Nicht überschreiben Willkommensnachricht oder halten Prompt Einstellungen. Der Standardwert ist N. + +<BR> +<A NAME="vicidial_inbound_groups-answer_sec_pct_rt_stat_one"> +<BR> +<B>Statistiken Prozent der Anrufe innerhalb von X Sekunden - </B> In diesem Feld können Sie die Anzahl der Sekunden, halten Sie die Echtzeit-Statistiken angezeigt wird zur Berechnung der Anteil der Anrufe, die beantwortet wurden beantwortet X Anzahl von Sekunden zu halten. + +<BR> +<A NAME="vicidial_inbound_groups-default_group_alias"> +<BR> +<B>Standard-Fraktion Alias - </B> Wenn Sie erlaubt Gruppe Aliases für die Kampagne, dass der Agent angemeldet ist, dann ist dies in der Gruppe ist, dass Alias zuerst ausgewählten standardmäßig auf einen Anruf, die von dieser Gruppe, wenn die Inbound-Agent dafür, Verwendung eines Alias-Fraktion für einen ausgehenden Anruf Handbuch. Der Standardwert ist Keine oder leer. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_INBOUND_DIDSTABELLE</FONT></B><BR><BR> +<BR> +<A NAME="vicidial_inbound_dids-did_pattern"> +<BR> +<B>DID-Erweiterung - </B> Das ist die Zahl, die Erweiterung oder das getan hat, löst diesen Eintrag, und dass Sie Route innerhalb des Systems mit dieser Funktion. Es ist ein Standard DID vorbehalten, die Sie verwenden können, die nur das Wort-default-ohne Bindestriche, Allos, die Sie senden jede Aufforderung, die nicht mit einer anderen bestehenden Muster auf den Standard DID. + +<BR> +<A NAME="vicidial_inbound_dids-did_description"> +<BR> +<B>DID-Beschreibung - </B> Das ist die Beschreibung von der DID-Routing-Eintrag. + +<BR> +<A NAME="vicidial_inbound_dids-did_active"> +<BR> +<B>DID-Aktive - </B> Das ist der Bereich, in dem Sie die DID Eintrag aktiv oder nicht. Der Standardwert ist Y. + +<BR> +<A NAME="vicidial_inbound_dids-did_route"> +<BR> +<B>DID-Route - </B> Diese Art der Route, die Sie der DID zu verwenden. Verlängerung wird ersucht, um die Erweiterung in unten, Voicemail senden Anrufe direkt an die Voicemail-Box eingetragen unter, der Agent wird Gespräche auf eine VICIDIAL Agenten, wenn sie angemeldet sind, TEL wird der Anruf zu einem ausgewählten Eintrag Telefone unter, IN_GROUP wird Senden Sie Anrufe direkt auf die angegebene Inbound-Gruppe. Standard ist die Erweiterung. + +<BR> +<A NAME="vicidial_inbound_dids-extension"> +<BR> +<B>Extension - </B>, wenn die Erweiterung ist als der DID-Route, dann ist dies die Erweiterung dialplan, dass Anrufe werden an. Der Standardwert ist 9998811112, no-Service. + +<BR> +<A NAME="vicidial_inbound_dids-exten_context"> +<BR> +<B>Erweiterung Kontext - </B>, wenn die Erweiterung ist als der DID-Route, dann ist dies die dialplan Zusammenhang, dass Anrufe werden an. Die Voreinstellung ist Standard. + +<BR> +<A NAME="vicidial_inbound_dids-voicemail_ext"> +<BR> +<B>Voicemail-Box - </B> Wenn Voicemail ist als der DID-Route, dann ist dies die Voicemail-Box, die Anrufe werden an. Der Standardwert ist leer. + +<BR> +<A NAME="vicidial_inbound_dids-phone"> +<BR> +<B>Telefon Extension - </B> Wenn PHONE ist als der DID-Route, dann ist das Telefon-Erweiterung, wird der Aufruf an. + +<BR> +<A NAME="vicidial_inbound_dids-server_ip"> +<BR> +<B>Server-IP-Telefon - </B> Wenn PHONE ist als der DID-Route, dann ist dies der Server-IP-Telefon für die Erweiterung, die Anrufe werden an. + +<BR> +<A NAME="vicidial_inbound_dids-user"> +<BR> +<B>User Agent - </B> Wenn agent ist als der DID-Route, dann ist dies die VICIDIAL Agent, dass Anrufe werden an. + +<BR> +<A NAME="vicidial_inbound_dids-user_unavailable_action"> +<BR> +<B>User-Aktion nicht verfügbar - </B> Wenn agent ist als der DID-Route, und der Benutzer ist nicht angemeldet oder verfügbar sind, dann ist dies der Weg, den die Anrufe wird. + +<BR> +<A NAME="vicidial_inbound_dids-user_route_settings_ingroup"> +<BR> +<B>User-Einstellungen Route In-Group - </B> Wenn agent ist als der DID-Route, dann ist dies die In-Group, die verwendet werden für die Queue-Einstellungen wie der Anrufer wartet, die an den Agenten. Der Standardwert ist AGENTDIRECT. + +<BR> +<A NAME="vicidial_inbound_dids-group_id"> +<BR> +<B>In-Group-ID - </B> Wenn IN_GROUP ist als der DID-Route, dann ist dies die In-Group, die Anrufe werden an. + +<BR> +<A NAME="vicidial_inbound_dids-call_handle_method"> +<BR> +<B>In-Group Call Griff Methode - </B> Wenn IN_GROUP ist als der DID-Route, dann ist dies die Forderung Umgang Methode für diese Anrufe. CID wird eine neue Aufnahme führen mit jedem Anruf über die CallerID wie die Telefonnummer, CIDLOOKUP Lookup wird versuchen, die Telefonnummer von der CallerID im gesamten System, CIDLOOKUPRL wird attampt und auf die Telefonnummer von der CallerID nur in einem bestimmten Verzeichnis , CIDLOOKUPRC wird attampt und auf die Telefonnummer von der CallerID in allen von den Listen, die zu den angegebenen Kampagne, näher ist für VICIDIAL engere fordert ANI wird eine neue Aufnahme führen mit jedem Anruf mit der ANI wie die Telefonnummer, ANILOOKUP Lookup wird versuchen, die Telefonnummer von der ANI in das gesamte System, ANILOOKUPRL wird attampt und auf die Telefonnummer von der ANI nur in einem bestimmten Verzeichnis, XDIGITID wird der Anrufer für einen X-stelligen Code vor dem Aufruf wird in Betrieb genommen werden der Warteschlange. Der Standardwert ist CID. + +<BR> +<A NAME="vicidial_inbound_dids-agent_search_method"> +<BR> +<B>In-Group-Agent Suche Methode - </B> Wenn IN_GROUP ist als der DID-Route, dann ist dies der Agent Suche Methode für die Inbound-Gruppe, LO ist Load-Balanced-Overflow und versuchen um den Ruf zu senden einem Agenten auf dem lokalen Server, bevor Sie versuchen, senden Sie sie an einen Agenten auf einem anderen Server, Load-LB ist ausgewogen und wird versuchen, um den Ruf zu senden, um zur nächsten Agent-Server, egal was sie sind, so ist nur Server-und nur versuchen, die Forderungen an Agenten auf dem Server, dass der Anruf kam auf. Der Standardwert ist LB. + +<BR> +<A NAME="vicidial_inbound_dids-list_id"> +<BR> +<B>In-Group-ID-Liste - </B> Wenn IN_GROUP ist als der DID-Route, dann ist dies die ID-Liste führt, dass kann man suchen, durch und führt werden, wenn notwendig, in. + +<BR> +<A NAME="vicidial_inbound_dids-campaign_id"> +<BR> +<B>In-Group-ID-Kampagne - </B> Wenn IN_GROUP ist als der DID-Route, dann ist dies die Kampagnen-ID, was kann man suchen, wenn das Gespräch mit Methode ist CIDLOOKUPRC. + +<BR> +<A NAME="vicidial_inbound_dids-phone_code"> +<BR> +<B>In-Group Telefon Code - </B> Wenn IN_GROUP ist als der DID-Route, dann ist das Telefon-Code verwendet, wenn eine neue Führung wird erstellt. + + <BR><BR><BR><BR> @@ -2645,36 +3883,42 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN -<BR><BR><BR><BR> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYSTABELLE</FONT></B><BR><BR> -<A NAME="vicidial_campaign_hotkeys"> -<BR> -<B>Durch den Gebrauch von kundenspezifischen Kampagne hot keys, benenntVertreter, die verwenden, der vicidial Netz-Klient Dose Hängezustandund Einteilung, gerade indem sie einen einzelnen Schlüssel auf ihrerTastatur betätigen.</B> 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. + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYSTABELLE</FONT></B><BR><BR> + <A NAME="vicidial_campaign_hotkeys"> + <BR> + <B>Durch den Gebrauch von kundenspezifischen Kampagne hot keys, benenntVertreter, die verwenden, der vicidial Netz-Klient Dose Hängezustandund Einteilung, gerade indem sie einen einzelnen Schlüssel auf ihrerTastatur betätigen.</B> 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. -<BR><BR><BR><BR> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLETABELLE</FONT></B><BR><BR> -<A NAME="vicidial_lead_recycle"> -<BR> -<B>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.</B> + <B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLETABELLE</FONT></B><BR><BR> + <A NAME="vicidial_lead_recycle"> + <BR> + <B>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.</B> -<BR><BR><BR><BR> - -<B><FONT SIZE=3>VICIDIAL SELBSTALT VORWAHLKNOPF-STATUS</FONT></B><BR><BR> -<A NAME="vicidial_auto_alt_dial_statuses"> -<BR> -<B>Wenn das SelbstAlt-zahl Wählen wird eingestellt auffangen,dann die Leitungen, die sind, unter diesen Vorwahlknopfstatus desAutomobils Alt haben ihr alt_phone dispositioned, und-oder address3gewählt, nachdem irgendwelche von diesen Status kein-antworten,werden eingestellt auffängt.</B> + <BR><BR><BR><BR> + <B><FONT SIZE=3>VICIDIAL SELBSTALT VORWAHLKNOPF-STATUS</FONT></B><BR><BR> + <A NAME="vicidial_auto_alt_dial_statuses"> + <BR> + <B>Wenn das SelbstAlt-zahl Wählen wird eingestellt auffangen,dann die Leitungen, die sind, unter diesen Vorwahlknopfstatus desAutomobils Alt haben ihr alt_phone dispositioned, und-oder address3gewählt, nachdem irgendwelche von diesen Status kein-antworten,werden eingestellt auffängt.</B> + <? + } +?> @@ -2701,11 +3945,42 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Gruppe Name -</B> Dieses ist die Beschreibung des vicidialBenutzergruppe Maximums von 40 Buchstaben. +<BR> +<A NAME="vicidial_user_groups-forced_timeclock_login"> +<BR> +<B>ForceTimeclock Login - </B> Diese Option ermöglicht es Ihnen, nicht zulassen, ein Agent der Anmeldung an der VICIDIAL Agent-Schnittstelle, wenn sie nicht angemeldet haben, in die timeclock. Der Standardwert ist N. Es ist eine Option zu befreien admin Benutzer, Stufen 8 und 9. + +<BR> +<A NAME="vicidial_user_groups-shift_enforcement"> +<BR> +<B>Shift Vollstreckung -</B> Diese Einstellung ermöglicht es Ihnen, Agenten-Logins auf der Grundlage der Veränderungen, die ausgewählt werden. AUS wird nicht in allen Schichten durchzusetzen. START wird nur die Durchsetzung der Login-Zeit, sondern wirkt sich nicht auf einen Vertreter, der mit über die Verlagerung, wenn sie bereits eingeloggt ALL wird durchzusetzen Verlagerung starten und meldet einen Agenten aus, nachdem sie über das Ende ihrer Schicht Zeit. Standardeinstellung ist Aus. + +<BR> +<A NAME="vicidial_user_groups-group_shifts"> +<BR> +<B>Gruppe Verschiebungen - </B> Dies ist eine Liste der wählbaren Schichten, die sich die Agenten anmelden, Zeit auf dem System. + <BR> <A NAME="vicidial_user_groups-allowed_campaigns"> <BR> <B>Erlaubte Kampagnen -</B> dieses ist eine auswählbare Liste der Kampagnen,zu denen Mitglieder dieser Benutzergruppe innen protokollieren könnenin. Die ALL-CAMPAIGNS Wahl erlaubt den Benutzern in dieser Gruppe, injeder möglicher Kampagne auf dem System innen zu sehen und zuprotokollieren. +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_user_groups-qc_allowed_campaigns"> + <BR> + <B>QC erlaubt Kampagnen - </B> Dies ist eine Liste der wählbaren Kampagnen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-KAMPAGNEN Option ermöglicht es dem Benutzer in dieser Gruppe, QC einer Kampagne auf dem System. + + <BR> + <A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> + <BR> + <B>QC erlaubt Inbound Gruppen - </B> Dies ist eine Liste der wählbaren Eingang Gruppen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Benutzergruppe zu QC jede eingehende Gruppe über das System. + <? + } +?> @@ -2743,25 +4018,31 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN -<BR><BR><BR><BR> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_LEAD_FILTERTABELLE</FONT></B><BR><BR> -<A NAME="vicidial_lead_filters-lead_filter_id"> -<BR> -<B>Filter Identifikation -</B> Dieses ist der kurze Name eines VicidialLeitung Filter. Dieser muß ein einzigartiger Bezeichner sein.Benutzen Sie keine Räume, oder Interpunktion für diesesfangen Maximum 10 Buchstaben, Minimum von 2 Buchstaben auf. + <B><FONT SIZE=3>VICIDIAL_LEAD_FILTERTABELLE</FONT></B><BR><BR> + <A NAME="vicidial_lead_filters-lead_filter_id"> + <BR> + <B>Filter Identifikation -</B> Dieses ist der kurze Name eines VicidialLeitung Filter. Dieser muß ein einzigartiger Bezeichner sein.Benutzen Sie keine Räume, oder Interpunktion für diesesfangen Maximum 10 Buchstaben, Minimum von 2 Buchstaben auf. -<BR> -<A NAME="vicidial_lead_filters-lead_filter_name"> -<B>Filter-Name -</B> Dieses ist ein beschreibenderer Name des Filter.Dieses ist eine kurze Zusammenfassung der Filtermaximum 30 Buchstaben,Minimum von 2 Buchstaben. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_name"> + <B>Filter-Name -</B> Dieses ist ein beschreibenderer Name des Filter.Dieses ist eine kurze Zusammenfassung der Filtermaximum 30 Buchstaben,Minimum von 2 Buchstaben. -<BR> -<A NAME="vicidial_lead_filters-lead_filter_comments"> -<B>Filter kommentiert -</B> Dieses ist, wo Sie Anmerkungen für einenVicidial Filter wie - Anrufe alle Kalifornien Leitungen -. Maximum 255Buchstaben setzen können, Minimum von 2 Buchstaben. - -<BR> -<A NAME="vicidial_lead_filters-lead_filter_sql"> -<B>Filter SQL -</B> Dieses ist, wohin Sie das SQL Frage Fragment setzen,das Sie vorbei filtern möchten anfangen nicht, oder Ende mit UND, dasdurch den Zufuhrbehälter cron Index automatisch hinzugefügt wird.eine Beispiel SQL Frage, die hier arbeiten würde, ist called_count \4 und called_count \. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_comments"> + <B>Filter kommentiert -</B> Dieses ist, wo Sie Anmerkungen für einenVicidial Filter wie - Anrufe alle Kalifornien Leitungen -. Maximum 255Buchstaben setzen können, Minimum von 2 Buchstaben. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_sql"> + <B>Filter SQL -</B> Dieses ist, wohin Sie das SQL Frage Fragment setzen,das Sie vorbei filtern möchten anfangen nicht, oder Ende mit UND, dasdurch den Zufuhrbehälter cron Index automatisch hinzugefügt wird.eine Beispiel SQL Frage, die hier arbeiten würde, ist called_count \4 und called_count \. + <? + } +?> @@ -2802,43 +4083,75 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL LISTE LADEVORRICHTUNG FUNKTIONALITÄT</FONT></B><BR><BR> -<A NAME="vicidial_list_loader"> +<B><FONT SIZE=3>VICIDIAL_SHIFTSTABELLE</FONT></B><BR><BR> +<A NAME="vicidial_shifts-shift_id"> <BR> -Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach entworfen, um eine Leitung Akte zu nehmen - bis zu 8MB in derGröße - die entweder Vorsprung oder das abgegrenzte Rohr und es indie vicidial_list Tabelle zu laden ist. Die Leitung Ladevorrichtungläßt auffangen das Wählen zu und TXT- deutlich Text, CSV-Komma getrennte Werte und XLS- übertreffen Akte Formate. Die LeitungLadevorrichtung tut nicht Datenprüfung, aber sie erlaubt Ihnen, aufDuplikate in sich, innerhalb der Kampagne oder innerhalb des gesamtenSystems zu überprüfen. Auch überprüfen Sie, ob Sie die Listeerstellt haben, daß diese Leitungen darunter sein sollen, damit Siesie benutzen können. Ist hier eine Liste von auffängt inihrem korrekten Auftrag für die Leitung Akten: - <OL> - <LI>Verkäufer-Leitung Code - zeigt oben im Verkäufer, den Identifikationvom GUI auffangen - <LI>Quellenprogramm - interner Gebrauch nur für admins und DBAs - <LI>Liste Identifikation - die Liste Zahl, die diese Leitungen obendarunter zeigen - <LI>Telefon-Code - das Präfix für die Telefonnummer - 1 für US, 01144für Großbritannien, 01161 für AUS, usw. - <LI>Telefonnummer - muß mindestens 8 Stellen lang sein - <LI>Titel - Titel dem Kunden - Herr Ms Mrs, usw.... - <LI>Vorname - <LI>Mittlere Initiale - <LI>Letzter Name - <LI>Adresse Linie 1 - <LI>Adresse Linie 2 - <LI>Adresse Linie 3 - <LI>Stadt - <LI>Zustand - begrenzt auf 2 Buchstaben - <LI>Provinz - <LI>Postcode - <LI>Land - <LI>Geschlecht - <LI>Geburtsdatum - <LI>Wechselnde Telefonnummer - <LIEmailaddress - <LI>Sicherheit Phrase - <LI>Anmerkungen - </OL> +<B>Shift-ID - </B> Das ist der kurze Name der Vicidial Shift Definition. Dies muss eine eindeutige Kennung. Verwenden Sie keine Leerzeichen oder Satzzeichen für dieses Feld. max 20 Zeichen, mindestens 2-Zeichen. -<BR>ANMERKUNGEN: Die übertreffenleitung Ladevorrichtung Funktionalitätwird durch eine Reihe Perl Indexe ermöglicht und muß eine richtigzusammengebaute /etc/astguiclient.conf Akte im Platz auf dem webserver haben. Auch ein Paarperl Module müssen für sie, um außerdemzu arbeiten - OLE-Storage_Lite-Storage_Lite undVerteilungsbogen-ParseExcel geladen werden. Sie können aufLaufzeitfehler in diesen überprüfen, indem Sie Ihre Apache error_logAkte betrachten. Auch für Doppelprüfungen gegen gampaignverzeichnet, die Liste, die neue Leitungen hat, in es einzusteigenmuß im System verursacht werden, bevor Sie beginnen, die Leitungen zuladen. +<BR> +<A NAME="vicidial_shifts-shift_name"> +<B>Shift Name - </B> Dies ist eine beschreibende Bezeichnung der Shift Definition. Dies ist eine kurze Zusammenfassung der Shift Definition. max 50 Zeichen, mindestens 2-Zeichen. + +<BR> +<A NAME="vicidial_shifts-shift_start_time"> +<B>Start Time Shift - </B> Es ist an der Zeit, dass die Kampagne Schicht beginnt. Darf nur Zahlen, 9:30 AM wäre 0930 und 5:00 PM wäre 1700. + +<BR> +<A NAME="vicidial_shifts-shift_length"> +<B>Shift Länge - </B> Das ist die Zeit in Stunden und Minuten, dass die Kampagne Schicht dauert. 8 Stunden wäre 08:00 Uhr und 7 Stunden und 30 Minuten würde 07:30. + +<BR> +<A NAME="vicidial_shifts-shift_weekdays"> +<B>Shift Wochentage - </B> In diesem Abschnitt sollten Sie die Tage der Woche, dass diese Verschiebung ist aktiv. + + + +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL LISTE LADEVORRICHTUNG FUNKTIONALITÄT</FONT></B><BR><BR> + <A NAME="vicidial_list_loader"> + <BR> + Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach entworfen, um eine Leitung Akte zu nehmen - bis zu 8MB in derGröße - die entweder Vorsprung oder das abgegrenzte Rohr und es indie vicidial_list Tabelle zu laden ist. Die Leitung Ladevorrichtungläßt auffangen das Wählen zu und TXT- deutlich Text, CSV-Komma getrennte Werte und XLS- übertreffen Akte Formate. Die LeitungLadevorrichtung tut nicht Datenprüfung, aber sie erlaubt Ihnen, aufDuplikate in sich, innerhalb der Kampagne oder innerhalb des gesamtenSystems zu überprüfen. Auch überprüfen Sie, ob Sie die Listeerstellt haben, daß diese Leitungen darunter sein sollen, damit Siesie benutzen können. Ist hier eine Liste von auffängt inihrem korrekten Auftrag für die Leitung Akten: + <OL> + <LI>Verkäufer-Leitung Code - zeigt oben im Verkäufer, den Identifikationvom GUI auffangen + <LI>Quellenprogramm - interner Gebrauch nur für admins und DBAs + <LI>Liste Identifikation - die Liste Zahl, die diese Leitungen obendarunter zeigen + <LI>Telefon-Code - das Präfix für die Telefonnummer - 1 für US, 01144für Großbritannien, 01161 für AUS, usw. + <LI>Telefonnummer - muß mindestens 8 Stellen lang sein + <LI>Titel - Titel dem Kunden - Herr Ms Mrs, usw.... + <LI>Vorname + <LI>Mittlere Initiale + <LI>Letzter Name + <LI>Adresse Linie 1 + <LI>Adresse Linie 2 + <LI>Adresse Linie 3 + <LI>Stadt + <LI>Zustand - begrenzt auf 2 Buchstaben + <LI>Provinz + <LI>Postcode + <LI>Land + <LI>Geschlecht + <LI>Geburtsdatum + <LI>Wechselnde Telefonnummer + <LIEmailaddress + <LI>Sicherheit Phrase + <LI>Anmerkungen + </OL> + + <BR>ANMERKUNGEN: Die übertreffenleitung Ladevorrichtung Funktionalitätwird durch eine Reihe Perl Indexe ermöglicht und muß eine richtigzusammengebaute /etc/astguiclient.conf Akte im Platz auf dem webserver haben. Auch ein Paarperl Module müssen für sie, um außerdemzu arbeiten - OLE-Storage_Lite-Storage_Lite undVerteilungsbogen-ParseExcel geladen werden. Sie können aufLaufzeitfehler in diesen überprüfen, indem Sie Ihre Apache error_logAkte betrachten. Auch für Doppelprüfungen gegen gampaignverzeichnet, die Liste, die neue Leitungen hat, in es einzusteigenmuß im System verursacht werden, bevor Sie beginnen, die Leitungen zuladen. -<BR><BR><BR><BR> - + <BR><BR><BR><BR> + <? + } +?> @@ -3179,6 +4492,58 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>DBY Tor -</B> Das MySQL TCP Tor, das dieser Benutzer beim Anschließenbenutzen sollte. Rückstellung ist 3306. Zweitensserver, nicht z.Z. verwendet. +<BR> +<A NAME="phones-alias_id"> +<BR> +<B>Alias-ID - </B> Die ID des Alias verwendet, um für Telefon-Lastenausgleich Logins. keine Leerzeichen oder andere Sonderzeichen erlaubt. Muss zwischen 2 und 20 Zeichen lang sein. + +<BR> +<A NAME="phones-alias_name"> +<BR> +<B>Alias-Name - </B> Der Name für die Bezeichnung eines Handys Alias, muss zwischen 2 und 50 Zeichen lang sein. + +<BR> +<A NAME="phones-logins_list"> +<BR> +<B>Telefone Logins List - </B> Das Komma getrennt Liste der Telefonnummern Logins verwendet, wenn ein Agent meldet sich mit Telefon Lastenausgleich Logins. Der Agent-Anwendung finden Sie die Aktive Server mit den wenigsten Makler eingeloggt ist und ein Anruf aus, dass der Server-Agent bei der Anmeldung. + +<BR> +<A NAME="phones-email"> +<BR> +<B>Telefon E-Mail - </B> Die E-Mail-Adresse im Zusammenhang mit diesem Telefon-Eintrag. Dies ist für die Mailbox-Einstellungen. + +<BR> +<A NAME="phones-template_id"> +<BR> +<B>Vorlagen-ID - </B> Das ist die conf Datei template-ID, die dieses Telefon-Eintrag wird für die Asterisk-Einstellungen. Standard ist - KEINE --. + +<BR> +<A NAME="phones-conf_override"> +<BR> +<B>Conf Override Settings -</B> If populated, and the Vorlagen-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. + +<BR> +<A NAME="phones-group_alias_id"> +<BR> +<B>Alias-ID-Gruppe - </B> die ID der Gruppe Alias von Agenten wählen Sie fordert von der VICIDIAL Agent-Schnittstelle mit verschiedenen Caller-IDs. keine Leerzeichen oder andere Sonderzeichen erlaubt. Muss zwischen 2 und 20 Zeichen lang sein. + +<BR> +<A NAME="phones-group_alias_name"> +<BR> +<B>Alias-Name-Fraktion - </B> Der Name für die Bezeichnung einer Gruppe Alias, muss zwischen 2 und 50 Zeichen lang sein. + +<BR> +<A NAME="phones-caller_id_number"> +<BR> +<B>Anrufer-ID-Nummer - </B> Die Caller-ID-Nummer, die in dieser Gruppe Alias. Muss nur Ziffern. + +<BR> +<A NAME="phones-caller_id_name"> +<BR> +<B>Anrufer-ID Name - </B> Die Anrufer-ID-Namen ein, können mit dieser Gruppe Alias. Soweit wir wissen, wird dies nur funktionieren, in Kanada über den PRI-Leitungen und mit einer Schleife IAX Stamm durch Asterisk. + + + <BR><BR><BR><BR> @@ -3202,6 +4567,21 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>Aktiv -</B> Stellen Sie ein, ob der Sternchenbediener aktiv oderunaktiviert ist. +<BR> +<A NAME="servers-sysload"> +<BR> +<B>System Load -</B> Diese beiden Statistiken zeigen, die loadavg ein System mal 100 und die CPU-Auslastung Anteil des Bediener und wird jede Minute aktualisiert. Die loadavg sollte im Durchschnitt unter 100 multipliziert mit der Anzahl der CPU-Kernen Ihr System hat, für eine optimale Leistung zu erzielen. Die CPU-Auslastung Prozentsatz sollte Aufenthalt unter 50 für eine optimale Leistung zu erzielen. + +<BR> +<A NAME="servers-channels_total"> +<BR> +<B>Live-Channels -</B> Dieses Feld zeigt die aktuelle Anzahl der Asterisk-Kanäle, die sich live über das System jetzt. Es ist wichtig zu beachten, dass die Anzahl der Kanäle Asterisk ist in der Regel viel höher als die tatsächliche Zahl der Anrufe auf einem System. Dieses Feld wird einmal pro Minute aktualisiert. + +<BR> +<A NAME="servers-disk_usage"> +<BR> +<B>Disk Usage -</B> Dieses Feld wird die Nutzung der Festplatte für jede Partition auf diesem Server. Dieses Feld wird einmal pro Minute aktualisiert. + <BR> <A NAME="servers-asterisk_version"> <BR> @@ -3212,6 +4592,11 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>Maximale VICIDIAL Stämme -</B> Dieses fangen feststellt diemaximale Zeilenzahl auf, um denen der VICIDIAL Auto-dialer versucht,diesen Bediener zu ersuchen. Wenn Sie zwei volle PRI Tß VICIDIALingauf einem Bediener einweihen möchten dann, würden Sie dieses bis 46einstellen. Rückstellung ist 96. +<BR> +<A NAME="servers-outbound_calls_per_second"> +<BR> +<B>Max Calls pro Sekunde -</B> Diese Einstellung bestimmt die maximale Anzahl von Anrufen, die sich durch den Ausgang Auto-Einwahl-Script auf diesem Server pro Sekunde. Muss zwischen 1 und 100. Der Standardwert ist 20. + <BR> <A NAME="servers-telnet_host"> <BR> @@ -3292,6 +4677,111 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>VICIDIAL Balance Offlimits -</B> diese Einstellung definiert die ZahlStämmen, um die VICIDIAL Balance nicht zu erlauben, die wählt, um zuverwenden. Z.B. wenn Sie haben, wird 40 maximale vicidial Stämme undBalance offlimits bis 10 eingestellt, die Sie nur in der LageSIND, 30Hauptluftlinien für VICIDIAL Balance das Wählen zu benutzen.Rückstellung ist 0. +<BR> +<A NAME="servers-recording_web_link"> +<BR> +<B>Aufnahme Web-Link - </B> Diese Einstellung erlaubt es Ihnen, sich über die Standard in der Anzeige der Aufnahme-Link im Admin-Web-Seiten. Der Standardwert ist SERVER_IP. + +<BR> +<A NAME="servers-alt_server_ip"> +<BR> +<B>Alternate Recording Bediener IP - </B> Diese Einstellung können Sie eine Server-IP oder andere Rechner-Namen ein, kann anstelle der server_ip in die Links zu den Aufnahmen in der Admin-Web-Seiten. Der Standardwert ist leer. + +<BR> +<A NAME="servers-active_asterisk_server"> +<BR> +<B>Aktive Server Asterisk - </B>, wenn Asterisk läuft nicht auf diesem Server, oder, wenn VICIDIAL sollten nicht mit diesem Server, oder, wenn es nur mit diesem Server für andere Skripte wie die Be-Hopper Skript ausführen möchten, um dies zu N. Standard ist Y. + +<BR> +<A NAME="servers-generate_vicidial_conf"> +<BR> +<B>Conf-Dateien erzeugen - </B> Wenn Sie möchten, dass das System für die automatische Generierung von Sternchen conf-Dateien auf der Grundlage der Telefone Einträge, Träger Einträge und Load-Balancing-Setup in VICIDIAL dann dies auf Y. Der Standardwert ist Y. + +<BR> +<A NAME="servers-rebuild_conf_files"> +<BR> +<B>Rebuild conf Dateien - </B> Wenn Sie wollen, um einen Wiederaufbau der Asterisk conf-Dateien, oder wenn eines der Handys oder Carrier-Einträge geändert haben, dann sollte so eingestellt werden, dass Y. Nach der conf-Dateien wurden erzeugt und Asterisk hat wurden neu geladen, so wird diese Veränderung zu N. Voreingestellt ist Y. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>vicidial_conf_templatesTABELLE</FONT></B><BR><BR> +<A NAME="vicidial_conf_templates-template_id"> +<BR> +<B>Vorlagen-ID - </B> Dieses Feld muss mindestens 2 Zeichen lang sein und nicht mehr als 15 Zeichen lang sein, kein Leerzeichen. Dies ist die ID, die verwendet werden, um die conf Vorlage des gesamten Systems. + +<BR> +<A NAME="vicidial_conf_templates-template_name"> +<BR> +<B>Template Name - </B> Dies ist der beschreibende Name der Conf-Datei-Vorlage Eintrag. + +<BR> +<A NAME="vicidial_conf_templates-template_contents"> +<BR> +<B>Template Inhalt - </B> Dieses Feld ist, wo können Sie in den Einstellungen, die von allen Telefonen und-oder Luftfahrtunternehmen, die für die Verwendung dieser Vorlage conf. Bereiche, die nicht in diesem Feld sind: geheim, accountcode, Konto, Benutzernamen und Mailbox. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>vicidial_server_carriersTABELLE</FONT></B><BR><BR> +<A NAME="vicidial_server_carriers-carrier_id"> +<BR> +<B>Carrier-ID - </B> Dieses Feld muss mindestens 2 Zeichen lang sein und nicht mehr als 15 Zeichen lang sein, kein Leerzeichen. Dies ist die ID, die verwendet werden, um die Träger für diesen speziellen Eintrag im gesamten System. + +<BR> +<A NAME="vicidial_server_carriers-carrier_name"> +<BR> +<B>Carrier Name - </B> Dies ist der beschreibende Name des Beförderers Eintrag. + +<BR> +<A NAME="vicidial_server_carriers-registration_string"> +<BR> +<B>Anmeldung String - </B> Dieses Feld ist, wo können Sie in die genaue String benötigt, der SIP-oder IAX-Konfigurations-Datei zu registrieren, um den Anbieter. Optional, aber dringend empfohlen, wenn Ihr durch die Registrierung. + +<BR> +<A NAME="vicidial_server_carriers-template_id"> +<BR> +<B>Vorlagen-ID - </B> Dieses optionale Feld ermöglicht es Ihnen, wählen Sie eine conf-Datei-Vorlage für dieses Luftfahrtunternehmen Eintrag. + +<BR> +<A NAME="vicidial_server_carriers-account_entry"> +<BR> +<B>Konto-Eintrag - </B> Dieses Feld wird verwendet, wenn Sie nicht ausgewählt haben eine Vorlage zu verwenden, und es ist, wo können Sie in den spezifischen Einstellungen, die für diesen Träger. Wenn Sie sich in eingehenden Anrufen von diesem Luftfahrtunternehmen Stamm möchten Sie vielleicht die context = trunkinbound in diesem Bereich, so dass Sie verwenden können, der DID-Handling innerhalb VICIDIAL. + +<BR> +<A NAME="vicidial_server_carriers-protocol"> +<BR> +<B>Protokoll - </B> Mit diesem Feld können Sie festlegen, das Protokoll zu verwenden für die Carrier-Eintrag. Derzeit werden nur IAX-und SIP unterstützt werden. + +<BR> +<A NAME="vicidial_server_carriers-globals_string"> +<BR> +<B>Global String - </B> Dieses optionale Feld können Sie die Definition einer globalen Variablen, die für die Träger in der dialplan. + +<BR> +<A NAME="vicidial_server_carriers-dialplan_entry"> +<BR> +<B>Dialplan Eintrag - </B> Dieses optionale Feld können Sie festlegen, eine Reihe von dialplan Einträge, die für diesen Träger. + +<BR> +<A NAME="vicidial_server_carriers-server_ip"> +<BR> +<B>Bediener IP - </B> Dies ist der Server, dass dieser besondere Träger wird im Zusammenhang mit. + +<BR> +<A NAME="vicidial_server_carriers-active"> +<BR> +<B>Aktive - </B> Diese legt fest, ob der Träger wird in den automatisch generierten conf-Dateien oder nicht. + + + + <BR><BR><BR><BR> @@ -3308,13 +4798,19 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en -<BR><BR><BR><BR> - -<B><FONT SIZE=3>VICIDIAL_SERVER_TRUNKSTABELLE</FONT></B><BR><BR> -<A NAME="vicidial_server_trunks"> -<BR> -<B>VICIDIAL Bediener-Stämme erlaubt Ihnen, die gehenden Leitungeneinzuschränken, die auf diesem Bediener für die Kampagne benutztwerden, die auf einer Prokampagne Grundlage wählt. Sie haben dieWahl, zum einer spezifischen Zeilenzahl durch nur eine Kampagneverwendet zu werden aufzuheben,, sowie das Lassen dieser Kampagneüber seine reservierten Linien laufen in was Linien geöffnetbleiben, wie, lang an den Gruppenzeilen, die durch vicidial auf diesemBediener benutzt werden, sind kleiner als die Maximum VICIDIALStammeinstellung. Erlaubt Haben nicht irgendwelche dieserAufzeichnungen die Kampagne, die die Linie zuerst wählt, um da vieleLinien zu haben, während sie unter der Maximum VICIDIAL erhalten kannStammeinstellung.</B> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> + <B><FONT SIZE=3>VICIDIAL_SERVER_TrunksTABELLE</FONT></B><BR><BR> + <A NAME="vicidial_server_trunks"> + <BR> + <B>VICIDIAL Bediener-Stämme erlaubt Ihnen, die gehenden Leitungeneinzuschränken, die auf diesem Bediener für die Kampagne benutztwerden, die auf einer Prokampagne Grundlage wählt. Sie haben dieWahl, zum einer spezifischen Zeilenzahl durch nur eine Kampagneverwendet zu werden aufzuheben,, sowie das Lassen dieser Kampagneüber seine reservierten Linien laufen in was Linien geöffnetbleiben, wie, lang an den Gruppenzeilen, die durch vicidial auf diesemBediener benutzt werden, sind kleiner als die Maximum VICIDIALStammeinstellung. Erlaubt Haben nicht irgendwelche dieserAufzeichnungen die Kampagne, die die Linie zuerst wählt, um da vieleLinien zu haben, während sie unter der Maximum VICIDIAL erhalten kannStammeinstellung.</B> + <? + } +?> @@ -3331,6 +4827,99 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>Webroot schreibbar -</B> diese Einstellung erlaubt Ihnen zu definieren, obTemperatur Akten und Authentisierung Akten in das webroot auf Ihr webserver gelegt werden sollten. Rückstellung ist 1. +<BR> +<A NAME="settings-vicidial_agent_disable"> +<BR> +<B>VICIDIAL Mittel sperren Anzeige -</B> diese fangen wirdverwendet, vorzuwählen auf, wann man einem Mittel zeigt, wann ihrLernabschnitt durch das System, eine Managertätigkeit oder durch einexternes Maß gesperrt worden ist. Die NOT_ACTIVE Einstellung sperrtdie Anzeige auf dem Mittelschirm. Die LIVE_MITTELEinstellung zeigt nurdie untaugliche Anzeige, wenn die Mittel vicidial_auto_callsAufzeichnung entfernt worden ist, wie während ein Kraft Logout oderDringlichkeitslogout an. + +<BR> +<A NAME="settings-allow_sipsak_messages"> +<BR> +<B>Erlauben Sie SIPSAK Anzeigen -</B> wenn Satz bis 1, dieses dieTelefontabelle Einstellung richtig arbeiten läßt, schickt derBediener Anzeigen zum SIP Telefon zur Anzeige auf der Telefon LCDAnzeige, wenn er in VICIDIAL geloggt wird. Diese Eigenschaft arbeitetnur mit SIP Telefonen und erfordert sipsak Anwendung, auf das webserver angebracht zu werden. Rückstellung ist 0. + +<BR> +<A NAME="settings-vdc_agent_api_active"> +<BR> +<B>Agent API Aktive - </B> Wenn auf 1 gesetzt, wird die Agent-API-Schnittstelle zu funktionieren. Standard ist 0. + +<BR> +<A NAME="settings-admin_home_url"> +<BR> +<B>Admin Haupt-URL -</B> dieses ist die URL oder Web site Adresse, daß Siegehen, wenn Sie an die HAUPTVERBINDUNG an der Oberseite der admin.phpSeite klicken. + +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Ermöglichen Sie Vertreter-Übergangsprotokolldatei - diese Wahlprotokolliert in einer Textprotokolldatei auf dem webserver, jedesmalwenn ein Anruf auf ein Mittel gebracht wird. Rückstellung ist 0,gesperrt. + +<BR> +<A NAME="settings-timeclock_end_of_day"> +<BR> +<B>Timeclock End of Day - </B> Diese Einstellung legt fest, wenn alle Benutzer werden automatisch abgemeldet der timeclock System. Läuft nur einmal pro Tag. darf nur 4 Ziffern 2 Digit Stunden und 2 Minuten in Ziffer 24 Stunden Zeit. Standard ist 0000. + +<BR> +<A NAME="settings-timeclock_last_reset_date"> +<BR> +<B>LetzteTimeclock Auto Logout - </B> Dieses Feld zeigt das Datum der letzten Auto-logout. + +<BR> +<A NAME="settings-vdc_header_date_format"> +<BR> +<B>Agent Screen Header Datum Format - </B> Mit diesem Menü können Sie das Format des Datums, das zeigt sich an der Spitze der VICIDIAL Agent Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist MS_DASH_24HR<BR> +MS_DASH_24HR 2008-06-24 23:59:59 - Standard-Datum-Format Jahr Monat Tag gefolgt von 24-Stunden-Zeit<BR> +US_SLASH_24HR 06/24/2008 23:59:59 - USA Datum-Format mit Monat Tag Jahr gefolgt von 24-Stunden-Zeit<BR> +EU_SLASH_24HR 24/06/2008 23:59:59 - Europäische Datumsformat mit Tag Monat Jahr gefolgt von 24-Stunden-Zeit<BR> +AL_TEXT_24HR JUN 24 23:59:59 - Text-Format mit Datum abgekürzt Monat Tag gefolgt von 24-Stunden-Zeit<BR> +MS_DASH_AMPM 2008-06-24 11:59:59 PM - Standard-Datum-Format Jahr Monat Tag gefolgt von 12-Stunden-Zeit<BR> +US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA Datum-Format mit Monat Tag Jahr gefolgt von 12-Stunden-Zeit<BR> +EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europäische Datumsformat mit Tag Monat Jahr gefolgt von 12-Stunden-Zeit<BR> +AL_TEXT_AMPM JUN 24 11:59:59 PM - Text-Format mit Datum abgekürzt Monat Tag gefolgt von 12-Stunden-Zeit<BR> + +<BR> +<A NAME="settings-vdc_customer_date_format"> +<BR> +<B>Agent Screen Kunden Datum Format - </B> Mit diesem Menü können Sie das Format des Kunden Zeitzone Datum, zeigt sich an der Spitze der Customer Information des VICIDIAL Agent Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist AL_TEXT_AMPM<BR> +MS_DASH_24HR 2008-06-24 23:59:59 - Standard-Datum-Format Jahr Monat Tag gefolgt von 24-Stunden-Zeit<BR> +US_SLASH_24HR 06/24/2008 23:59:59 - USA Datum-Format mit Monat Tag Jahr gefolgt von 24-Stunden-Zeit<BR> +EU_SLASH_24HR 24/06/2008 23:59:59 - Europäische Datumsformat mit Tag Monat Jahr gefolgt von 24-Stunden-Zeit<BR> +AL_TEXT_24HR JUN 24 23:59:59 - Text-Format mit Datum abgekürzt Monat Tag gefolgt von 24-Stunden-Zeit<BR> +MS_DASH_AMPM 2008-06-24 11:59:59 PM - Standard-Datum-Format Jahr Monat Tag gefolgt von 12-Stunden-Zeit<BR> +US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA Datum-Format mit Monat Tag Jahr gefolgt von 12-Stunden-Zeit<BR> +EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europäische Datumsformat mit Tag Monat Jahr gefolgt von 12-Stunden-Zeit<BR> +AL_TEXT_AMPM JUN 24 11:59:59 PM - Text-Format mit Datum abgekürzt Monat Tag gefolgt von 12-Stunden-Zeit<BR> + +<BR> +<A NAME="settings-vdc_header_phone_format"> +<BR> +<B>Agent Screen Kunden Telefon Format - </B> Mit diesem Menü können Sie das Format des Kunden Rufnummer, zeigt sich in den Status des Agenten VICIDIAL Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist US_PARN<BR> +US_DASH 000-000-0000 - USA Bindestrich getrennt Telefonnummer<BR> +US_PARN (000)000-0000 - USA Bindestrich getrennt Nummer mit Vorwahl in Klammern<BR> +MS_NODS 0000000000 - Keine Formatierung<BR> +UK_DASH 00 0000-0000 - UK Bindestrich getrennt Telefonnummer mit Leerzeichen nach Stadt-Code<BR> +AU_SPAC 000 000 000 - Australia Leerzeichen getrennt Telefonnummer<BR> +IT_DASH 0000-000-000 - Italy Bindestrich getrennt Telefonnummer<BR> +FR_SPAC 00 00 00 00 00 - France Leerzeichen getrennt Telefonnummer<BR> + +<BR> +<A NAME="settings-vdc_agent_api_active"> +<BR> +<B>Agent interface API Access Aktive -</B> This option allows you to enable or disable the agent interface API. Default is 0. + +<BR> +<A NAME="settings-qc_features_active"> +<BR> +<B>QC Funktionen Aktive - </B> Mit dieser Option können Sie aktivieren oder deaktivieren Sie die QC oder Quality Control-Funktionen. Der Standardwert ist 0 für inaktiv. + +<BR> +<A NAME="settings-outbound_autodial_active"> +<BR> +<B>Outbound Auto-Dial Aktive - </B> Mit dieser Option können Sie aktivieren oder deaktivieren Sie ausgehende Auto-Einwahl in VICIDIAL, in diesem Bereich auf 0 werden die Listen und Filter Abschnitte und viele Felder aus der Kampagne Änderung Bildschirme. Manuelle Eingabe Wählfeld wird noch innerhalb der zulässigen Agent-Bildschirm, aber keine Liste Einwahl möglich sein wird. Der Standardwert ist 1 für aktive. + +<BR> +<A NAME="settings-outbound_calls_per_second"> +<BR> +<B>Max-FILL fordert pro Sekunde -</B> Diese Einstellung bestimmt die maximale Anzahl von Anrufen, die sich durch den Automobil-füllen Sie Outbound-Dialing-Skript automatisch für alle Server, pro Sekunde. Muss zwischen 1 und 200. Der Standardwert ist 40. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -3369,30 +4958,37 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <A NAME="settings-queuemetrics_eq_prepend"> <BR> -<B>QueueMetrics EnterQueue stellen voran -</B> dieses fangen wirdverwendet, das Voranstellen von einer der vicidial_list Datenzuzulassen auffängt vor der Telefonnummer des Kunden fürkundengebundene QueueMetrics Reports auf. Rückstellung ist KEINE,alles nicht zu bevölkern. +<B>QueueMetrics EnterQueue stellen voran -</B> dieses fangen wirdverwendet, das Voranstellen von einer der vicidial_list Datenzuzulassen auffängt vor der Telefonnummer des Kunden fürkundengebundene QueueMetrics Berichte auf. Rückstellung ist KEINE,alles nicht zu bevölkern. <BR> -<A NAME="settings-vicidial_agent_disable"> +<A NAME="settings-enable_vtiger_integration"> <BR> -<B>VICIDIAL Mittel sperren Anzeige -</B> diese fangen wirdverwendet, vorzuwählen auf, wann man einem Mittel zeigt, wann ihrLernabschnitt durch das System, eine Managertätigkeit oder durch einexternes Maß gesperrt worden ist. Die NOT_ACTIVE Einstellung sperrtdie Anzeige auf dem Mittelschirm. Die LIVE_MITTELEinstellung zeigt nurdie untaugliche Anzeige, wenn die Mittel vicidial_auto_callsAufzeichnung entfernt worden ist, wie während ein Kraft Logout oderDringlichkeitslogout an. +<B>Aktivieren vtiger Integration - </B> Diese Einstellung erlaubt es Ihnen zu ermöglichen vtiger Integration mit VICIDIAL. Derzeit Links zu vtiger admin und als auch als Nutzer Replikation sind die einzigen Integration Features zur Verfügung stehen. Standard ist 0. <BR> -<A NAME="settings-allow_sipsak_messages"> +<A NAME="settings-vtiger_server_ip"> <BR> -<B>Erlauben Sie SIPSAK Anzeigen -</B> wenn Satz bis 1, dieses dieTelefontabelle Einstellung richtig arbeiten läßt, schickt derBediener Anzeigen zum SIP Telefon zur Anzeige auf der Telefon LCDAnzeige, wenn er in VICIDIAL geloggt wird. Diese Eigenschaft arbeitetnur mit SIP Telefonen und erfordert sipsak Anwendung, auf das webserver angebracht zu werden. Rückstellung ist 0. +<B>Vtiger HE Bediener IP - </B> Das ist die IP-Adresse der Datenbank für Ihre vtiger-Installation. <BR> -<A NAME="settings-admin_home_url"> +<A NAME="settings-vtiger_dbname"> <BR> -<B>Admin Haupt-URL -</B> dieses ist die URL oder Web site Adresse, daß Siegehen, wenn Sie an die HAUPTVERBINDUNG an der Oberseite der admin.phpSeite klicken. +<B>Vtiger Datenbankname - </B> Dies ist die Datenbank-Namen für Ihre Datenbank vtiger. <BR> -<A NAME="settings-enable_agc_xfer_log"> +<A NAME="settings-vtiger_login"> <BR> -<B>Ermöglichen Sie Vertreter-Übergangsprotokolldatei - diese Wahlprotokolliert in einer Textprotokolldatei auf dem webserver, jedesmalwenn ein Anruf auf ein Mittel gebracht wird. Rückstellung ist 0,gesperrt. - +<B>Vtiger Datenbank Login - </B> Das ist die Benutzernamen verwendet, um sich in Ihrem vtiger-Datenbank. +<BR> +<A NAME="settings-vtiger_pass"> +<BR> +<B>Vtiger Passwort für die Datenbank - </B> Dies ist das Passwort für die Anmeldung in Ihrem vtiger-Datenbank. +<BR> +<A NAME="settings-vtiger_url"> +<BR> +<B>Vtiger URL - </B> Das ist die URL oder Website-Adresse, um an Ihr vtiger-Installation. <BR><BR><BR><BR> @@ -3408,9 +5004,23 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIESTABELLE</FONT></B><BR><BR> <A NAME="vicidial_status_categories"> <BR> -<B>Durch den Gebrauch von Systemstatuskategorien, können Sie diezusammen gruppieren Status, um statistische Analyse auf einer GruppeStatus zuzulassen. Die Kategorie Identifikation muß 2-20 Buchstabenlang ohne Räume sein, muß der Name 2-50 Buchstaben lang sein, istdie Beschreibung wahlweise freigestellt und TimeonVDAD Anzeigedefiniert, ob dieser Status einer von bis zu 4 Status ist, die auf derZeit auf VDAD Realzeitreport errechnet werden und angezeigt werdenkönnen.</B> +<B>Durch den Gebrauch von Systemstatuskategorien, können Sie diezusammen gruppieren Status, um statistische Analyse auf einer GruppeStatus zuzulassen. Die Kategorie Identifikation muß 2-20 Buchstabenlang ohne Räume sein, muß der Name 2-50 Buchstaben lang sein, istdie Beschreibung wahlweise freigestellt und TimeonVDAD Anzeigedefiniert, ob dieser Status einer von bis zu 4 Status ist, die auf derZeit auf VDAD Realzeitreport errechnet werden und angezeigt werdenkönnen.</B> Der Verkauf Kategorie und Dead Lead Kategorie sind auch die von den US-Vorschlag, wenn die Analyse Liste Statistiken. +<? +if ($SSqc_features_active > 0) + { + ?> + <BR><BR><BR><BR> + + <B><FONT SIZE=3>VICIDIAL QC-Status-Codes</FONT></B><BR><BR> + <A NAME="vicidial_qc_status_codes"> + <BR> + <B>Das Quality Control QC-System innerhalb VICIDIAL hat seinen eigenen Satz der Status-Codes, getrennt von denen der Call-Handling Funktionen der VICIDIAL. QC statuse Codes muss zwischen 2 und 8 Zeichen lang sein und keine Sonderzeichen wie Leerzeichen oder Doppelpunkt. Die QK-Status-Code Beschreibung muss zwischen 2 und 30 Zeichen lang sein.</B> + <? + } +?> + <BR><BR><BR><BR><BR><BR><BR><BR> @@ -3509,7 +5119,7 @@ if ($ADD==73) ###################### if ($ADD==7111111) -{ + { ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; @@ -3549,459 +5159,115 @@ if ($ADD==7111111) $RGSIPexten = 'SIP/gs102'; $RGsession_id = '8600051'; -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; + $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = $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); + 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); + } + + $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("\n","
",$script_text); + + + echo ""; + + echo "Vorbetrachtung-Index: $script_id
\n"; + echo "
\n"; + echo "
$script_name
\n"; + echo "$script_text\n"; + echo "
\n"; + + echo "\n"; + + exit; } -$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("\n","
",$script_text); - -echo ""; - -echo "Vorbetrachtung-Index: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') - {$users_hh="bgcolor =\"$users_color\""; $users_fc="$users_font"; $users_bold="$header_selected_bold";} - else {$users_hh=''; $users_fc='WHITE'; $users_bold="$header_nonselected_bold";} -if ($hh=='campaigns') - {$campaigns_hh="bgcolor=\"$campaigns_color\""; $campaigns_fc="$campaigns_font"; $campaigns_bold="$header_selected_bold";} - else {$campaigns_hh=''; $campaigns_fc='WHITE'; $campaigns_bold="$header_nonselected_bold";} -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 ($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 "
English Deutsch
BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> - - - - - - - - - - - - - - - 1) { - ?> -> - 1) - { - -# if ($sh=='basic') {$basic_sh="bgcolor=\"$subcamp_color\""; $basic_fc="$subcamp_font";} -# else {$basic_sh=''; $basic_fc='BLACK';} -# if ($sh=='detail') {$detail_sh="bgcolor=\"$subcamp_color\""; $detail_fc="$subcamp_font";} -# else {$detail_sh=''; $detail_fc='BLACK';} -# if ($sh=='dialstat') {$dialstat_sh="bgcolor=\"$subcamp_color\""; $dialstat_fc="$subcamp_font";} -# else {$dialstat_sh=''; $dialstat_fc='BLACK';} - - 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';} - - ?> -> - - - - - - - - - 1) { - ?> - > - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # hard teal - else {$times_sh=''; $times_fc='BLACK';} - if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink - else {$phones_sh=''; $phones_fc='BLACK';} - if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink - else {$server_sh=''; $server_fc='BLACK';} - if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink - else {$conference_sh=''; $conference_fc='BLACK';} - if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink - else {$settings_sh=''; $settings_fc='BLACK';} - if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink - else {$status_sh=''; $status_fc='BLACK';} - - ?> -> - - - - - - - - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - \n"; - echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen.\n"; - } - -} -if (strlen($reports_hh) > 1) { - ?> -> - - - - -
  VICIDIAL ADMIN - HAUPT | Logout  
> SIZE=> Benutzer > SIZE=> Kampagnen > SIZE=> Listen > SIZE=> Indexe > SIZE=> Filter > SIZE=> In-Gruppen > SIZE=> Benutzer-Gruppen > SIZE=> Remotemittel > SIZE=> Admin > SIZE=> Reports
>   > Zeigen Sie Benutzer     |     > Addieren Sie Einen Neuen Benutzer     |     > Copy Benutzer     |     > Suche Nach Einem Benutzer
COLSPAN=2> SIZE=>Kampagnen Hauptsächlich COLSPAN=1> SIZE=> Statuses COLSPAN=1> SIZE=> HotKeys COLSPAN=2> SIZE=>Leitung Bereiten Auf COLSPAN=1> SIZE=>Vorwahlknopf Automobil-Alt COLSPAN=1> SIZE=>Pause Codes COLSPAN=2> SIZE=>Liste Mischung
>   > Zeigen Sie Kampagnen     |     > Addieren Sie Eine Neue Kampagne     |     > Copy Kampagne     |     > Realzeitkampagnen Zusammenfassend
>   > Zeigen Sie Listen     |     > Addieren Sie Eine Neue Liste     |     > Suche Nach Einer Leitung     |     > Fügen Sie Zahl DNC Hinzu     |     > Last Neue Leitungen
>   > Zeigen Sie Indexe     |     > Addieren Sie Einen Neuen Index
>   > Zeigen Sie Filter     |     > Addieren Sie Einen Neuen Filter
>   > Zeigen Sie In-Gruppen     |     > Addieren Sie Eine Neue In-Gruppe     |     > Copy In-Gruppe
>   > Zeigen Sie Benutzer-Gruppen     |     > Addieren Sie Eine Neue Benutzer-Gruppe     |     > Gruppe Stündlicher Report
>   > Zeigen Sie Remotemittel     |     > Addieren Sie Neue Remotemittel
COLSPAN=2> SIZE=> Anruf-Zeiten COLSPAN=2> SIZE=> Telefone COLSPAN=2> SIZE=> Konferenzen COLSPAN=1> SIZE=> Bediener COLSPAN=1> SIZE=> System Einstellungen COLSPAN=2> SIZE=>Systemstatus
>   > Zeigen Sie Anruf-Zeiten     |     > Addieren Sie Eine Neue Anruf-Zeit     |     > Zeigen Sie Zustand-Anruf-Zeiten     |     > Addieren Sie Eine Neue Zustand-Anruf-Zeit  
>   > Zeigen Sie Telefone   |   > Addieren Sie Ein Neues Telefon
> Zeigen Sie Konferenzen   |   > Addieren Sie Eine Neue Konferenz   |   > Zeigen Sie VICIDIAL Konferenzen   |   > Addieren Sie Eine Neue VICIDIAL Konferenz
> Zeigen Sie Bediener   |   > Addieren Sie Einen Neuen Bediener
> System Einstellungen
>Systemstatus   |   >Status-Kategorien
>  
- 1) { ###################### if ($ADD=="1") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; - - echo "
ADDIEREN Sie Einen NEUEN BENUTZER
\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Benutzer-Zahl: $NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE
Benutzer-Gruppe: \n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
\n"; + echo ""; + + echo "
ADDIEREN Sie Einen NEUEN BENUTZER\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
Benutzer-Zahl: $NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE
Benutzer-Gruppe:
Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
\n"; } - echo "$Ugroups_list"; - echo "\n"; - echo "
Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
\n"; - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### -# ADD=1 display the COPY USER FORM SCREEN +# ADD=1A display the COPY USER FORM SCREEN ###################### if ($ADD=="1A") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_users==1) + { + echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
COPY BENUTZER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
COPY BENUTZER\n"; + echo "\n"; + echo "\n"; + echo "
Benutzer-Zahl: $NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} - echo "\n"; + echo "\n"; + echo "
Benutzer-Zahl: $NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
Source User:
Source User: $NWB#vicidial_users-user$NWE
\n"; } - echo "$Uusers_list"; - echo "$NWB#vicidial_users-user$NWE
\n"; - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4120,41 +5390,49 @@ if ($ADD=="1A") ###################### if ($ADD==11) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN Sie Eine NEUE KAMPAGNE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Kampagne Identifikation: $NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Kampagne Beschreibung: $NWB#vicidial_campaigns-campaign_description$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: $NWB#vicidial_campaigns-park_ext$NWE
Park-Dateiname: $NWB#vicidial_campaigns-park_file_name$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Index: $NWB#vicidial_campaigns-campaign_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - } + echo "
ADDIEREN Sie Eine NEUE KAMPAGNE\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"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Kampagne Identifikation: $NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Kampagne Beschreibung: $NWB#vicidial_campaigns-campaign_description$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: $NWB#vicidial_campaigns-park_ext$NWE
Park-Dateiname: $NWB#vicidial_campaigns-park_file_name$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Index: $NWB#vicidial_campaigns-campaign_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4162,19 +5440,19 @@ if ($ADD==11) ###################### if ($ADD==12) -{ - if ($LOGmodify_campaigns==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_campaigns==1) + { + echo "\n"; - - echo "\n"; - echo "
\n"; + echo ""; - echo "
Copy Eine KAMPAGNE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
KopierenEine KAMPAGNE\n"; + echo "\n"; + echo "
Kampagne Identifikation: $NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "
Kampagne Identifikation: $NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Quellkampagne:
Quellkampagne:$NWB#vicidial_campaigns-campaign_id$NWE
Hinweis: Das Kopieren einer Kampagne kopiert alle Einstellungen aus dem Master-Kampagne, die Sie wählen, aber es wird nicht kopiert eine Kampagne-spezifische DNC, wenn es eine auf dem ausgewählten Master-Kampagne.
\n"; } - echo "$campaigns_list"; - echo "$NWB#vicidial_campaigns-campaign_id$NWE
\n"; - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4206,19 +5486,19 @@ if ($ADD==12) ###################### if ($ADD==111) -{ - if ($LOGmodify_lists==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; - echo "
ADD A NEW LIST\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Liste Identifikation: (nur Stellen)$NWB#vicidial_lists-list_id$NWE
Liste Name: $NWB#vicidial_lists-list_name$NWE
Liste Beschreibung: $NWB#vicidial_lists-list_description$NWE
Kampagne: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Liste Identifikation: (nur Stellen)$NWB#vicidial_lists-list_id$NWE
Liste Name: $NWB#vicidial_lists-list_name$NWE
Liste Beschreibung: $NWB#vicidial_lists-list_description$NWE
Kampagne: $NWB#vicidial_lists-campaign_id$NWE
Aktiv:$NWB#vicidial_lists-active$NWE
\n"; } - echo "$campaigns_list"; - echo "\n"; - echo "$NWB#vicidial_lists-campaign_id$NWE
Aktiv:$NWB#vicidial_lists-active$NWE
\n"; - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4251,79 +5532,128 @@ if ($ADD==111) ###################### if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + echo "
\n"; + echo ""; + + $campaigns_list = "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id"; $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NICHT ADDIERT - diese Telefonnummer ist bereits in benennen nichtListe: $phone_number

\n";} - else + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } - echo "
DNC FÜGTE HINZU: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); + 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 "
DNC NICHT ADDIERT - diese Telefonnummer ist bereits in benennen nichtListe: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC FÜGTE HINZU: $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='LISTEN', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN FÜGEN SIE ZAHL DNC HINZU 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 "
DNC NICHT ADDIERT - diese Telefonnummer ist bereits in benennen nichtListe: $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 "
DNC FÜGTE HINZU: $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='LISTEN', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; } } + + echo "
ADD Nummern auf dem DNC-LISTE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Telefon-Nummern:

(einer Telefonnummer pro Zeile nur)
$NWB#vicidial_list-dnc$NWE
\n"; } -echo "
FÜGEN Sie Eine ZAHL Der DNC LISTE Hinzu\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Telefonnummer: (nur Stellen)$NWB#vicidial_list-dnc$NWE
\n"; - -} - ###################### # ADD=1111 display the ADD NEW INBOUND GROUP SCREEN ###################### if ($ADD==1111) -{ + { if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN Sie Eine NEUE INBOUND GRUPPE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Gruppe Identifikation: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Aktiv:$NWB#vicidial_inbound_groups-active$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
Index: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } + echo "
ADDIEREN Sie Eine NEUE INBOUND GRUPPE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Gruppe Identifikation: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Aktiv:$NWB#vicidial_inbound_groups-active$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
Index: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4331,19 +5661,19 @@ if ($ADD==1111) ###################### if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_ingroups==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
COPY INBOUND GRUPPE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPY INBOUND GRUPPE\n"; + echo "\n"; + echo "
Gruppe Identifikation: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$groups_list"; + echo "$NWB#vicidial_inbound_groups-group_id$NWE\n"; - echo "\n"; - echo "
Gruppe Identifikation: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Source Gruppe Identifikation:
Source Gruppe Identifikation: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } + echo "
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
Hinzufügen einer neuen DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
DID-Erweiterung: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID-Beschreibung:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=1411 display the COPY DID SCREEN +###################### + +if ($ADD==1411) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
COPY DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
DID-Erweiterung: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID-Beschreibung:$NWB#vicidial_inbound_dids-did_description$NWE
Quelle DID:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4375,38 +5778,38 @@ if ($ADD==1211) ###################### if ($ADD==11111) -{ + { if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN SIE NEUE REMOTEMITTEL\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
Externe Verlängerung: (dial plan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
Status:$NWB#vicidial_remote_agents-status$NWE
Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Gruppen: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; - } + echo "
ADDIEREN SIE NEUE REMOTEMITTEL\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
Externe Verlängerung: (dial plan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
Status:$NWB#vicidial_remote_agents-status$NWE
Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Gruppen: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4414,26 +5817,26 @@ if ($ADD==11111) ###################### if ($ADD==111111) -{ + { if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN SIE NEUE BENUTZER-GRUPPE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } + echo "
ADDIEREN SIE NEUE BENUTZER-GRUPPE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4441,72 +5844,72 @@ if ($ADD==111111) ###################### if ($ADD==1111111) -{ + { if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Index Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_scripts-script_id$NWE
Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
Aktiv:$NWB#vicidial_scripts-active$NWE
Index-Text: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Index Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_scripts-script_id$NWE
Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
Aktiv:$NWB#vicidial_scripts-active$NWE
Index-Text: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4514,28 +5917,28 @@ if ($ADD==1111111) ###################### if ($ADD==11111111) -{ + { if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN SIE NEUEN FILTER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Filter Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } + echo "
ADDIEREN SIE NEUEN FILTER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Filter Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4543,29 +5946,29 @@ if ($ADD==11111111) ###################### if ($ADD==111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
Hinzufügen neuer Anrufzeiten\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
Hinzufügen neuer Anrufzeiten\n"; + echo "\n"; + echo "
Anrufzeit ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Anrufzeit ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; - } + echo "
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4573,30 +5976,70 @@ if ($ADD==111111111) ###################### if ($ADD==1111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
Hinzufügen neuer landesspezifischer Anrufzeiten\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
Hinzufügen neuer landesspezifischer Anrufzeiten\n"; + echo "\n"; + echo "
Landesspezifische Anrufzeiten ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-state_call_time_state$NWE
Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Landesspezifische Anrufzeiten ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-state_call_time_state$NWE
Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; - } + echo "
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
Shift-ID: (keine Räume oder Interpunktion)$NWB#vicidial_shifts-shift_id$NWE
Shift Name: (Kurze Beschreibung der Verlagerung)$NWB#vicidial_shifts-shift_name$NWE
Start Time Shift:\n"; + echo "   Shift End Time:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Länge: $NWB#vicidial_shifts-shift_length$NWE
Shift der Woche:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Sonntag
\n"; + echo "Montag
\n"; + echo "Dienstag
\n"; + echo "Mittwoch
\n"; + echo "Donnerstag
\n"; + echo "Freitag
\n"; + echo "Samstag
\n"; + echo "
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4604,47 +6047,111 @@ if ($ADD==1111111111) ###################### if ($ADD==11111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN Sie Ein NEUES TELEFON\n"; - echo "\n"; - echo "
\n"; + echo "
ADDIEREN Sie Ein NEUES TELEFON\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dial Plan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail Kasten: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Bediener IP: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dial Plan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail-Box: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Bediener IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Kennwort:$NWB#phones-pass$NWE
Status:$NWB#phones-status$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Kennwort:$NWB#phones-pass$NWE
Status:$NWB#phones-status$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=12111111111 display the ADD NEW PHONE ALIAS SCREEN +###################### + +if ($ADD==12111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
Hinzufügen einer neuen TEL ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias-ID:$NWB#phones-alias_id$NWE
Alias-Name: $NWB#phones-alias_name$NWE
Telefon Logins Liste: (comma separated)$NWB#phones-logins_list$NWE
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN +###################### + +if ($ADD==13111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
Eine neue Gruppe hinzuzufügen ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias-ID-Gruppe: $NWB#phones-group_alias_id$NWE
Gruppe Alias-Name: $NWB#phones-group_alias_name$NWE
CallerID Anzahl: $NWB#phones-caller_id_number$NWE
CallerID Name: $NWB#phones-caller_id_name$NWE
Aktiv:
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4652,29 +6159,127 @@ if ($ADD==11111111111) ###################### if ($ADD==111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN Sie Einen NEUEN BEDIENER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
\n"; - } + echo "
ADDIEREN Sie Einen NEUEN BEDIENER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
Neue CONF TEMPLATE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Vorlagen-ID: $NWB#vicidial_conf_templates-template_id$NWE
Template Name: $NWB#vicidial_conf_templates-template_name$NWE
Template-Inhalt: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CARRIER\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Carrier-ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
Anmeldung String: $NWB#vicidial_server_carriers-registration_string$NWE
Vorlagen-ID: $NWB#vicidial_server_carriers-template_id$NWE
Account-Eintrag: $NWB#vicidial_server_carriers-account_entry$NWE
Protokoll: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Eintrag: $NWB#vicidial_server_carriers-dialplan_entry$NWE
Bediener IP: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4682,30 +6287,30 @@ if ($ADD==111111111111) ###################### if ($ADD==1111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADDIEREN Sie Eine NEUE KONFERENZ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
Bediener IP: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
Bediener IP: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} ###################### @@ -4713,30 +6318,30 @@ if ($ADD==1111111111111) ###################### if ($ADD==11111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW VICIDIAL CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
Bediener IP: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
Bediener IP: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} @@ -4752,7 +6357,7 @@ if ($ADD==11111111111111) ###################### if ($ADD=="2") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4761,38 +6366,265 @@ if ($ADD=="2") {echo "
BENUTZER NICHT ADDIERT - es gibt bereits einen Benutzer im System mitdieser Benutzerzahl\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if (ereg('AUTOGENERA',$user)) + { + $user = 'AUTOGENERA'; + } + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
BENUTZER NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Teilnehmerbezeichnung muß zwischen 2 und 8 Buchstaben lang sein\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
voller Name und Kennwort müssen mindestens 2 Buchstaben lang sein\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 "
BENUTZER FÜGTE HINZU: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='BENUTZER', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); + $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 = 'Aktive'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=3; + } ###################### # ADD=2A adds the copied new user to the system ###################### if ($ADD=="2A") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4801,15 +6633,53 @@ if ($ADD=="2A") {echo "
BENUTZER NICHT ADDIERT - es gibt bereits einen Benutzer im System mitdieser Benutzerzahl\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) { echo "
BENUTZER NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Teilnehmerbezeichnung muß zwischen 2 und 8 Buchstaben lang sein\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
voller Name und Kennwort müssen mindestens 2 Buchstaben lang sein\n"; + echo "\n"; } else { - $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) 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 from vicidial_users where user=\"$source_user_id\";"; + 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) 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 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\";"; @@ -4818,30 +6688,216 @@ if ($ADD=="2A") $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='BENUTZER', event_type='COPY', record_id='$user', event_code='ADMIN COPY BENUTZER', 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 = 'Aktive'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A COPIED USER |$PHP_AUTH_USER|$ip|$user|$source_user_id|$stmt|\n"); - fclose($fp); - } } } -exit; -} + exit; + } ###################### # ADD=21 adds the new campaign to the system ###################### if ($ADD==21) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4870,31 +6926,28 @@ if ($ADD==21) $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) 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); - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $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='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } } } -$ADD=31; -} + $ADD=31; + } ###################### # ADD=20 adds copied new campaign to the system ###################### if ($ADD==20) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4913,7 +6966,7 @@ if ($ADD==20) { echo "
CAMPAIGN 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,safe_harbor_message,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) 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,safe_harbor_message,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $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) 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 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');"; @@ -4931,27 +6984,24 @@ if ($ADD==20) $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); - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY TO NEW CAMPAIGN|$PHP_AUTH_USER|$ip|$campaign_id|$source_campaign_id|$stmt|$stmtA|\n"); - fclose($fp); - } - + ### 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='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=31; -} + $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';"; $rslt=mysql_query($stmt, $link); @@ -4980,19 +7030,19 @@ if ($ADD==22) $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE STATUS', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$SUB=22; -$ADD=31; -} + $SUB=22; + $ADD=31; + } ###################### @@ -5000,7 +7050,7 @@ $ADD=31; ###################### if ($ADD==23) -{ + { $HKstatus_data = explode('-----',$HKstatus); $status = $HKstatus_data[0]; $status_name = $HKstatus_data[1]; @@ -5026,18 +7076,18 @@ if ($ADD==23) $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE HOT KEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE 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; -} + $SUB=23; + $ADD=31; + } ###################### @@ -5045,7 +7095,7 @@ $ADD=31; ###################### if ($ADD==25) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; @@ -5055,11 +7105,11 @@ if ($ADD==25) {echo "
KAMPAGNE LEITUNG BEREITEN NICHT HINZUGEFÜGT auf - es gibt bereitseine Führenwiederverwertung für diese Kampagne mit diesem Status\n";} else { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
KAMPAGNE LEITUNG BEREITEN NICHT HINZUGEFÜGT auf - gehen Sie bittezurück und betrachten Sie die Daten, die Sie eingaben\n"; echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; + echo "
Versuch verzögert muß mindestens 120 Sekunden sein und weniger als 43.200 Sekunden oder 12 Stunden\n"; echo "
maximale Versuche müssen von 1 bis 10 sein\n"; } else @@ -5069,18 +7119,18 @@ if ($ADD==25) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=25; -$ADD=31; -} + $SUB=25; + $ADD=31; + } ###################### @@ -5088,7 +7138,7 @@ $ADD=31; ###################### 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 %\";"; @@ -5116,18 +7166,18 @@ if ($ADD==26) $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A AUTO-ALT-DIAL STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE 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; -} + $SUB=26; + $ADD=31; + } ###################### @@ -5135,7 +7185,7 @@ $ADD=31; ###################### 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); @@ -5148,7 +7198,7 @@ if ($ADD==27) { echo "
MITTEL-PAUSE CODE NICHT ADDIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; echo "
pause code must be between 1 and 6 characters in length\n"; - echo "
pause code name must be between 2 and 30 characters in length\n"; + echo "
pause Code-Name muss zwischen 2 und 30 Zeichen lang sein\n"; } else { @@ -5157,18 +7207,18 @@ if ($ADD==27) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW MITTELPAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Pause Code: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=27; -$ADD=31; -} + $SUB=27; + $ADD=31; + } ###################### @@ -5176,7 +7226,7 @@ $ADD=31; ###################### if ($ADD==28) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; @@ -5204,18 +7254,18 @@ if ($ADD==28) $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN SIE KAMPAGNE DIAL STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status:$statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -#$SUB=28; -$ADD=31; -} + #$SUB=28; + $ADD=31; + } ###################### @@ -5223,7 +7273,7 @@ $ADD=31; ###################### if ($ADD==211) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); @@ -5246,17 +7296,17 @@ if ($ADD==211) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='LISTEN', 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=311; + } @@ -5265,7 +7315,7 @@ $ADD=311; ###################### if ($ADD==2111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5292,20 +7342,23 @@ if ($ADD==2111) $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) 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 "
GRUPPE FÜGTE HINZU: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=3111; -} + $ADD=3111; + } ###################### @@ -5313,7 +7366,7 @@ $ADD=3111; ###################### if ($ADD==2011) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5330,22 +7383,118 @@ if ($ADD==2011) } 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_message,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) 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_message,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
GRUPPE FÜGTE HINZU: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 COPY INBOUND GRUPPE', 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 "
NICHT HINZUGEFÜGT - Es gibt bereits eine DID in das System mit dieser ID\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 "
NICHT HINZUGEFÜGT - Es gibt bereits eine DID in das System mit dieser Erweiterung\n";} + else + { + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPIED TO NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
NICHT HINZUGEFÜGT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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=3111; -} + $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 "
NICHT HINZUGEFÜGT - Es gibt bereits eine DID in das System mit dieser Erweiterung\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 "
NICHT HINZUGEFÜGT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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) 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 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 COPY DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3311; + } ###################### @@ -5353,7 +7502,7 @@ $ADD=3111; ###################### 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); @@ -5374,24 +7523,24 @@ if ($ADD==21111) echo "
REMOTEMITTEL FÜGTEN HINZU: $user_start\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTEMITTEL ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } + ### 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=10000; + } ###################### # ADD=211111 adds new user group to the system ###################### if ($ADD==211111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); @@ -5412,24 +7561,100 @@ if ($ADD==211111) echo "
BENUTZER-GRUPPE ADDIERT: $user_group\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 ADDIEREN SIE BENUTZER-GRUPPE', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Einen NEUEN BENUTZER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=100000; + } ###################### # ADD=2111111 adds new script to the system ###################### if ($ADD==2111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); @@ -5450,17 +7675,17 @@ if ($ADD==2111111) echo "
INDEX FÜGTE HINZU: $script_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='INDEXE', event_type='ADD', record_id='$script_id', event_code='ADMIN ADDIEREN SIE INDEX', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=1000000; -} + $ADD=1000000; + } ###################### @@ -5468,7 +7693,7 @@ $ADD=1000000; ###################### if ($ADD==21111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); @@ -5489,17 +7714,17 @@ if ($ADD==21111111) echo "
FILTER ADDIERT: $lead_filter_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='FILTER', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN ADDIEREN SIE FILTER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=10000000; -} + $ADD=10000000; + } ###################### @@ -5507,7 +7732,7 @@ $ADD=10000000; ###################### if ($ADD==211111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); @@ -5528,17 +7753,17 @@ if ($ADD==211111111) echo "
Anrufzeit hinzugefügt: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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=311111111; + } ###################### @@ -5546,7 +7771,7 @@ $ADD=311111111; ###################### 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); @@ -5567,17 +7792,66 @@ if ($ADD==2111111111) echo "
landesspezifische Anrufzeiten hinzugefügt: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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=3111111111; + } + + +###################### +# ADD=231111111 adds new shift definition to the system +###################### + +if ($ADD==231111111) + { + 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 "
UMSCHALT DEFINITION NICHT HINZUGEFÜGT - Es gibt bereits eine Verschiebung Eintrag mit dieser 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 "
UMSCHALT DEFINITION NICHT HINZUGEFÜGT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Shift-ID und Name muss mindestens 2 Zeichen lang sein\n"; + echo "
Start Time Shift muss aus 4 Ziffern in der Länge und eine gültige Uhrzeit\n"; + echo "
Shift Länge muss mindestens 5 Zeichen lang sein und 24 Stunden oder weniger\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); + + echo "
UMSCHALT ANGEFÜGT:$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; + } ###################### @@ -5585,8 +7859,7 @@ $ADD=3111111111; ###################### if ($ADD==21111111111) -{ -echo "
\n"; + { echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5595,18 +7868,127 @@ echo "
\n"; {echo "
TELEFON NICHT ADDIERT - es gibt bereits ein Telefon im System mitdiesem extension/server\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 "
TELEFON NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\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 - Es gibt bereits eine Telefonnummer in das System mit diesem Login\n";} + else { - echo "
TELEFON FÜGTE HINZU\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');"; + $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 - Es gibt bereits eine Telefon-Alias in das System mit diesem Login\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 "
TELEFON NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n";} + else + { + echo "
TELEFON FÜGTE HINZU\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); + + ### 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=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 "
TEL ALIAS NOT ADDED - Es gibt bereits eine Telefon-Alias in das System mit dieser 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 "
TEL ALIAS NOT ADDED - Es gibt bereits eine Telefon-Login in das System mit dieser ID\n";} + else + { + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
TEL ALIAS NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
TEL ALIAS ADDED\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 TEL ALIAS', 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 "
GROUP ALIAS NOT ADDED - Es gibt bereits eine Telefon-Alias in das System mit dieser ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) + {echo "
GROUP ALIAS NOT ADDED - Sie können keine reservierten Wörter in der Gruppe Aliase\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
GROUP ALIAS NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
GROUP ALIAS ADDED\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; + } ###################### @@ -5614,8 +7996,7 @@ $ADD=31111111111; ###################### if ($ADD==211111111111) -{ -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 * 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 "
\n"; + { echo ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); @@ -5632,10 +8013,18 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -10593,7 +15291,6 @@ if ($ADD==311) $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); @@ -10606,7 +15303,7 @@ if ($ADD==311) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
\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); + + ### 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=311111111111; + } ###################### @@ -5643,7 +8032,7 @@ $ADD=311111111111; ###################### if ($ADD==221111111111) -{ + { echo ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5682,18 +8071,90 @@ if ($ADD==221111111111) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW VICIDIAL TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 BEDIENERTRUNK', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=311111111111; -} + $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 "
CONF-Vorlagen nicht ADDED - Es gibt bereits eine Vorlage in das System mit dieser ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
CONF-Vorlagen nicht ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
CONF TEMPLATE ADDED\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 "
CARRIER NOT ADDED - Es gibt bereits ein Luftfahrtunternehmen in das System mit dieser ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
CARRIER NOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $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='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; + } ###################### @@ -5701,8 +8162,7 @@ $ADD=311111111111; ###################### if ($ADD==2111111111111) -{ -echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "ENTFERNEN Sie\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + $dtl = 'Balanced'; + if ($n<0) {$dtl = 'Less Intense';} + if ($n>0) {$dtl = 'More Intense';} + if ($n == $adaptive_intensity) + {echo "\n";} + else + {echo "\n";} + $n--; } + echo " $NWB#vicidial_campaigns-adaptive_intensity$NWE\n"; } - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; echo "\n"; @@ -9825,71 +14464,129 @@ if ($ADD==34) echo "
\n"; + { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5721,8 +8181,8 @@ echo ""; echo ""; echo ""; - echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + } echo "\n"; echo "\n"; + if ($SSoutbound_autodial_active < 1) + { + echo ""; + } echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=3111111111111; -} + $ADD=3111111111111; + } ###################### @@ -5730,8 +8190,7 @@ $ADD=3111111111111; ###################### if ($ADD==21111111111111) -{ -echo "\n"; echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "ENTFERNEN Sie\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + $n--; } + echo "% $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; } - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - 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"; - + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } echo "\n"; echo "\n"; @@ -9175,8 +13508,12 @@ if ($ADD==31) echo "\n"; - echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -9185,34 +13522,109 @@ if ($ADD==31) echo "\n"; - echo "\n"; - + if ($SSoutbound_autodial_active > 0) + { + 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"; 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"; + + 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"; + } + else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + if ($campaign_allow_inbound == 'Y') { echo "
\n"; + { echo ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5750,8 +8209,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) { @@ -8725,9 +12862,18 @@ if ($ADD==3) 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"; + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } } if ($LOGuser_level > 8) { @@ -8745,7 +12899,7 @@ if ($ADD==3) #9BB9FB #B9CBFD - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8759,6 +12913,8 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8766,6 +12922,8 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8773,16 +12931,26 @@ if ($ADD==3) 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"; echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=31111111111111; -} + $ADD=31111111111111; + } ###################### @@ -5759,8 +8218,7 @@ $ADD=31111111111111; ###################### if ($ADD==221111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status';"; $rslt=mysql_query($stmt, $link); @@ -5789,18 +8247,18 @@ if ($ADD==221111111111111) $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SYSTEMSTATUSES', event_type='ADD', record_id='$status', 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=321111111111111; + } ###################### @@ -5808,8 +8266,7 @@ $ADD=321111111111111; ###################### if ($ADD==231111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_query($stmt, $link); @@ -5826,7 +8283,7 @@ if ($ADD==231111111111111) } else { - echo "
STATUS CATEGORY ADDED: $vsc_id - $vsc_name\n"; + echo "
STATUS KATEGORIE 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); @@ -5837,20 +8294,61 @@ if ($ADD==231111111111111) echo "
STÖRUNG: Es gibt bereits 4 den Status-Kategorienkatalog zurTimeOnVDAD Anzeige\n"; } - $stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display');"; + $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATUS CATEGORY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 KATEGORIE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=331111111111111; -} + $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 "
QK-Status-Code nicht ADDED- Es gibt bereits eine qc Status Code in das System mit diesem Namen: $row[0]\n";} + else + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
QK-Status-Code nicht ADDED- Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Code muss zwischen 1 und 8 Zeichen lang sein\n"; + echo "
Code-Name muss zwischen 2 und 30 Zeichen lang sein\n"; + } + else + { + echo "
QK-Status-Code hinzuzufügen:$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='QCSTATUSES', 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; + } @@ -5879,20 +8377,211 @@ if ($ADD=="4A") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
BENUTZER ÄNDERTE - 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' where user='$user';"; + $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' 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='BENUTZER', 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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ############################################################### + ##### 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Aktive'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5921,18 +8610,211 @@ if ($ADD=="4B") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
BENUTZER ÄNDERTE - 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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='BENUTZER', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Aktive'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5964,16 +8846,203 @@ if ($ADD==4) { echo "
BENUTZER ÄNDERTE: $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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='BENUTZER', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Aktive'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5985,90 +9054,164 @@ $ADD=3; # go to user modification below } ###################### -# ADD=41 submit campaign modifications to the system +# ADD=41 submit campaign modifications to the system - DETAIL ###################### if ($ADD==41) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; - echo "
|$campaign_name|$active|\n"; - } - else - { - echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; + echo ""; - if ($dial_method == 'MANUAL') + if ($SSoutbound_autodial_active < 1) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + $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 = '8300'; + $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'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
ACTIVE LISTEN CHANGED"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTEN', 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 ($dial_level_override > 0) + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; + echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; + echo "
|$campaign_name|$active|\n"; } - else + else { - if ($dial_method == 'RATIO') + echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; + + if ($dial_method == 'MANUAL') { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_level_override > 0) { - $auto_dial_level = "1.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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; + echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - 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',safe_harbor_message='$safe_harbor_message',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' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; - echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; - } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } $ADD=31; # go to campaign modification form below } @@ -6100,14 +9243,13 @@ if ($ADD==42) $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmtA, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } if (ereg('modify',$stage)) { @@ -6116,13 +9258,13 @@ if ($ADD==42) $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -6159,13 +9301,13 @@ if ($ADD==43) $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Status:$status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6184,76 +9326,139 @@ $ADD=31; # go to campaign modification form below if ($ADD==44) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; + echo ""; - if ($dial_method == 'RATIO') + if ($SSoutbound_autodial_active < 1) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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 = '8300'; + $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 "
ACTIVE LISTEN CHANGED"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTEN', 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 ($dial_method == 'MANUAL') + + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; + echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; } - else + else { - $adlSQL = ""; - if ($auto_dial_level < 1) + echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; + + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_hopper == 'Y') + { + echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; + echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } } } - 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); - - if ($reset_hopper == 'Y') - { - echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; - echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; - } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } $ADD=34; # go to campaign modification form below } @@ -6267,11 +9472,11 @@ if ($ADD==45) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; + echo "
Versuch verzögert muß mindestens 120 Sekunden sein und weniger als 43.200 Sekunden oder 12 Stunden\n"; echo "
maximale Versuche müssen von 1 bis 10 sein\n"; } else @@ -6281,13 +9486,13 @@ if ($ADD==45) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6313,7 +9518,7 @@ if ($ADD==47) { echo "
MITTEL-PAUSE CODE NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; echo "
pause_code must be between 1 and 6 characters in length\n"; - echo "
pause_code name must be between 2 and 30 characters in length\n"; + echo "
pause_Code-Name muss zwischen 2 und 30 Zeichen lang sein\n"; } else { @@ -6322,13 +9527,13 @@ if ($ADD==47) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY MITTELPAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6341,6 +9546,103 @@ $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 "
QK-EINSTELLUNGEN NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 "
QK-EINSTELLUNGEN MODIFIZIERT: $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='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
UMFRAGE EINSTELLUNGEN NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + } + else + { + echo "
UMFRAGE EINSTELLUNGEN MODIFIZIERT: $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' 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='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +$SUB='20A'; +$ADD=31; # go to campaign modification form below +} + + ###################### # ADD=49 modify campaign list mix in the system ###################### @@ -6371,22 +9673,22 @@ if ($ADD==49) if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) ) { - echo "
LISTE MISCHUNG NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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"; + echo "
LISTE MISCHUNG NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG ÄNDERTE: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6414,13 +9716,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG ÄNDERTE: $campaign_id - $vcl_id - $list_id\n"; } @@ -6487,13 +9789,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG ÄNDERTE: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; } @@ -6525,13 +9827,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADDIEREN SIE KAMPAGNE LIST MIX', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG ADDIERT:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6553,13 +9855,13 @@ if ($ADD==49) $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG LÖSCHTE:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6583,13 +9885,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='US-Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LISTE MISCHUNG AKTIVIERTE: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6627,33 +9929,33 @@ if ($ADD==411) $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate' 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='LISTEN', 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 "
ZURÜCKSTELLEN VON VON LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } + ### 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='LISTEN', 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 "
ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description' where list_id='$list_id'|\n"); - fclose($fp); + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); } } } @@ -6683,18 +9985,36 @@ if ($ADD==4111) } 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 "
GRUPPE GEÄNDERT: $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_message='$drop_message',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' where group_id='$group_id';"; + $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' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6707,6 +10027,47 @@ $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 "
NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
did_extension must be at least 1 character in length\n"; + } + else + { + echo "
DID VERÄNDERTE: $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' 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 "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +$ADD=3311; # go to did modification form below +} + + + ###################### # ADD=41111 modify remote agents info in the system ###################### @@ -6729,13 +10090,13 @@ if ($ADD==41111) echo "
REMOTEMITTEL GEÄNDERT\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTEMITTEL ENTRY |$PHP_AUTH_USER|$ip|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'|\n"); - fclose($fp); - } + ### 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 @@ -6765,17 +10126,106 @@ if ($ADD==411111) } else { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value' where user_group='$OLDuser_group';"; + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $GROUP_shifts .= "$group_shifts[$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' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
BENUTZER-GRUPPE GEÄNDERT\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 User Group', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 + ###################################### } } } @@ -6811,13 +10261,13 @@ if ($ADD==4111111) echo "
INDEX ÄNDERTE\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='INDEXE', 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 @@ -6851,13 +10301,13 @@ if ($ADD==41111111) echo "
FILTER GEÄNDERT\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='FILTER', 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 @@ -6907,13 +10357,13 @@ if ($ADD==411111111) echo "
Anrufzeit geändert\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6963,13 +10413,13 @@ if ($ADD==4111111111) echo "
Landesspezifische Anrufzeit geändert\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6981,6 +10431,57 @@ $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 - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Shift-ID und Name muss mindestens 2 Zeichen lang sein\n"; + echo "
Start Time Shift muss aus 4 Ziffern in der Länge und eine gültige Uhrzeit\n"; + echo "
Shift Länge muss mindestens 5 Zeichen lang sein und 24 Stunden oder weniger\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 "
UMSCHALT VERÄNDERTE\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 "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +$ADD=331111111; # go to shift modification form below +} + + ###################### # ADD=41111111111 modify phone record in the system ###################### @@ -7004,7 +10505,18 @@ if ($ADD==41111111111) { echo "
TELEFON GEÄNDERT: $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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $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' 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 ÄNDERN SIE TELEFON', event_sql=\"$SQL_log\", event_notes='Bediener IP: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7018,6 +10530,86 @@ $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 "
TEL ALIAS NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
TEL ALIAS VERÄNDERTE: $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 MODIFY TEL ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
GROUP ALIAS NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
GROUP ALIAS VERÄNDERTE: $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 MODIFY GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +$ADD=33111111111; # go to group alias modification form below +} + + ###################### # ADD=411111111111 modify server record in the system ###################### @@ -7048,7 +10640,18 @@ if ($ADD==411111111111) { echo "
BEDIENER GEÄNDERT: $server_ip\n"; - $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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_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); + + ### 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 ÄNDERN SIE BEDIENER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7102,13 +10705,13 @@ if ($ADD==421111111111) $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ÄNDERN SIE BEDIENER TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 ÄNDERN SIE BEDIENER TRUNK', event_sql=\"$SQL_log\", event_notes='Kampagne: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -7121,6 +10724,86 @@ $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 "
CONF-Vorlagen nicht VERÄNDERTE - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $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); + + ### 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 MODIFY CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
CARRIER NICHT MODIFIZIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} + else + { + echo "
CARRIER VERÄNDERTE: $carrier_id\n"; + + $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' 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); + + ### 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 MODIFY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +$ADD=341111111111; # go to carrier modification form below +} + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -7202,31 +10885,31 @@ $ADD=31111111111111; # go to vicidial conference modification form below ###################### if ($ADD==411111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo ""; - - echo "
VICIDIAL SYSTEM EINSTELLUNGEN GEÄNDERT WORDEN\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';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM SETTINGS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo ""; + + echo "
VICIDIAL SYSTEM EINSTELLUNGEN GEÄNDERT WORDEN\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';"; + $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 "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD=311111111111111; # go to vicidial system settings form below } -$ADD=311111111111111; # go to vicidial system settings form below -} ###################### @@ -7234,70 +10917,70 @@ $ADD=311111111111111; # go to vicidial system settings form below ###################### 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 ""; + + if (ereg('delete',$stage)) { - echo "
SYSTEMSTATUS NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
der Systemstatus kann nicht ein reservierter Status sein:B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; - echo "
der Systemstatus muß mindestens Buchstaben 1 lang sein\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); + echo "
SYSTEMSTATUS NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
der Systemstatus kann nicht ein reservierter Status sein:B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
der Systemstatus muß mindestens Buchstaben 1 lang sein\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='SYSTEMSTATUSES', 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 "
SYSTEMSTATUS NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
der Systemstatus muß mindestens Buchstaben 1 lang sein\n"; + echo "
der Systemstatusname muß mindestens Buchstaben 1 lang sein\n"; + } + else + { + echo "
SYSTEMSTATUS GEÄNDERT: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='SYSTEMSTATUSES', 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); } } } - if (ereg('modify',$stage)) - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
SYSTEMSTATUS NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
der Systemstatus muß mindestens Buchstaben 1 lang sein\n"; - echo "
der Systemstatusname muß mindestens Buchstaben 1 lang sein\n"; - } - else - { - echo "
SYSTEMSTATUS GEÄNDERT: $status\n"; - - $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD=321111111111111; # go to system settings modification form below } -$ADD=321111111111111; # go to system settings modification form below -} ###################### @@ -7305,57 +10988,125 @@ $ADD=321111111111111; # go to system settings modification form below ###################### if ($ADD==431111111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + { + echo "
STATUS-KATEGORIE NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
die Statuskategorie kann nicht eine reservierte Kategorie sein:UNDEFINED\n"; + echo "
die Statuskategorie muß mindestens 2 Buchstaben lang sein\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
STATUS-KATEGORIE LÖSCHTE: $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 KATEGORIE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
STATUS-KATEGORIE GEÄNDERT: $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 "
STÖRUNG: Es gibt bereits 4 den Status-Kategorienkatalog zurTimeOnVDAD Anzeige\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 KATEGORIE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + if (ereg('delete',$stage)) { - echo "
STATUS-KATEGORIE NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
die Statuskategorie kann nicht eine reservierte Kategorie sein:UNDEFINED\n"; - echo "
die Statuskategorie muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - if (ereg('delete',$stage)) + if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) { - echo "
STATUS-KATEGORIE LÖSCHTE: $vsc_id\n"; - - $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + echo "
QC-Statuscode nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
qc der Status-Code muss mindestens 1 Zeichen lang sein\n"; } - if (ereg('modify',$stage)) + else { - echo "
STATUS-KATEGORIE GEÄNDERT: $vsc_id\n"; + echo "
QC-Statuscode gestrichen:$code\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 "
STÖRUNG: Es gibt bereits 4 den Status-Kategorienkatalog zurTimeOnVDAD Anzeige\n"; - } - - $stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display' where vsc_id='$vsc_id';"; + $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 "
QK-Status-Code nicht geändert- Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
qc der Status-Code muss mindestens 1 Zeichen lang sein\n"; + echo "
qc Status der Code-Name muss mindestens 1 Zeichen lang sein\n"; + } + else + { + echo "
QK-Status-Code geändert:$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); } } } @@ -7364,7 +11115,7 @@ if ($ADD==431111111111111) echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; exit; } -$ADD=331111111111111; # go to system settings modification form below +$ADD=341111111111111; # go to qc status code modification form below } @@ -7515,6 +11266,28 @@ if ($ADD==5111) $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 "
NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + echo "
DID STREICHUNG BESTÄTIGUNG: $group_id\n"; + echo "

Klicken Sie hier, um zu löschenDID $did_id


\n"; + } + +$ADD='3311'; # go to did modification below +} + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -7619,7 +11392,7 @@ if ($ADD==511111111) else { echo "
Löschen der Anrufzeit bestätigen: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; + echo "

Klicken Sie hier, um zu löschencall time $call_time_id


\n"; } $ADD='311111111'; # go to call time modification below @@ -7641,12 +11414,33 @@ if ($ADD==5111111111) else { echo "
Löschen der landesspezifischen Anrufzeit bestätigen: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; + echo "

Klicken Sie hier, um zu löschenstate 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 "
UMSCHALT nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + echo "
UMSCHALT STREICHUNG Bestätigung:$shift_id\n"; + echo "

Klicken Sie hier, um zu löschen Verschiebung $shift_id


\n"; + } + +$ADD='331111111'; # go to call time modification below +} ###################### # ADD=51111111111 confirmation before deletion of phone record @@ -7671,6 +11465,50 @@ $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 "
TEL ALIAS nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
TEL ALIAS STREICHUNG BESTÄTIGUNG: $alias_id\n"; + echo "

Klicken Sie hier, um zu löschen Telefon Alias $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 "
GROUP ALIAS nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Alias-ID-Gruppe must be at least 2 characters in length\n"; + } + else + { + echo "
GROUP ALIAS STREICHUNG BESTÄTIGUNG: $group_alias_id\n"; + echo "

Klicken Sie hier, um Alias-Gruppe löschen $group_alias_id


\n"; + } +$ADD='33111111111'; # go to group alias modification below +} + + ###################### # ADD=511111111111 confirmation before deletion of server record ###################### @@ -7694,6 +11532,50 @@ $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 "
CONF TEMPLATE nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Vorlagen-ID von mindestens 2 Zeichen lang sein\n"; + } + else + { + echo "
CONF TEMPLATE STREICHUNG BESTÄTIGUNG: $template_id - $template_name\n"; + echo "

Klicken Sie hier, um zu löschen conf Vorlage $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 "
CARRIER nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Carrier-ID von mindestens 2 Zeichen lang sein\n"; + } + else + { + echo "
CARRIER STREICHUNG BESTÄTIGUNG: $carrier_id - $carrier_name\n"; + echo "

Klicken Sie hier, um zu löschen Träger $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier modification below +} + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -7753,15 +11635,15 @@ $ADD='31111111111111'; # go to vicidial conference modification below ###################### if ($ADD==6) -{ + { echo ""; - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) + if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) { echo "
BENUTZER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; echo "
User be at least 2 characters in length\n"; } - else + else { $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; $rslt=mysql_query($stmtA, $link); @@ -7772,37 +11654,38 @@ if ($ADD==6) $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|$user|$stmtA|$stmt|\n"); - fclose($fp); - } + ### 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='BENUTZER', 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 "
BENUTZER-AUSLASSUNG FÜHRTE DURCH: $user\n"; echo "

\n"; } -$ADD='0'; # go to user list -} + $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) ) + if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) { echo "
KAMPAGNE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; echo "
Kampagne_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -7841,58 +11724,60 @@ if ($ADD==61) $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
KAMPAGNE AUSLASSUNG FÜHRTE DURCH: $campaign_id\n"; echo "

\n"; } -$ADD='10'; # go to campaigns list -} + $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 "
MITTEL GELOGGT NICHT AUS KAMPAGNE HERAUS - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!MITTELLOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
MITTEL GELOGGT NICHT AUS KAMPAGNE HERAUS - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Kampagne_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_live_agents 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='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MITTELLOGOUT FÜHRTE DURCH: $campaign_id\n"; + echo "

\n"; } - echo "
MITTELLOGOUT FÜHRTE DURCH: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD='31'; # go to campaign modification below } -$ADD='31'; # go to campaign modification below -} ###################### @@ -7900,45 +11785,46 @@ $ADD='31'; # go to campaign modification below ###################### if ($ADD==63) -{ + { if ($LOGmodify_campaigns==1) - { - if (eregi('IN',$stage)) - {$group_id=$campaign_id;} - echo ""; - - if (strlen($campaign_id) < 2) { - echo "
VDAC NICHT LÖSCHTE FÜR KAMPAGNE - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_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); + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|EMERGENCY VDAC CLEAR|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
VDAC NICHT LÖSCHTE FÜR KAMPAGNE - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Kampagne_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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
LETZTES VDAC SATZ GELÖSCHT FÜR KAMPAGNE: $campaign_id\n"; + echo "

\n"; } - echo "
LETZTES VDAC SATZ GELÖSCHT FÜR KAMPAGNE: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} } -# go to campaign modification below -if (eregi('IN',$stage)) - {$ADD='3111';} -else - {$ADD='31';} -} ###################### @@ -7946,42 +11832,42 @@ else ###################### if ($ADD==65) -{ - if ($LOGmodify_campaigns==1) { - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + if ($LOGmodify_campaigns==1) { - echo "
KAMPAGNE LEITUNG BEREITEN NICHT GELÖSCHT AUF - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; - echo "
maximale Versuche müssen von 1 bis 10 sein\n"; - } - else - { - echo "
KAMPAGNE LEITUNG BEREITEN GELÖSCHT AUF: $campaign_id - $status - $attempt_delay\n"; + echo ""; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
KAMPAGNE LEITUNG BEREITEN NICHT GELÖSCHT AUF - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; + echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; + echo "
maximale Versuche müssen von 1 bis 10 sein\n"; + } + else + { + echo "
KAMPAGNE LEITUNG BEREITEN GELÖSCHT AUF: $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='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below } -$SUB=25; -$ADD=31; # go to campaign modification form below -} ###################### @@ -7989,92 +11875,92 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
SELBSTALT VORWAHLKNOPF-STATUS NICHT GELÖSCHT - dieser Vorwahlknopfstatus des Automobils Alt ist nicht in dieserKampagne\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
SELBSTALT VORWAHLKNOPF-STATUS NICHT GELÖSCHT - dieser Vorwahlknopfstatus des Automobils Alt ist nicht in dieserKampagne\n";} + else { - echo "
SELBSTALT VORWAHLKNOPF-STATUS NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - } - else - { - echo "
SELBSTALT VORWAHLKNOPF-STATUS GELÖSCHT: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AUTALTDIALSTTUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
SELBSTALT VORWAHLKNOPF-STATUS NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; + } + else + { + echo "
SELBSTALT VORWAHLKNOPF-STATUS GELÖSCHT: $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='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $SUB=26; + $ADD=31; # go to campaign modification form below } -$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) ) + if ($LOGmodify_campaigns==1) { - echo "
KAMPAGNE PAUSE CODE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code\n"; + echo ""; - $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE MITTELPAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
KAMPAGNE PAUSE CODE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Status:$pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below } -$SUB=27; -$ADD=31; # go to campaign modification form below -} ###################### @@ -8082,67 +11968,67 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
KAMPAGNE VORWAHLKNOPF-STATUS NICHT ENTFERNT - dieser Vorwahlknopfstatus wird nicht für diese Kampagne vorgewählt\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
KAMPAGNE VORWAHLKNOPF-STATUS NICHT ENTFERNT - dieser Vorwahlknopfstatus wird nicht für diese Kampagne vorgewählt\n";} + else { - echo "
KAMPAGNE VORWAHLKNOPF-STATUS NICHT ENTFERNT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE VORWAHLKNOPF-STATUS ENTFERNT: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DIAL STATUS REMOVED |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
KAMPAGNE VORWAHLKNOPF-STATUS NICHT ENTFERNT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; + } + else + { + echo "
KAMPAGNE VORWAHLKNOPF-STATUS ENTFERNT: $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='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + #$SUB=28; + $ADD=31; # go to campaign modification form below } -#$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) ) + if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) { - echo "
LISTE NICHT GELÖSCHT WORDEN - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
List_id be at least 2 characters in length\n"; + echo "
LISTE NICHT GELÖSCHT WORDEN - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
List_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; $rslt=mysql_query($stmt, $link); @@ -8155,37 +12041,38 @@ if ($ADD==611) $stmt="DELETE from vicidial_list where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } + ### 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='LISTEN', 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 "
LISTE AUSLASSUNG DURCHGEFÜHRT: $list_id\n"; echo "

\n"; } -$ADD='100'; # go to lists list -} + $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) ) + if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) { - echo "
IN-GROUP NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Group_id be at least 2 characters in length\n"; + echo "
IN-GROUP NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Group_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8193,115 +12080,155 @@ if ($ADD==6111) $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } + $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 "
IN-GROUP AUSLASSUNG FÜHRTE DURCH: $group_id\n"; echo "

\n"; } -$ADD='1000'; # go to in-group list -} + $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 "
NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 "
DID STREICHUNG COMPLETED: $did_id\n"; + echo "

\n"; + } + + $ADD='1300'; # go to did 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) ) + if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
REMOTEMITTEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; + echo "
REMOTEMITTEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } + ### 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 "
REMOTEMITTEL-AUSLASSUNG FÜHRTE DURCH: $remote_agent_id\n"; echo "

\n"; } -$ADD='10000'; # go to remote agents list -} + $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) ) + if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) { - echo "
BENUTZER-GRUPPE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
BENUTZER-GRUPPE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
User_group be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } + ### 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 User Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
BENUTZER-GRUPPE AUSLASSUNG DURCHGEFÜHRT: $user_group\n"; echo "

\n"; } -$ADD='100000'; # go to user group list -} + $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) ) + if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) { - echo "
INDEX NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Script_id be at least 2 characters in length\n"; + echo "
INDEX NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Script_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } + ### 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='INDEXE', 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 "
INDEX-AUSLASSUNG FÜHRTE DURCH: $script_id\n"; echo "

\n"; } -$ADD='1000000'; # go to script list -} + $ADD='1000000'; # go to script list + } ###################### @@ -8309,32 +12236,33 @@ $ADD='1000000'; # go to script list ###################### if ($ADD==61111111) -{ + { echo ""; - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) + if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) { - echo "
FILTER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Filter Identifikation muß mindestens 2 Buchstaben lang sein\n"; + echo "
FILTER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Filter Identifikation muß mindestens 2 Buchstaben lang sein\n"; } - else + else { $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } + ### 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='FILTER', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE FILTER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
FILTER-AUSLASSUNG DURCHGEFÜHRT: $lead_filter_id\n"; echo "

\n"; } -$ADD='10000000'; # go to filter list -} + $ADD='10000000'; # go to filter list + } ###################### @@ -8342,32 +12270,33 @@ $ADD='10000000'; # go to filter list ###################### if ($ADD==611111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; + echo "
Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; } - else + else { $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } + ### 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 "
Löschen der Anrufzeiten beendet: $call_time_id\n"; echo "

\n"; } -$ADD='100000000'; # go to call times list -} + $ADD='100000000'; # go to call times list + } ###################### @@ -8375,18 +12304,18 @@ $ADD='100000000'; # go to call times list ###################### if ($ADD==6111111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
Landesspezifische Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; + echo "
Landesspezifische Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; } - else + else { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8394,36 +12323,72 @@ if ($ADD==6111111111) $sct_list=''; $o=0; - while ($sct_to_print > $o) { + 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) { + 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 "Landesrichlinie gelöscht: $sct_ids[$o]
\n"; $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); } + + ### 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 "
Löschen der landesspezifischen Anrufzeit beendet: $call_time_id\n"; echo "

\n"; } -$ADD='1000000000'; # go to call times list -} + $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 "
UMSCHALT nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 "
UMSCHALT STREICHUNG fertig gestellt: $shift_id\n"; + echo "

\n"; + } + + $ADD='130000000'; # go to shifts list + } ###################### @@ -8431,32 +12396,99 @@ $ADD='1000000000'; # go to call times list ###################### if ($ADD==61111111111) -{ + { echo ""; - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
TELEFON NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; + echo "
TELEFON NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
Bediener IP be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
TELEFON-AUSLASSUNG DURCHGEFÜHRT: $extension - $server_ip\n"; echo "

\n"; } -$ADD='10000000000'; # go to phone list -} + $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 "
TEL ALIAS nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\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 DELETE TEL ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
TEL ALIAS STREICHUNG COMPLETED: $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 "
GROUP ALIAS nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Alias-ID-Gruppe 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 DELETE GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
GROUP ALIAS STREICHUNG COMPLETED: $group_alias_id\n"; + echo "

\n"; + } + $ADD='13000000000'; # go to group alias list + } ###################### @@ -8464,32 +12496,33 @@ $ADD='10000000000'; # go to phone list ###################### if ($ADD==611111111111) -{ + { echo ""; - if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
BEDIENERNOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Bediener Identifikation be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; + echo "
BEDIENERNOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Bediener Identifikation be at least 2 characters in length\n"; + echo "
Bediener IP be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING SERVER!!|$PHP_AUTH_USER|$ip|server_id='$server_id'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
BEDIENERDELETION COMPLETED: $server_id - $server_ip\n"; echo "

\n"; } -$ADD='100000000000'; # go to server list -} + $ADD='100000000000'; # go to server list + } ###################### @@ -8497,40 +12530,123 @@ $ADD='100000000000'; # go to server list ###################### if ($ADD==621111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + { + echo "
VICIDIAL BEDIENER-STAMM-SATZ NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Kampagne muß zwischen 3 und 8 Buchstaben lang sein\n"; + echo "
server_ip verzögert muß mindestens 7 Buchstaben sein\n"; + } + else + { + echo "
VICIDIAL BEDIENER-STAMM-SATZ GELÖSCHT: $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 BEDIENERTRUNK', event_sql=\"$SQL_log\", event_notes='Kampagne: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=631111111111 delete conf template record +###################### + +if ($ADD==631111111111) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { - echo "
VICIDIAL BEDIENER-STAMM-SATZ NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne muß zwischen 3 und 8 Buchstaben lang sein\n"; - echo "
server_ip verzögert muß mindestens 7 Buchstaben sein\n"; + echo "
CONF TEMPLATE nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Vorlagen-ID von mindestens 2 Zeichen lang sein\n"; } - else + else { - echo "
VICIDIAL BEDIENER-STAMM-SATZ GELÖSCHT: $campaign_id - $server_ip\n"; - - $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE BEDIENERTRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $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 DELETE CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONF TEMPLATE STREICHUNG COMPLETED: $server_id - $server_ip\n"; + echo "

\n"; } + $ADD='130000000000'; # go to conf template list } - else + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
CARRIER nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Carrier-ID von mindestens 2 Zeichen lang sein\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 DELETE CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CARRIER STREICHUNG COMPLETED: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier list } -$ADD=311111111111; # go to server modification form below -} ###################### @@ -8538,32 +12654,33 @@ $ADD=311111111111; # go to server modification form below ###################### if ($ADD==6111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
CONFERENCE NOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; + echo "
CONFERENCE NOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
Bediener IP be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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='1000000000000'; # go to conference list + } ###################### @@ -8571,32 +12688,33 @@ $ADD='1000000000000'; # go to conference list ###################### if ($ADD==61111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
VICIDIAL CONFERENCE NOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; + echo "
VICIDIAL CONFERENCE NOT DELETED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
Bediener IP be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 -} + $ADD='10000000000000'; # go to vicidial conference list + } @@ -8666,6 +12784,24 @@ if ($ADD==3) $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]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -8714,6 +12850,7 @@ if ($ADD==3) echo "$NWB#vicidial_users-user_group$NWE
Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
Aktiv:$NWB#vicidial_users-active$NWE
Vertreter-Anruf-Handbuch: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Aufnahme: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Übertragungen: $NWB#vicidial_users-vicidial_transfers$NWE
Genauere Rückstellung Gemischt: $NWB#vicidial_users-closer_default_blended$NWE
Genauere Rückstellung Gemischt: $NWB#vicidial_users-closer_default_blended$NWE
VICIDIAL Aufnahme-Übersteuerung: $NWB#vicidial_users-vicidial_recording_override$NWE
Mittel Ändern Kunde Daten-Übersteuerung: $NWB#vicidial_users-alter_custdata_override$NWE
Agent Alter Kunden Telefon AllowOverride:$NWB#vicidial_users-alter_custphone_override$NWE
Agent Shift Vollstreckung Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alarm aktiv: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Kampagne Rank:$NWB#vicidial_users-campaign_ranks$NWE
\n"; echo "\n"; echo "$RANKcampaigns_list"; @@ -8738,6 +12884,14 @@ if ($ADD==3) echo "$RANKgroups_list"; echo "
\n"; echo "
QC aktiv:$NWB#vicidial_users-qc_enabled$NWE
QC-Benutzer-Niveau:$NWB#vicidial_users-qc_user_level$NWE
QC-Pass:$NWB#vicidial_users-qc_pass$NWE
QC-Finish:$NWB#vicidial_users-qc_finish$NWE
QC-Commit:$NWB#vicidial_users-qc_commit$NWE
Ansicht-Reports: $NWB#vicidial_users-view_reports$NWE
Ansicht-Berichte: $NWB#vicidial_users-view_reports$NWE
Ändern Sie Mittel-Schnittstelle Wahlen:$NWB#vicidial_users-alter_agent_interface_options$NWE
Ändern Sie Benutzer: $NWB#vicidial_users-modify_sections$NWE
Löschung-Listen: $NWB#vicidial_users-delete_lists$NWE
Last Leitungen: $NWB#vicidial_users-load_leads$NWE
Ändern Sie Leitungen: $NWB#vicidial_users-modify_leads$NWE
Download-Listen: $NWB#vicidial_users-modify_leads$NWE
Exportieren von Berichten: $NWB#vicidial_users-export_reports$NWE
Ändern Sie Kampagnen: $NWB#vicidial_users-modify_sections$NWE
Kampagne Detail: $NWB#vicidial_users-campaign_detail$NWE
Ändern Sie In-Gruppen: $NWB#vicidial_users-modify_sections$NWE
Löschung In-Gruppen: $NWB#vicidial_users-delete_ingroups$NWE
Ändern DIDS:$NWB#vicidial_users-modify_sections$NWE
Löschen DIDS:$NWB#vicidial_users-delete_ingroups$NWE
Ändern Sie Remotemittel: $NWB#vicidial_users-modify_sections$NWE
Löschung-Direktübertragung Mittel: $NWB#vicidial_users-delete_remote_agents$NWE
Ändern Sie Indexe: $NWB#vicidial_users-modify_sections$NWE
Löschung-Indexs: $NWB#vicidial_users-delete_scripts$NWE
Ändern Sie Filter: $NWB#vicidial_users-modify_sections$NWE
Löschung-Filter: $NWB#vicidial_users-delete_filters$NWE
Ändern Sie Filter: $NWB#vicidial_users-modify_sections$NWE
Löschung-Filter: $NWB#vicidial_users-delete_filters$NWE
AGC Admin Zugang: $NWB#vicidial_users-ast_admin_access$NWE
AGC Löschung-Telefone: $NWB#vicidial_users-ast_delete_phones$NWE
Bearbeite Anrufzeits: $NWB#vicidial_users-modify_call_times$NWE
Lösche Anrufzeits: $NWB#vicidial_users-delete_call_times$NWE
Ändern Sie Bediener: $NWB#vicidial_users-modify_sections$NWE
Agent API-Zugang:$NWB#vicidial_users-vdc_agent_api_access$NWE
AddTimeclock Log Record: $NWB#vicidial_users-add_timeclock_log$NWE
ÄndernTimeclock Log Record: $NWB#vicidial_users-modify_timeclock_log$NWE
Löschen der RegistrierungTimeclock Record: $NWB#vicidial_users-delete_timeclock_log$NWE
Shift Manager Vollstreckung Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; if ($LOGdelete_users > 0) @@ -8792,7 +12960,12 @@ if ($ADD==3) echo "

Klicken Sie hier für Benutzerzeitblatt\n"; echo "

Klicken Sie hier für Benutzerstatus\n"; echo "

Klicken Sie hier für Benutzernotfall\n"; + echo "

Klicken Sie hier für die Benutzer mehrere Tage Status ausführlicher Bericht\n"; echo "

Klicken Sie hier für Benutzer Wiederholungsbesuch Einflüsse\n"; + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu diesem Eintrag
\n"; + } } } else @@ -8827,6 +13000,12 @@ if ($ADD==31) $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 * from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -8837,6 +13016,7 @@ if ($ADD==31) $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]; @@ -8863,7 +13043,7 @@ if ($ADD==31) $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; + $drop_action = $row[37]; $safe_harbor_exten = $row[38]; $display_dialable_count = $row[39]; $wrapup_seconds = $row[40]; @@ -8894,6 +13074,43 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -8926,21 +13143,61 @@ if ($ADD==31) } } + $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 * 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 .= "$rowx[0] - $rowx[1]\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 pulldown list menu + + ##### 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); @@ -9001,18 +13294,35 @@ if ($ADD==31) 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 ""; echo ""; - echo ""; - echo ""; + + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo ""; - echo ""; + if ($SSqc_features_active > 0) + { + echo ""; + } + if ($SSoutbound_autodial_active < 1) + { + echo "\n"; + } echo "\n"; echo "
$row[0]: Basic Detail StatusesStatusHotKeysLead RecyclingAuto Alt DialLead RecyclingAuto Alt DialUS-MixUmfragePause CodesList MixQC Real-Time
\n"; @@ -9030,117 +13340,136 @@ if ($ADD==31) echo "
Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Kampagne Beschreibung: $NWB#vicidial_campaigns-campaign_description$NWE
Kampagne Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Kampagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Kampagne Datum ändern: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Kampagne Login Datum: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Netz-Form-Target: $NWB#vicidial_campaigns-web_form_target$NWE
Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Erlauben Sie Inbound und gemischt:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Erlauben Sie Inbound und gemischt:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Vorwahlknopf-Status$o: \n"; - - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Vorwahlknopf-Status$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
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
US-Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Vorwahlknopf-Methode: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       PASSEN SIE ÜBERSTEUERUNG AN
Vorhandenes Nur Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Tropfen-Prozentsatz-Begrenzung:
Maximum Paßt Vorwahlknopf-Niveau An: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Neueste Bediener-Zeit: 4 nur Stellen $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Passen Sie Intensität Modifizierfaktor An: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Vorwahlknopf-Waagerecht ausgerichtetes Unterschied-Ziel: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Gleichzeitige Übertragungen: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Queue-Priorität: $NWB#vicidial_campaigns-queue_priority$NWE
SelbstAlt-zahl Wählen: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Add A Dial Status:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Vorwahlknopf-Methode: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       PASSEN SIE ÜBERSTEUERUNG AN
Vorhandenes Nur Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Tropfen-Prozentsatz-Begrenzung: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Paßt Vorwahlknopf-Niveau An: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Neueste Bediener-Zeit: 4 nur Stellen $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Passen Sie Intensität Modifizierfaktor An: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Vorwahlknopf-Waagerecht ausgerichtetes Unterschied-Ziel: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Gleichzeitige Übertragungen: $NWB#vicidial_campaigns-concurrent_transfers$NWE
SelbstAlt-zahl Wählen: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
Vorwahlknopf-Abschaltung: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Vorwahlknopf-Abschaltung: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Vorwahlknopf-Präfix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Lassen Sie Telefon-Code Aus: $NWB#vicidial_campaigns-omit_phone_code$NWE
Kampagne CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Kampagne VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Kampagne VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Kampagne Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Kampagne Aufnahme: $NWB#vicidial_campaigns-campaign_recording$NWE
Antwortende Maschine Anzeige: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD senden zu VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
AMD senden zu VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
CPD AMD Aktion: $NWB#vicidial_campaigns-cpd_amd_action$NWE
BringenSie DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
BringenSie Zahl 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
BringenSie Zahl 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alternative Nummer wählen: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Alternative Nummer wählen: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Zeitlich geplante Wiederholungsbesuche: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop-Aktion:$NWB#vicidial_campaigns-drop_action$NWE
Benutze Sicherheitsnachricht: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Sicherheitsnebenstelle: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Sicherheitsnebenstelle: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop-Transfer-Gruppe:$NWB#vicidial_campaigns-drop_inbound_group$NWE
Nachbereitung Sekunden $NWB#vicidial_campaigns-wrapup_seconds$NWE
Nachbereitung Nachricht $NWB#vicidial_campaigns-wrapup_message$NWE
Benutzen Sie Interne DNC Liste: $NWB#vicidial_campaigns-use_internal_dnc$NWE
AgentPause CodesAktiv:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Verwenden Sie Kampagne DNC Liste: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentPause CodesAktiv:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Kampagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Sperren Sie Ändern Kunde Daten: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
Deaktivieren Alter Kunde Telefon:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Gewähren Sie Kein-Zufuhrbehälter-Führt LOGON: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Gewähren Sie Kein-Zufuhrbehälter-Führt LOGON: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Agent Anzeige Queue Count:$NWB#vicidial_campaigns-display_queue_count$NWE
Manuelle Vorwahlknopf-Liste Identifikation:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manual Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Agent Screen Zwischenablage kopieren: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agent Screen Erweiterte Alt Zifferblatt: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Wege-Call Outbound CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Wege-Call-Vorwahl: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Alias-Gruppe erlaubt: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Standard-Alias-Gruppe: $NWB#vicidial_campaigns-default_group_alias$NWE
Vtiger Suche Kategorie: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Vtiger Erstellen Call Record: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Vtiger Erstellen Lead Record: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Vtiger Login Screen: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
Gewährte Inbound Gruppen:
"; @@ -9237,33 +13649,88 @@ if ($ADD==31) echo "
\n"; echo "
\n"; - echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $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=''; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
LISTE IDENTIFIKATIONLISTE NAMEAKTIV
\n"; - } - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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=0; - while ($lists_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "
LISTE IDENTIFIKATIONLISTE NAMEBESCHREIBUNGLEADS COUNTAKTIVLAST CALL DATUMÄNDERN Sie
$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]ÄNDERN Sie

\n"; - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; echo "
\n"; $filterSQL = $filtersql_list[$lead_filter_id]; @@ -9288,25 +13755,26 @@ if ($ADD==31) echo " - Zeige

"; } - - - - - $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]"; + $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 "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

\n"; echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

\n"; - echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

\n"; - echo "Click here to see a VDAD report for this campaign

\n"; - echo "
\n"; + echo "Klicken Sie hier, um ein VDAD Bericht für diese Kampagne

\n"; } + echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

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

Klicken Sie hier, um zu sehen, Admin chages zu dieser Kampagne
\n"; + } + echo "\n"; + } - + ##### CAMPAIGN CUSTOM STATUSES ##### if ($SUB==22) { @@ -9375,7 +13843,7 @@ if ($ADD==31) echo "Status:   \n"; echo "Beschreibung:   \n"; echo "Auswählbar:   \n"; - echo "Human Answer:   \n"; + echo "Human Antwort:   \n"; echo "Kategorie:\n"; echo "\n"; - echo "\n"; + ### 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 * 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); - $o++; + $stmt="SELECT * 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 "

LEITUNG, DIE INNERHALB DIESER KAMPAGNE AUFBEREITET:   $NWB#vicidial_lead_recycle$NWE
\n"; + echo "
STATUSVERSUCH VERZÖGERTVERSUCH MAXIMUMAKTIV LÖSCHUNG
\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"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + $o++; } echo "
STATUSVERSUCH VERZÖGERTVERSUCH MAXIMUMLEADS AT LIMITAKTIV LÖSCHUNG
$rowx[2]
\n"; - echo "\n"; + echo "
  $RECYCLE_status[$o]\n"; + echo "\n"; echo "\n"; echo "$recycle_limit   LÖSCHUNG
LÖSCHUNG
\n"; @@ -9481,9 +13999,11 @@ if ($ADD==31) echo "
\n"; echo "
\n"; + echo "
\n"; + echo "* Blei zählt, die aus dem aktiven Listen in der Kampagne nur.\n"; } - + ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### if ($SUB==26) { echo "

SELBSTALT ZAHL, DIE FÜR DIESE KAMPAGNE WÄHLT:   $NWB#vicidial_auto_alt_dial_statuses$NWE
\n"; @@ -9520,7 +14040,7 @@ if ($ADD==31) echo "
\n"; } - + ##### CAMPAIGN PAUSE CODES ##### if ($SUB==27) { echo "

MITTEL-PAUSE CODES FÜR DIESE KAMPAGNE:   $NWB#vicidial_pause_codes$NWE
\n"; @@ -9563,6 +14083,114 @@ if ($ADD==31) echo "
\n"; } + ##### CAMPAIGN 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 "

QK-EINSTELLUNGEN für diese Kampagne:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +# echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + echo "QC aktiv: $NWB#vicidial_campaigns-qc_enabled$NWE
QK-Status:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
QC-Webformular:$NWB#vicidial_campaigns-qc_web_form_address$NWE
QC-Script: $NWB#vicidial_campaigns-qc_script$NWE
QC-Shift: $NWB#vicidial_campaigns-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
QC Show-Aufnahme: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; + echo "

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

UMFRAGE EINSTELLUNGEN für diese Kampagne:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "
Umfrage Erste Audio-Datei: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Umfrage DTMF Digits: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Umfrage nicht interessiert Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Umfrage Opt-in Audio-Datei: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Umfrage nicht interessiert Audio-Datei: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Umfrage-Methode: $NWB#vicidial_campaigns-survey_method$NWE
Umfrage Nr. Response-Aktion: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Umfrage kein Interesse Status: $NWB#vicidial_campaigns-survey_ni_status$NWE
Antworten Digit Karte: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Umfrage Umfrage XFER Erweiterung: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Umfrage Kampagne Aufnahme Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; + echo "

\n"; + } + if ($SUB < 1) { @@ -9650,12 +14278,13 @@ if ($ADD==34) $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])) @@ -9672,6 +14301,7 @@ if ($ADD==34) { $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])) @@ -9727,9 +14357,16 @@ if ($ADD==34) echo "
$row[0]: Grundlegende Ansicht Detail-Ansicht List Mix US-Mix Echtzeit Bildschirm  
\n"; if ($SUB < 1) @@ -9743,80 +14380,82 @@ if ($ADD==34) echo "
Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Kampagne Beschreibung: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Kampagne Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Kampagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Kampagne Datum ändern: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Kampagne Login Datum: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Netz-Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Rückstellung Übergangsgruppe:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Erlauben Sie Inbound und gemischt:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Erlauben Sie Inbound und gemischt:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Vorwahlknopf-Status$o: \n"; - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Vorwahlknopf-Status$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
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
US-Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Vorwahlknopf-Methode: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Passen Sie Intensität Modifizierfaktor An:
Add A Dial Status:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Vorwahlknopf-Methode: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Passen Sie Intensität Modifizierfaktor An: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Erhalten Sie Anruf-Produkteinführung: $get_call_launch
\n"; echo "
\n"; - echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
LISTE IDENTIFIKATIONLISTE NAMEAKTIV
\n"; - - } - - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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); - $camp_lists=''; + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); + 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++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + echo "
LISTE IDENTIFIKATIONLISTE NAMEBESCHREIBUNGLEADS COUNTAKTIVLAST CALL DATUMÄNDERN Sie
$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]ÄNDERN Sie

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} else - {$bgcolor='bgcolor="#9BB9FB"';} + {$fSQL = '';} - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

\n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

\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,$fSQL); - echo " - Verberge

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - Zeige

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

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

"; + } - $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]"; + $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 "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

\n"; - echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

\n"; + echo "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

\n"; + echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

\n"; + echo "Klicken Sie hier, um ein VDAD Bericht für diese Kampagne

\n"; + } echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

\n"; - echo "Click here to see a VDAD report for this campaign

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

Klicken Sie hier, um zu sehen, Admin chages zu dieser Kampagne
\n"; + } + echo "
\n"; echo "
\n"; @@ -9947,6 +14644,7 @@ if ( ($ADD==34) or ($ADD==31) ) { if ($LOGmodify_campaigns==1) { + ##### CAMPAIGN LIST MIX SETTINGS ##### if ($SUB==29) { ##### get list_id listings for dynamic pulldown @@ -10073,7 +14771,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo " \n"; echo "
ADD   \n"; echo "ENTFERNEN Sie\n"; @@ -10134,7 +14832,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "$mixlists_list"; echo "
Dial Status:  
Aktiv:$NWB#vicidial_lists-active$NWE
Stellen Sie Führen-Benennen-Status für diese Liste zurück: $NWB#vicidial_lists-reset_list$NWE
Liste Änderung Datum: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
US-Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; @@ -10872,12 +15569,17 @@ if ($ADD==311) echo "
\n"; - echo "

Click here to see all CallBack Holds in this list

\n"; + echo "

Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Liste

\n"; + echo "

Klicken Sie hier, um diese Liste

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

LÖSCHEN SIE DIESE LISTE\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Liste
\n"; + } } else { @@ -10905,7 +15607,7 @@ if ($ADD==3111) $group_name = $row[1]; $group_color = $row[2]; $active = $row[3]; - $web_form_address = $row[4]; + $web_form_address = stripslashes($row[4]); $voicemail_ext = $row[5]; $next_agent_call = $row[6]; $fronter_display = $row[7]; @@ -10916,7 +15618,7 @@ if ($ADD==3111) $xferconf_b_dtmf = $row[12]; $xferconf_b_number = $row[13]; $drop_call_seconds = $row[14]; - $drop_message = $row[15]; + $drop_action = $row[15]; $drop_exten = $row[16]; $call_time_id = $row[17]; $after_hours_action = $row[18]; @@ -10930,30 +15632,113 @@ if ($ADD==3111) $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]; + ##### get in-groups listings for dynamic pulldown - $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); $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 "
ÄNDERN Sie Einen GRUPPEN SATZ: $row[0]
\n"; @@ -10962,10 +15747,26 @@ if ($ADD==3111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -11019,8 +15850,154 @@ if ($ADD==3111) echo "$Xgroups_menu"; echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\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 "
Gruppe Identifikation: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Aktiv:$NWB#vicidial_inbound_groups-active$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Queue-Priorität: $NWB#vicidial_inbound_groups-queue_priority$NWE
Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script:
BringenSie Zahl 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop-Aktion:$NWB#vicidial_inbound_groups-drop_action$NWE
Benutze Verbindungsaufbaunachricht: $NWB#vicidial_inbound_groups-drop_message$NWE
Verbindungsaufbaunebenstelle: $NWB#vicidial_inbound_groups-drop_exten$NWE
Verbindungsaufbaunebenstelle: $NWB#vicidial_inbound_groups-drop_exten$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop-Transfer-Gruppe:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Anruf-Zeit:$NWB#vicidial_inbound_groups-call_time_id$NWE
Nach Stunden Tätigkeit:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Nach Stunden Tätigkeit:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Nach Stunden Anzeige Dateinamen:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Nach Stunden Anzeige Dateinamen:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Nach Stunden Verlängerung:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Nach Stunden Verlängerung:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Nach Stunden Voicemail:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Nach Stunden Voicemail:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
After Hours Transfer-Gruppe:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Willkommener Anzeige Dateiname:$NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Jetzt Grußwort:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Musik Auf Einfluß-Kontext:$NWB#vicidial_inbound_groups-moh_context$NWE
Auf Einfluß-Aufforderung Dateinamen:$NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Auf Einfluß-Aufforderung Abstand:$NWB#vicidial_inbound_groups-prompt_interval$NWE
Jetzt im Einklang:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Jetzt Geschätzte Hold Time:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Hold Time Option:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Hold Time Option Sekunden:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Hold Time Option Extension:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Hold Time Option Voicemail:$NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Hold Time Option Transfer In-Group:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Hold Time Option Rückruf Dateiname:$NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Option Liste Rückruf-ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Mittel-Alarmverlängerung:$NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Mittel-Alarm Verzögert:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Standard-Alias-Gruppe: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Hold Recall Transfer In-Group:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
Nr. Delay Call Route:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
In-Group-Aufnahme AllowOverride:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
In-Group-Aufnahme Dateiname:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Statistiken Prozent der Anrufe innerhalb von X Sekunden 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Statistiken Prozent der Anrufe innerhalb von X Sekunden 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
\n"; + + if ($SSqc_features_active > 0) + { + echo "
 
Inbound-Fraktion QC Einstellungen:
QC aktiv: $NWB#vicidial_inbound_groups-qc_enabled$NWE
QK-Status:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC-Webformular:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
QC-Script: $NWB#vicidial_inbound_groups-qc_script$NWE
QC-Shift: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
QC Show-Aufnahme: $NWB#vicidial_inbound_groups-qc_show_recording$NWE
\n"; + echo "

\n"; + ### list of agent rank or skill-level for this inbound group echo "
\n"; @@ -11049,7 +16026,7 @@ if ($ADD==3111) echo "

\n"; - echo "Click here to see a report for this inbound group

\n"; + echo "Klicken Sie hier, um zu sehen, einen Bericht für diese Gruppe ein -

\n"; echo "
\n"; @@ -11058,6 +16035,163 @@ if ($ADD==3111) echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

LÖSCHEN SIE DIESES IN-GROUP\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser In-Group
\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +} + + + +###################### +# ADD=3311 modify did info in the system +###################### + +if ($ADD==3311) +{ + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from vicidial_inbound_dids where did_id='$did_id';"; + $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]; + + + $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 "
MODIFY eine DID RECORD:$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 "
DID-Erweiterung:$NWB#vicidial_inbound_dids-did_pattern$NWE
DID-Beschreibung:$NWB#vicidial_inbound_dids-did_description$NWE
Aktiv:$NWB#vicidial_inbound_dids-did_active$NWE
DID-Route:$NWB#vicidial_inbound_dids-did_route$NWE
Erweiterung:$NWB#vicidial_inbound_dids-extension$NWE
Erweiterung Kontext:$NWB#vicidial_inbound_dids-exten_context$NWE
Voicemail-Box:$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Tel. Durchwahl:$NWB#vicidial_inbound_dids-phone$NWE
Bediener IP: $NWB#vicidial_inbound_dids-server_ip$NWE
User Agent:$NWB#vicidial_inbound_dids-user$NWE
User-Aktion nicht verfügbar:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
User-Einstellungen In Route-Gruppe:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-Gruppe Identifikation: $NWB#vicidial_inbound_dids-group_id$NWE
In-Group Call Griff Methode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
In-Group-Agent Suche Methode:$NWB#vicidial_inbound_dids-agent_search_method$NWE
In-Group US-ID:$NWB#vicidial_inbound_dids-list_id$NWE
In-Group Kampagnen-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
In-Group Telefon Code:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; + echo "

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

DELETE Das war\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser DID
\n"; + } } else { @@ -11118,6 +16252,10 @@ if ($ADD==31111) { echo "

LÖSCHEN SIE DIESES REMOTEMITTEL\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Remote Agent\n"; + } } else { @@ -11141,8 +16279,12 @@ if ($ADD==311111) $stmt="SELECT * 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]; + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + echo ""; echo "
ÄNDERN Sie Eine BENUTZER-GRUPPE EINTRAGUNG
\n"; @@ -11151,9 +16293,51 @@ if ($ADD==311111) 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 "
Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
Erlaubte Kampagnen: \n"; - echo "$campaigns_list"; - echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE
ForceTimeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Shift Vollstreckung: $NWB#vicidial_user_groups-shift_enforcement$NWE
Erlaubte Kampagnen:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Gruppe Verschiebungen:
$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 "
 
QC erlaubt Kampagnen:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
QC erlaubt Inbound Gruppen:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
\n"; @@ -11161,14 +16345,14 @@ if ($ADD==311111) ### list of users in this user group $active_confs = 0; - $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; + $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 "
BENUTZER INNERHALB DIESER BENUTZER-GRUPPE: $users_to_print
\n"; echo "\n"; - echo "\n"; + echo "\n"; $o=0; while ($users_to_print > $o) @@ -11185,6 +16369,7 @@ if ($ADD==311111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } @@ -11192,12 +16377,17 @@ if ($ADD==311111) - echo "

Click here to see all CallBack Holds in this user group

\n"; + echo "

Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Gruppe

\n"; + echo "

Klicken Sie hier, um zu sehen, dieTimeclock Status für diese Gruppe

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

LÖSCHEN SIE DIESE BENUTZER-GRUPPE\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Benutzergruppe\n"; + } } else { @@ -11285,6 +16475,10 @@ if ($ADD==3111111) { echo "

LÖSCHEN SIE DIESEN INDEX\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu diesem Skript\n"; + } } else { @@ -11351,6 +16545,10 @@ if ($ADD==31111111) { echo "

LÖSCHEN SIE DIESEN FILTER\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages dieser Filter\n"; + } } else { @@ -11546,6 +16744,10 @@ if ($LOGdelete_call_times > 0) { echo "

Lösche diese Anrufzeit Definition\n"; } +if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Aufforderung Zeit\n"; + } } else { @@ -11640,6 +16842,120 @@ echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen. } + +###################### +# ADD=331111111 modify shift definition info in the system +###################### + +if ($ADD==331111111) +{ + +if ($LOGmodify_call_times==1) +{ +echo "
USERFULL NAMELEVEL
USERFULL NAMELEVELAKTIV
$rowx[0]$rowx[1]$rowx[2]$rowx[3]
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFY A SHIFT\n"; +echo "\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Shift-ID:$shift_id
Shift Name: (Kurze Beschreibung der Verlagerung)$NWB#vicidial_shifts-shift_name$NWE
Start Time Shift:\n"; +echo "   Shift End Time:\n"; +echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Länge: $NWB#vicidial_shifts-shift_length$NWE
Shift der Woche:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; +echo "Sonntag
\n"; +echo "Montag
\n"; +echo "Dienstag
\n"; +echo "Mittwoch
\n"; +echo "Donnerstag
\n"; +echo "Freitag
\n"; +echo "Samstag
\n"; +echo "
\n"; + +echo "


\n"; +echo "USER-Gruppen, die diese Verschiebung:
\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 "

DELETE Diese Verschiebung DEFINITION\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Verschiebung
\n"; + } +} +else +{ +echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen."; +} + +} + + ###################### # ADD=31111111111 modify phone record in the system ###################### @@ -11662,7 +16978,7 @@ if ($ADD==31111111111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11677,6 +16993,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11731,6 +17048,25 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dial Plan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail Kasten: (nur Stellen)$NWB#phones-voicemail_id$NWE
Voicemail-Box: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
E-Mail: $NWB#phones-email$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
DBY Benutzer: (ZweitensDB Login)$NWB#phones-DBY_user$NWE
DBY Durchlauf: (ZweitensDB Secret)$NWB#phones-DBY_pass$NWE
DBY Tor: (ZweitensDB Port)$NWB#phones-DBY_port$NWE
Vorlagen-ID: $NWB#phones-template_id$NWE
Conf AllowOverride: $NWB#phones-conf_override$NWE
\n"; @@ -11749,6 +17085,122 @@ if ($ADD==31111111111) } +###################### +# ADD=32111111111 modify phone alias record in the system +###################### + +if ($ADD==32111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
MODIFY A Telefon ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias-ID:$row[0] $NWB#phones-alias_id$NWE
Alias-Name: $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 "
PHONES IN DIESER PHONES 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 "
LOGINVERLÄNGERUNGSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

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

DELETE Dieses Telefon ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu diesem Telefon Alias
\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 "
MODIFY A GROUP ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias-ID-Gruppe: $row[0] $NWB#phones-group_alias_id$NWE
Gruppe Alias-Name: $NWB#phones-group_alias_name$NWE
CallerID Anzahl: $NWB#phones-caller_id_number$NWE
CallerID Name: $NWB#phones-caller_id_name$NWE
Aktiv:
\n"; + + + if ($LOGast_delete_phones > 0) + { + echo "

DELETE Diese Gruppe ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu dieser Gruppe Alias
\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +} + + ###################### # ADD=311111111111 modify server record in the system ###################### @@ -11760,39 +17212,86 @@ if ($ADD==311111111111) echo "
\n"; echo ""; - $stmt="SELECT * from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 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_ip = $row[2]; + $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]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); echo "
ÄNDERN Sie Einen BEDIENER-SATZ: $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
Maximale VICIDIAL Stämme: $NWB#servers-max_vicidial_trunks$NWE
VICIDIAL Balance Wählen: $NWB#servers-vicidial_balance_active$NWE
VICIDIAL Balance Offlimits: $NWB#servers-balance_trunks_offlimits$NWE
Telnet Wirt: $NWB#servers-telnet_host$NWE
Telnet Tor: $NWB#servers-telnet_port$NWE
Manager-Benutzer: $NWB#servers-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#servers-ASTmgrSECRET$NWE
Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
System Leistung: $NWB#servers-sys_perf_log$NWE
Bediener-Maschinenbordbücher: $NWB#servers-vd_server_logs$NWE
AGI Ausgang: $NWB#servers-agi_output$NWE
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
System Load: $sysload - $cpu%   $NWB#servers-sysload$NWE
Live-Channels: $channels_total   $NWB#servers-channels_total$NWE
Disk Usage: $disk_usage   $NWB#servers-disk_usage$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
Maximale VICIDIAL Stämme: $NWB#servers-max_vicidial_trunks$NWE
Max Calls pro Sekunde: $NWB#servers-outbound_calls_per_second$NWE
VICIDIAL Balance Wählen: $NWB#servers-vicidial_balance_active$NWE
VICIDIAL Balance Offlimits: $NWB#servers-balance_trunks_offlimits$NWE
Telnet Wirt: $NWB#servers-telnet_host$NWE
Telnet Tor: $NWB#servers-telnet_port$NWE
Manager-Benutzer: $NWB#servers-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#servers-ASTmgrSECRET$NWE
Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
System Leistung: $NWB#servers-sys_perf_log$NWE
Bediener-Maschinenbordbücher: $NWB#servers-vd_server_logs$NWE
AGI Ausgang: $NWB#servers-agi_output$NWE
Aufnahme Web-Link: $NWB#servers-recording_web_link$NWE
Alternate Recording Bediener IP: $NWB#servers-alt_server_ip$NWE
Aktive Asterisk Server: $NWB#servers-active_asterisk_server$NWE
Conf-Dateien erzeugen: $NWB#servers-generate_vicidial_conf$NWE
Rebuild conf-Dateien: $NWB#servers-rebuild_conf_files$NWE
\n"; @@ -11830,7 +17329,7 @@ if ($ADD==311111111111) echo "
ADDIEREN SIE NEUEN STAMM-SATZ DES BEDIENER-VICIDIAL
\n"; echo "\n"; echo "\n"; - echo "TRUNKS:
\n"; + echo "Trunks:
\n"; echo "KAMPAGNE:
\n"; @@ -11840,23 +17339,56 @@ if ($ADD==311111111111) echo "

\n"; + ### list of carriers on this server + echo "
\n"; + echo "
CARRIERS IN DIESEM SERVER:
\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 IDNAMEREGISTRATIONAKTIV
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + ### list of phones on this server echo "
\n"; echo "
TELEFONE INNERHALB DIESES BEDIENERS:
\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=''; + $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++; + $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++;} @@ -11877,17 +17409,18 @@ if ($ADD==311111111111) echo "
VERLÄNGERUNGNAMEAKTIV
\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=''; + $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++; + $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"';} @@ -11906,17 +17439,18 @@ if ($ADD==311111111111) echo "
CONFERENCEVERLÄNGERUNG
\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=''; + $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++; + $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"';} @@ -11932,6 +17466,7 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Dieser Bediener hat $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "Dieser Bediener hat $active_phones aktive Telefone und $inactive_phones unaktivierte Telefone

\n"; echo "Dieser Bediener hat $active_confs active conferences

\n"; echo "Dieser Bediener hat $active_vdconfs active vicidial conferences

\n"; @@ -11940,6 +17475,218 @@ if ($ADD==311111111111) { echo "

DELETE THIS SERVER\n"; } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu diesem Server\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +} + + +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
VD CONFERENCEVERLÄNGERUNG
\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 "
MODIFY A CONF TEMPLATE RECORD: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Vorlagen-ID: $template_id
Template Name: $NWB#vicidial_conf_templates-template_name$NWE
Template-Inhalt: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
PHONES SIE DIESE CONF TEMPLATE:
\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 "
VERLÄNGERUNGNAMESERVERAKTIV
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
CARRIERS SIE DIESE CONF TEMPLATE:
\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 "
CARRIERNAMESERVERAKTIV
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

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

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

Klicken Sie hier, um zu sehen, Admin chages zu dieser Vorlage conf
\n"; + } + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\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 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]; + + echo "
MODIFY A RECORD CARRIER: $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 "
Carrier-ID: $carrier_id
Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
Anmeldung String: $NWB#vicidial_server_carriers-registration_string$NWE
Vorlagen-ID: $NWB#vicidial_server_carriers-template_id$NWE
Account-Eintrag: $NWB#vicidial_server_carriers-account_entry$NWE
Protokoll: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Eintrag: $NWB#vicidial_server_carriers-dialplan_entry$NWE
Bediener IP: $NWB#vicidial_server_carriers-server_ip$NWE
Aktiv:$NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

DELETE THIS CARRIER\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages zu diesem Träger
\n"; + } } else { @@ -11984,7 +17731,7 @@ if ($ADD==3111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS CONFERENCE\n"; + echo "

DELETE Diese Konferenz\n"; } } else @@ -12030,7 +17777,7 @@ if ($ADD==31111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS VICIDIAL CONFERENCE\n"; + echo "

DELETE THIS VICIDIAL KONFERENZ\n"; } } else @@ -12053,7 +17800,7 @@ if ($ADD==311111111111111) 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 from system_settings;"; + $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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -12072,32 +17819,34 @@ if ($ADD==311111111111111) $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]; echo "
ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN\n"; echo "\n"; echo "
\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Version: $version
Install Date: $install_date
DB Schema Version: $db_schema_version
Auto User-add Value: $auto_user_add_value
Installieren Datum: $install_date
Gebrauch Nicht-Lateinisch: $NWB#settings-use_non_latin$NWE
Webroot Schreibbar: $NWB#settings-webroot_writable$NWE
Ermöglichen Sie Der QueueMetrics Protokollierung: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics Bediener IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics DB LOGON: $NWB#settings-queuemetrics_login$NWE
QueueMetrics DB Kennwort: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics Maschinenbordbuch Identifikation:$NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Stellen Voran: $NWB#settings-queuemetrics_eq_prepend$NWE
VICIDIAL Mittel Sperren Anzeige:
Erlauben Sie SIPSAK Anzeigen: $NWB#settings-allow_sipsak_messages$NWE
Admin Haupt-URL: $NWB#settings-admin_home_url$NWE
Ermöglichen Sie Vertreter-Übergangsprotokolldatei: $NWB#settings-enable_agc_xfer_log$NWE
Timeclock End-of-Day:$NWB#settings-timeclock_end_of_day$NWE
LetzteTimeclock Auto Logout: $timeclock_last_reset_date
QC Letzte Pull Zeit: $qc_last_pull_time
Agent-Header Datum Screen Format: $NWB#settings-vdc_header_date_format$NWE
Agent Screen Kunden Datum Format: $NWB#settings-vdc_customer_date_format$NWE
Agent Screen Kunden Telefon Format: $NWB#settings-vdc_header_phone_format$NWE
Agent API Aktive:$NWB#settings-vdc_agent_api_active$NWE
QC Funktionen aktiv: $NWB#settings-qc_features_active$NWE
Outbound Auto-Dial Aktiv: $NWB#settings-outbound_autodial_active$NWE
Max-FILL fordert pro Sekunde: $NWB#settings-outbound_calls_per_second$NWE
Ermöglichen Sie Der QueueMetrics Protokollierung: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics Bediener IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics DB LOGON: $NWB#settings-queuemetrics_login$NWE
QueueMetrics DB Kennwort: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics Maschinenbordbuch Identifikation:$NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Stellen Voran: $NWB#settings-queuemetrics_eq_prepend$NWE
Aktivieren vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Klicken Sie hier, um synchronisieren Sie Benutzer mit vtiger\n"; + echo "
Vtiger HE Bediener IP: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Kennwort:$NWB#settings-vtiger_pass$NWE
Vtiger URL: $NWB#settings-vtiger_url$NWE
\n"; echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Klicken Sie hier, um zu sehen, Admin chages auf die System-Einstellungen
\n"; + } + } else { @@ -12140,7 +17961,7 @@ if ($ADD==321111111111111) echo "
\n"; echo "VICIDIAL STATUS INNERHALB DIESES SYSTEMS:  $NWB#vicidial_statuses$NWE
\n"; echo "\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"; @@ -12208,7 +18029,7 @@ if ($ADD==321111111111111) echo "Status:   \n"; echo "Beschreibung:
\n"; echo "Auswählbar:   \n"; - echo "Human Answer:   \n"; + echo "Human Antwort:   \n"; echo "Kategorie:\n"; echo "
STATUSBESCHREIBUNGSELECT-
ABLE
HUMAN
ANSWER
CATEGORYMODIFY/DELETE
STATUSBESCHREIBUNGSELECT-
ABLE
HUMAN
ANTWORT
KATEGORIEMODIFY/DELETE
\n"; - echo "\n"; + echo "\n"; $stmt="SELECT * from vicidial_status_categories order by vsc_id;"; $rslt=mysql_query($stmt, $link); @@ -12253,12 +18074,12 @@ if ($ADD==331111111111111) 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]; - + $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; @@ -12297,12 +18118,13 @@ if ($ADD==331111111111111) echo "\n"; echo "$Avsc_id[$p]\n"; echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -12314,8 +18136,10 @@ if ($ADD==331111111111111) echo "
ADDIEREN SIE NEUE STATUS-KATEGORIE
\n"; echo "\n"; echo "Category ID:   \n"; - echo "Name:   \n"; - echo "TimeOnVDAD Display:  
\n"; + echo "Name:  
\n"; + echo "TimeOnVDAD Anzeige:   \n"; + echo "Verkauf Kategorie:   \n"; + echo "Dead Lead Kategorie:  
\n"; echo "Beschreibung:   \n"; echo "
\n"; @@ -12333,6 +18157,84 @@ if ($ADD==331111111111111) +###################### +# ADD=341111111111111 modify vicidial QC status code +###################### + +if ($ADD==341111111111111) +{ + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) + { + echo "
CATEGORYNAMETOVDADSTATUSES IN THIS CATEGORY
KATEGORIENAMEStatus in dieser Kategorie
\n"; echo "$CATstatuses"; echo "
Beschreibung:
        \n"; + echo "
TO VDAD Anzeige:     Verkauf Kategorie:     Dead Lead Kategorie:  
Beschreibung:
        \n"; echo "   LÖSCHUNG
 
\n"; + echo ""; + + echo "
\n"; + echo "VICIDIAL QC-Status-Codes mit Hilfe dieses Systems:  $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 CODEBESCHREIBUNGMODIFY/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 "LÖSCHUNG\n"; + } + else + { + echo "LÖSCHUNG\n"; + } + echo "
\n"; + + echo "
Neue QC-Statuscode
\n"; + echo "\n"; + echo "Status:   \n"; + echo "Beschreibung:
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } +} + + + + + ###################### # ADD=550 search form @@ -12535,7 +18437,7 @@ if ($ADD==8111) $CBquerySQLwhere = "and user_group='$user_group'"; -echo "
USER GROUP CALLBACK HOLD LISTINGS: $list_id\n"; +echo "
User Group CALLBACK HOLD LISTINGS: $list_id\n"; $oldADD = "ADD=8111&user_group=$user_group"; $ADD='82'; } @@ -12608,103 +18510,165 @@ echo "$CBinactiveLINK"; # ADD=0 display all active users ###################### if ($ADD==0) -{ -echo "
\n"; -echo ""; + { + echo "
\n"; + echo ""; + echo "
BENUTZER-AUFLISTUNGEN: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   Nur aktive Benutzer\n"; + } + else + { + $SQLstatus = "where active='Y'"; + echo "   Alle Nutzer anzeigen\n"; + } -$USERlink='stage=USERIDDOWN'; -$NAMElink='stage=NAMEDOWN'; -$LEVELlink='stage=LEVELDOWN'; -$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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} -if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} -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 * from vicidial_users $SQLorder"; + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $LEVELlink='stage=LEVELDOWN'; + $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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} + if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} + 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 $SQLstatus $SQLorder"; $rslt=mysql_query($stmt, $link); $people_to_print = mysql_num_rows($rslt); -echo "
BENUTZER-AUFLISTUNGEN:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
USER IDFULL NAMELEVELGROUPLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
USER IDFULL NAMELEVELGROUPAKTIVLINKS
$row[1]$row[3]$row[4]$row[5]ÄNDERN Sie | Notfall | STATUS | TIME
$row[0]$row[1]$row[2]$row[3]$row[4]
ÄNDERN Sie | Notfall | STATUS | TIME
\n"; -} + echo "
\n"; + } ###################### # ADD=10 display all campaigns ###################### if ($ADD==10) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $campaigns_to_print = mysql_num_rows($rslt); -echo "
KAMPAGNE AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
KAMPAGNE AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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 ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo "\n"; $o++; - } + } -echo "
Kampagnen-ID
NAME
ACTIVE   DIAL METHOD   LEVEL   BLEI BESTELLUNG   DIAL Status   ÄNDERN Sie
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=100 display all lists ###################### if ($ADD==100) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lists order by list_id"; + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $lists_to_print = mysql_num_rows($rslt); -echo "
LISTE AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
LISTE AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + $lists_printed = ''; $o=0; - while ($people_to_print > $o) { + while ($lists_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12712,14 +18676,40 @@ echo "
LISTE IDENTIFIKATIONLISTE NAMEBESCHREIBUNGLEADS COUNTAKTIVLAST CALL DATUMCAMPAIGNÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; 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 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 "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]   $row[2] $row[3] $row[4] $row[5] $row[6]ÄNDERN Sie
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]ÄNDERN Sie
\n"; -} + echo "
\n"; + } @@ -12727,19 +18717,29 @@ echo "
\n"; # ADD=1000 display all inbound groups ###################### if ($ADD==1000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $ingroups_to_print = mysql_num_rows($rslt); -echo "
INBOUND GRUPPE AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
INBOUND GRUPPE AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($ingroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12747,34 +18747,88 @@ echo "
IN-GROUPNAMEPRIORITYAKTIVTIMECOLORÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2] $row[3] $row[5]   $row[4]  ÄNDERN Sie
\n"; } -echo "
\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 "
INBOUND GRUPPE AUFLISTUNGEN:\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 "
#DIDBESCHREIBUNGAKTIVROUTEÄNDERN Sie
$row[0] $row[1] $row[2] $row[3] $row[4]ÄNDERN Sie
\n"; + } ###################### # ADD=10000 display all remote agents ###################### if ($ADD==10000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $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); - $people_to_print = mysql_num_rows($rslt); + $remoteagents_to_print = mysql_num_rows($rslt); -echo "
REMOTEMITTEL-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
REMOTEMITTEL-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($remoteagents_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12786,31 +18840,37 @@ echo "
USERLINESBEDIENER  CONF-EXTEN   STATUS   CAMPAIGN   ÄNDERN Sie
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[4] $row[5] $row[6]ÄNDERN Sie
ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=100000 display all user groups ###################### if ($ADD==100000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $usergroups_to_print = mysql_num_rows($rslt); -echo "
BENUTZER-GRUPPEN AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
BENUTZER-GRUPPEN AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($usergroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12818,31 +18878,38 @@ echo "
User GroupGroup NameFORCE TIMECLOCK   ÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ÄNDERN Sie
$row[2]ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000 display all scripts ###################### if ($ADD==1000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $scripts_to_print = mysql_num_rows($rslt); -echo "
INDEX-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
INDEX-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($scripts_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12850,32 +18917,37 @@ echo "
SCRIPT IDSkriptnamenACTIVE   ÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ÄNDERN Sie
$row[2]ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000 display all filters ###################### if ($ADD==10000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; + $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 "
LEITUNG FILTER-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
LEITUNG FILTER-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($filters_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12883,32 +18955,38 @@ echo "
FILTER IDFILTER NAMEÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ÄNDERN Sie
ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=100000000 display all call times ###################### if ($ADD==100000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_call_times order by call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $calltimes_to_print = mysql_num_rows($rslt); -echo "
Anrufzeiten Liste:\n"; -echo "
\n"; + echo "
Anrufzeiten Liste:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($calltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12916,33 +18994,41 @@ echo "
CALLTIME IDCALLTIME NAMEDEFAULT STARTDEFAULT STOPÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] ÄNDERN Sie
ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000000 display all state call times ###################### if ($ADD==1000000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $statecalltimes_to_print = mysql_num_rows($rslt); + + echo "
Liste der landesspezifische Anrufzeiten:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; -echo "
Liste der landesspezifische Anrufzeiten:\n"; -echo "
CALLTIME IDCALLTIME STATECALLTIME NAMEDEFAULT STARTDEFAULT STOPÄNDERN Sie
\n"; $o=0; - while ($filters_to_print > $o) { + while ($statecalltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12953,147 +19039,383 @@ echo "
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; + } + + echo "
$row[2] $row[3] $row[4] ÄNDERN Sie
ÄNDERN Sie
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000 display all shifts +###################### +if ($ADD==130000000) + { + 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 "
UMSCHALT LISTINGS:\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 "
SHIFT-IDUMSCHALT NAMEUMSCHALT STARTUMSCHALT LÄNGEWOCHEÄNDERN Sie
$row[0] $row[1] $row[2] $row[3] $row[4] ÄNDERN Sie
\n"; + } ###################### # ADD=10000000000 display all phones ###################### if ($ADD==10000000000) -{ -echo "
\n"; -echo ""; + { + 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 * from phones $SQLorder"; + $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 "
TELEFON-AUFLISTUNGEN:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
TELEFON-AUFLISTUNGEN:\n"; + echo "
EXTENPROTOSERVERDIAL PLANSTATUSNAMEVMAILLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo " + + + + + + + + "; + echo "\n"; $o++; + } + + echo "
EXTENPROTOSERVERDIAL PLANSTATUSNAMEVMAILLINKS
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ÄNDERN Sie | Notfall
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ÄNDERN Sie | Notfall
\n"; } -echo "
\n"; -} +###################### +# ADD=12000000000 display all phones alias +###################### +if ($ADD==12000000000) + { + 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 "
TEL ALIAS LISTINGS:\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 "
ALIAS IDAlias-NameTEL Logins LISTEÄNDERN Sie
$row[0]$row[1]$row[2]ÄNDERN Sie
\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 "
GROUP ALIAS LISTEINGS:\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 "
GROUP ALIAS IDGROUP Alias-NameCID NUMBERCID NAMEAKTIVÄNDERN Sie
$row[0]$row[1]$row[2]$row[3]$row[4]ÄNDERN Sie
\n"; + } ###################### # ADD=100000000000 display all servers ###################### if ($ADD==100000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from servers order by server_id"; + $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); - $phones_to_print = mysql_num_rows($rslt); + $servers_to_print = mysql_num_rows($rslt); -echo "
BEDIENER-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
BEDIENER-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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 "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; + } + + echo "
BEDIENERIDNAMEBEDIENERIPAKTIVASTERISKTrunksGMTÄNDERN Sie
$row[0]$row[1] $row[2] $row[4] $row[3]  ÄNDERN Sie
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]ÄNDERN Sie
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + 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 "
CONF VorlagenlisteINGS:\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 "
Vorlagen-IDTemplate NameÄNDERN Sie
$row[0]$row[1]ÄNDERN Sie
\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 "
CARRIER LISTEINGS:\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 "
Carrier-IDCarrier NameBediener IPProtocolAnmeldungAktiveÄNDERN Sie
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]ÄNDERN Sie
\n"; + } ###################### # ADD=1000000000000 display all conferences ###################### if ($ADD==1000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $conferences_to_print = mysql_num_rows($rslt); -echo "
KONFERENZ-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
KONFERENZ-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
CONFERENCEBEDIENERIPVERLÄNGERUNGÄNDERN Sie
$row[0] $row[1] $row[2]$row[4]  ÄNDERN Sie
$row[1]$row[2]ÄNDERN Sie
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000000000 display all vicidial conferences ###################### if ($ADD==10000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $vicidialconf_to_print = mysql_num_rows($rslt); -echo "
KONFERENZ-AUFLISTUNGEN:\n"; -echo "
\n"; + echo "
VICIDIAL KONFERENZ-AUFLISTUNGEN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + while ($vicidialconf_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -13101,120 +19423,466 @@ echo "
CONFERENCEBEDIENERIPVERLÄNGERUNGÄNDERN Sie
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2]$row[4]  ÄNDERN Sie
$row[2]ÄNDERN Sie
\n"; + } + + + + + +###################### +# ADD=700000000000000 view all activity in the admin log +###################### + +if ($ADD==700000000000000) + { + echo "\n";echo "\n"; +$stmt="SELECT admin_home_url from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; + +?> +
+ + +
\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 "
Änderung der Registrierung ADMIN: (Letzte 10.000 Datensätze)\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('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 "NEXT\n"; + echo "
\n"; + } + + +###################### +# ADD=710000000000000 view all activity in the admin log made by one user +###################### + +if ($ADD==710000000000000) + { + echo "\n"; +echo "
\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 "
Änderung der Registrierung ADMIN: Änderungen $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('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"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +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) + { + $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"; + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + 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]); + 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"; -} ###################### # ADD=999999 display reports section ###################### if ($ADD==999999) -{ - if ($LOGview_reports==1) { - echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - - $stmt="select * from servers;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $servers_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $servers_to_print) + 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;"; + $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); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; - $stmt="SELECT enable_queuemetrics_logging,queuemetrics_url from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging_LU = $row[0]; - $queuemetrics_url_LU = $row[1]; + ?> + + + + + VICIDIAL: Server-Statistiken und Berichte + VICIDIAL: Server-Statistiken und Berichte

+
\n"; + } else - { - echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; - exit; + { + echo "Sie haben nicht Erlaubnis, diese Seite anzusehen\n"; + exit; + } } -} +echo "
\n"; echo "
\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n


\n
\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds"; -echo "                   VERSION: $admin_version"; -echo "                   BAU: $build
\n"; - +echo "
\n"; +echo "

"; +echo "VERSION: $admin_version
"; +echo "BAU: $build
\n"; ?> - +
@@ -13318,7 +19986,7 @@ if (isset($camp_lists)) $state_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday lokale Zeit + if ($GMT_day[$r]==0) #### Sonntag lokale Zeit { if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) { @@ -13331,7 +19999,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday lokale Zeit + if ($GMT_day[$r]==1) #### Montag lokale Zeit { if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) { @@ -13344,7 +20012,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday lokale Zeit + if ($GMT_day[$r]==2) #### Dienstag lokale Zeit { if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) { @@ -13357,7 +20025,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday lokale Zeit + if ($GMT_day[$r]==3) #### Mittwoch lokale Zeit { if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) { @@ -13370,7 +20038,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday lokale Zeit + if ($GMT_day[$r]==4) #### Donnerstag lokale Zeit { if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) { @@ -13383,7 +20051,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday lokale Zeit + if ($GMT_day[$r]==5) #### Freitag lokale Zeit { if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) { @@ -13396,7 +20064,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday lokale Zeit + if ($GMT_day[$r]==6) #### Samstag lokale Zeit { if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) { @@ -13431,7 +20099,7 @@ if (isset($camp_lists)) $default_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday lokale Zeit + if ($GMT_day[$r]==0) #### Sonntag lokale Zeit { if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) { @@ -13444,7 +20112,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday lokale Zeit + if ($GMT_day[$r]==1) #### Montag lokale Zeit { if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) { @@ -13457,7 +20125,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday lokale Zeit + if ($GMT_day[$r]==2) #### Dienstag lokale Zeit { if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) { @@ -13470,7 +20138,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday lokale Zeit + if ($GMT_day[$r]==3) #### Mittwoch lokale Zeit { if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) { @@ -13483,7 +20151,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday lokale Zeit + if ($GMT_day[$r]==4) #### Donnerstag lokale Zeit { if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) { @@ -13496,7 +20164,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday lokale Zeit + if ($GMT_day[$r]==5) #### Freitag lokale Zeit { if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) { @@ -13509,7 +20177,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday lokale Zeit + if ($GMT_day[$r]==6) #### Samstag lokale Zeit { if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) { diff --git a/LANG_www/vicidial_de/admin_header.php b/LANG_www/vicidial_de/admin_header.php new file mode 100644 index 00000000..aa45a0e8 --- /dev/null +++ b/LANG_www/vicidial_de/admin_header.php @@ -0,0 +1,932 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Benutzer     Kampagnen     Listen     Indexe     Filter     In-Gruppen     Benutzer-Gruppen     Remotemittel     Admin     Berichte  
+ 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 Deutsch
+ +\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + + + + 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) { + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # pink + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} # pink + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} # pink + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} # pink + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink + else {$status_sh=''; $status_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + + + + +
WIDTH=160> + SIZE=>Benutzer +
+   >Benutzer anzeigen +
+   >Hinzufügen eines neuen Benutzers +
+   >KopierenBenutzer +
+   >Suche für einen Benutzer +
+   >User-Statistiken +
+   >User Status +
+   >Time Sheet
> + SIZE=>Kampagnen +
>   SIZE=>Kampagnen Main
>   SIZE=>Status
>   SIZE=>HotKeys
>   SIZE=>Lead-Recycling
>   SIZE=>Auto-Alt Dial
>   SIZE=>US-Mix
>   SIZE=>Pause Codes
> SIZE=>Listen
  + > Zeigen Sie Listen +
  + > Addieren Sie Eine Neue Liste +
  + > Suche Nach Einer Leitung +
  + > Fügen Sie Zahl DNC Hinzu +
  + > Last Neue Leitungen +
> + SIZE=> Indexe +
  + > Zeigen Sie Indexe +
  + > Addieren Sie Einen Neuen Index +
> SIZE=> Filter
  + > Zeigen Sie Filter +
  + > Addieren Sie Einen Neuen Filter +
> + SIZE=> In-Gruppen +
  + > Zeigen Sie In-Gruppen +
  + > Addieren Sie Eine Neue In-Gruppe +
  + > KopierenIn-Gruppe +
  + > Show DIDS +
  + > Hinzufügen einer neuen DID +
  + > KopierenDID +
> + SIZE=> Benutzer-Gruppen +
  + > Zeigen Sie Benutzer-Gruppen +
  + > Addieren Sie Eine Neue Benutzer-Gruppe +
  + > Gruppe Stündlicher Report +
  + > Bulk-Gruppe ändern +
> + SIZE=> Remotemittel +
  + > Zeigen Sie Remotemittel +
  + > Addieren Sie Neue Remotemittel +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Anruf-Zeiten
>   + SIZE=> Verschiebungen
>   + SIZE=> Telefone
>   + SIZE=> Vorlagen
>   + SIZE=> Träger
>   + SIZE=> Bediener
>   + SIZE=> Konferenzen
>   + SIZE=> System Einstellungen
>   + SIZE=>Systemstatus
> + SIZE=> Berichte +
+
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) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + \n"; + echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen.\n"; + } + +if (strlen($reports_hh) > 1) { + ?> +> + + + + +\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 * 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 * 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); @@ -336,10 +429,13 @@ else $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 * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -349,7 +445,7 @@ else $tsr = "$row[4]"; $vendor_id = "$row[5]"; $list_id = "$row[7]"; - $campaign_id = "$row[8]"; + $gmt_offset_now = "$row[8]"; $phone_code = "$row[10]"; $phone_number = "$row[11]"; $title = "$row[12]"; @@ -379,7 +475,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -399,10 +495,11 @@ 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 "
HAUPT | Timeclock | Logout  
>   > Zeigen Sie Kampagnen     |     > Addieren Sie Eine Neue Kampagne     |     > KopierenKampagne     |     > Realzeitkampagnen Zusammenfassend
  > Zeigen Sie Anruf-Zeiten  | > Addieren Sie Eine Neue Anruf-Zeit  | > Zeigen Sie Zustand-Anruf-Zeiten  | > Addieren Sie Eine Neue Zustand-Anruf-Zeit
  > Show Verschiebungen  | > Fügen Sie eine neue Schicht
  > Zeigen Sie Telefone  | > Addieren Sie Ein Neues Telefon  | > Telefon Alias Liste  | > Hinzufügen einer neuen Telefon Alias  | > Gruppe Alias Liste  | > Eine neue Gruppe hinzuzufügen Alias
  > Zeigen Sie Konferenzen   |   > Addieren Sie Eine Neue Konferenz   |   > Zeigen Sie VICIDIAL Konferenzen   |   > Addieren Sie Eine Neue VICIDIAL Konferenz
  > Zeigen Sie Bediener   |   > Addieren Sie Einen Neuen Bediener
  > Show-Vorlagen   |   > Fügen Sie eine neue Vorlage
  > Show Träger   |   > Add A New Carrier
  > System Einstellungen
  >Systemstatus   |   >Status-Kategorien   |   >QK-Status-Codes
  >User-Statistiken   |   >User Status   |   >Time Sheet   |   >Tage Status
>  
+ LICENSE: GPLv2 +# AST GUI database administration modify lead in vicidial_list +# admin_modify_lead.php +# +# this is the administration lead information modifier screen, the administrator +# 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 # - # 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 # require("dbconnect.php"); @@ -19,6 +40,8 @@ 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"];} @@ -93,40 +116,50 @@ 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); - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier 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 -# -# 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 -# - $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); - - $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); +############################################# +##### 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); - $auth=$row[0]; + $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");} @@ -183,21 +216,22 @@ echo "VICIDIAL ADMIN: Leitung notieren Ände if ($end_call > 0) { -$call_length = ($STARTtime - $call_began); - - ### 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) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . 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); - ### 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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Informationen geändert

\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 @@ -226,18 +260,39 @@ $call_length = ($STARTtime - $call_began); echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; } - ### update last record in vicidial_agent_log and vicidial_log tables + ### 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 { @@ -281,6 +336,7 @@ else if ($lead_count > 0) { + ##### grab vicidial_log records ##### $stmt="select * 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); @@ -306,10 +362,47 @@ else $call_log .= "
$row[11] $row[3] $row[2] $row[1]
$row[1] $row[15]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$row[3] $row[2] $row[1]   $row[14]
  $row[14]   $row[17]
Main Phone :
(with $log_campaign statuses)
Modify agent and vicidial logs
Ändernvicidial log
Ändernagent log
Änderncloser log
Add closer log record
\n"; @@ -513,8 +614,8 @@ echo "

\n"; echo "
\n"; echo "ANRUFE ZU DIESEM LEITUNG:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD
\n"; +echo "\n"; echo "$call_log\n"; @@ -522,8 +623,8 @@ echo "
# DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD HANGUP REASON
\n"; echo "

\n"; echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD WAIT
\n"; +echo "\n"; echo "$closer_log\n"; @@ -531,13 +632,23 @@ echo "
# DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD WAIT HANGUP REASON
\n"; echo "

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

\n"; + + echo "RECORDINGS FOR THIS LEAD:\n"; echo "\n"; echo "\n"; - $stmt="select * 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); +$stmt="select * 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); $u=0; while ($logs_to_print > $u) @@ -549,6 +660,30 @@ echo " - + @@ -514,7 +553,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -522,13 +561,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -729,7 +768,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -737,13 +776,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -764,8 +803,14 @@ function ParseFileName() { print ""; } -if ($leadfile && filesize($LF_path)<=8388608) { +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='LISTEN', 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 ""; @@ -953,7 +998,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -961,13 +1006,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1179,7 +1224,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1187,13 +1232,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1267,54 +1312,23 @@ if ($leadfile && filesize($LF_path)<=8388608) { for ($i=0; $i\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"; } } else if (!eregi(".csv", $leadfile_name)) @@ -1369,54 +1383,22 @@ if ($leadfile && filesize($LF_path)<=8388608) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); for ($i=0; $i\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 " \r\n"; @@ -1431,8 +1413,8 @@ if ($leadfile && filesize($LF_path)<=8388608) { # } print ""; } -} else if (filesize($leadfile)>8388608) { - print "
STÖRUNG: Akte übersteigt die Begrenzung 8MB.
"; +#} else if (filesize($leadfile)>8388608) { +# print "
ERROR: File exceeds the 8MB limit.
"; } ?> @@ -1554,17 +1536,17 @@ $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";} + if ($DBX) {print " Second Sonntag March to First Sonntag 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. + # Based on Second Sonntag March to First Sonntag 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) + # dow INTEGER Day of week (0=Sonntag, to 6=Samstag) # OPTIONAL INPUT: # timezone INTEGER hour difference UTC - local standard time # (DEFAULT is blank) @@ -1650,12 +1632,12 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} + if ($DBX) {print " First Sonntag April to Last Sonntag 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. + # Based on first Sonntag in April and last Sonntag in October at 2 am. #********************************************************************** $USA_DST=0; @@ -1719,11 +1701,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + if ($DBX) {print " Last Sonntag March to Last Sonntag 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. + # Based on last Sonntag in March and last Sonntag in October at 1 am. #********************************************************************** $GBR_DST=0; @@ -1787,11 +1769,11 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + if ($DBX) {print " Last Sonntag October to Last Sonntag 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. + # Based on last Sonntag in October and last Sonntag in March at 1 am. #********************************************************************** $AUS_DST=0; @@ -1856,12 +1838,12 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} + if ($DBX) {print " First Sonntag October to Last Sonntag 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. + # Based on first Sonntag in October and last Sonntag in March at 1 am. #********************************************************************** $AUST_DST=0; @@ -1923,11 +1905,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} + if ($DBX) {print " First Sonntag October to Third Sonntag 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. + # Based on first Sonntag in October and third Sonntag in March at 1 am. #********************************************************************** $NZL_DST=0; @@ -1990,12 +1972,12 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + if ($DBX) {print " Third Sonntag October to Last Sonntag 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. + # Based on Third Sonntag October to Last Sonntag February at 1 am. #********************************************************************** $BZL_DST=0; @@ -2066,4 +2048,7 @@ if (!$AC_processed) } return $gmt_offset; -} \ No newline at end of file +} + +?> +
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD2) + { + $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 diff --git a/LANG_www/vicidial_de/admin_search_lead.php b/LANG_www/vicidial_de/admin_search_lead.php index 689579d0..0c63f574 100644 --- a/LANG_www/vicidial_de/admin_search_lead.php +++ b/LANG_www/vicidial_de/admin_search_lead.php @@ -1,17 +1,23 @@ LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php +# admin_search_lead.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead +# AST GUI database administration search for lead info +# admin_modify_lead.php +# +# this is the administration lead information modifier 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 # require("dbconnect.php"); @@ -31,9 +37,16 @@ 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"];} +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"];} $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); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -93,24 +106,49 @@ $browser = getenv("HTTP_USER_AGENT"); -VICIDIAL ADMIN: Leitung Suche - -Leitung Nachschlagen - - +VICIDIAL ADMIN: Leitung Suche <? -echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Lead search<BR>\n"; + +##### 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"); -if ( (!$vendor_id) and (!$phone) and (!$lead_id) ) + + + +echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user<BR>\n"; + + +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) { echo date("l F j, Y G:i:s A"); echo "\n<br><br><center>\n"; echo "<form method=post name=search action=\"$PHP_SELF\">\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<b>Tragen Sie bitte a ein:<br> Vendor ID(Verkäuferleitung Code): <input type=text name=vendor_id size=10 maxlength=10> or \n"; - echo "<br><b>eine Haupttelefonnummer: <input type=text name=phone size=10 maxlength=10> or\n"; - echo "<br><b>eine Leitung Identifikation: <input type=text name=lead_id size=10 maxlength=10> <br><br>\n"; + echo "<br><b>eine Haupttelefonnummer: <input type=text name=phone size=20 maxlength=16> or\n"; + echo "<br><b>eine Leitung Identifikation: <input type=text name=lead_id size=10 maxlength=10> or\n"; + echo "<br><b>status: <input type=text name=status size=7 maxlength=6>   \n"; + echo "<b>list ID: <input type=text name=list_id size=15 maxlength=14>   \n"; + echo "<b>user: <input type=text name=user size=15 maxlength=20> <br><br>\n"; echo "<input type=submit name=submit value=SUBMIT></b>\n"; echo "</form>\n</center>\n"; echo "</body></html>\n"; @@ -138,8 +176,32 @@ else } else { - print "ERROR: you must search for something! Go back and search for something"; - exit; + 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 * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000"; + } + else + { + print "ERROR: you must search for something! Go back and search for something"; + exit; + } } } } @@ -182,13 +244,14 @@ else { $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]\">$row[0]</a></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"; @@ -197,11 +260,19 @@ else 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[2]</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 MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } diff --git a/LANG_www/vicidial_de/call_report_export.php b/LANG_www/vicidial_de/call_report_export.php new file mode 100644 index 00000000..7a8e7ec8 --- /dev/null +++ b/LANG_www/vicidial_de/call_report_export.php @@ -0,0 +1,513 @@ +<? +# 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) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Unzulässiges 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"; + exit; + } + + + if ($RUNcampaign > 0) + { + $export_campaign_rows=''; + $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 from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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); + + $export_campaign_rows .= "$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]\r\n"; + $i++; + } + } + } + + if ($RUNgroup > 0) + { + $export_group_rows=''; + $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 from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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) + { + 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); + + $export_group_rows .= "$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]\r\n"; + $i++; + } + } + } + + + 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 ERSUCHT BERICHT', 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(); + + echo "$export_campaign_rows$export_group_rows"; + } + 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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>VICIDIAL: Export fordert Bericht"; + + ##### 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 fordert Bericht</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\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>Zeitraum:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Kampagnen:</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 Gruppen:</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>Listen:</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>Status:</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>Benutzer-Gruppen:</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/LANG_www/vicidial_de/dbconnect.php b/LANG_www/vicidial_de/dbconnect.php index 5247e166..dae8cc7a 100644 --- a/LANG_www/vicidial_de/dbconnect.php +++ b/LANG_www/vicidial_de/dbconnect.php @@ -1,6 +1,10 @@ <? # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# dbconnect.php version 2.0.5 +# +# database connection settings and some global web settings +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # if ( file_exists("/etc/astguiclient.conf") ) { @@ -36,6 +40,9 @@ $WeBServeRRooT = '/usr/local/apache2/htdocs'; } $link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +if (!$link) { + die('MySQL connect ERROR: ' . mysql_error()); +} mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; @@ -45,5 +52,9 @@ $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/LANG_www/vicidial_de/fcstats.php b/LANG_www/vicidial_de/fcstats.php new file mode 100644 index 00000000..a18c4b1d --- /dev/null +++ b/LANG_www/vicidial_de/fcstats.php @@ -0,0 +1,600 @@ +<? +# fcstats.php +# +# Copyright (C) 2009 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 +# + +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$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 "Unzulässiges Username/Kennwort:|$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;"; +$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> + +<? +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>VICIDIAL: In-Group Fronter-Closer Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ÄNDERN Sie | REPORTS \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK SUBMIT\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 "VICIDIAL: In-Group Fronter-Closer Stats                      $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 "| MITTEL                   |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 "| MITTEL                   | 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/LANG_www/vicidial_de/group_hourly_stats.php b/LANG_www/vicidial_de/group_hourly_stats.php index 467d685d..eb36b136 100644 --- a/LANG_www/vicidial_de/group_hourly_stats.php +++ b/LANG_www/vicidial_de/group_hourly_stats.php @@ -1,12 +1,13 @@ LICENSE: GPLv2 -### +# group_hourly_stats.php +# +# Copyright (C) 2009 Matt Florell 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 # require("dbconnect.php"); @@ -104,14 +105,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL ADMIN: Gruppe Stündlicher Notfall + +VICIDIAL ADMIN: Gruppe Stündlicher Notfall <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + +##### 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"); + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> + + <CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: Gruppe Stündlicher Notfall <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Gruppe Stündlicher Notfall <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> @@ -234,7 +256,7 @@ echo "<font size=0>\n\n\n<br><br><br>\nIndexlaufzeit: $RUNtime seconds</font>"; ?> -</TD></TR><TABLE> +</TD></TR></TABLE> </body> </html> diff --git a/LANG_www/vicidial_de/list_download.php b/LANG_www/vicidial_de/list_download.php new file mode 100644 index 00000000..76d23aa3 --- /dev/null +++ b/LANG_www/vicidial_de/list_download.php @@ -0,0 +1,130 @@ +<? +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# + +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["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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Unzulässiges Username/Password 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 * 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); + + 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]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_de/listloader.pl b/LANG_www/vicidial_de/listloader.pl index d926368b..b8f9e064 100644 --- a/LANG_www/vicidial_de/listloader.pl +++ b/LANG_www/vicidial_de/listloader.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -18,6 +17,8 @@ # 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 # ### begin parsing run-time options ### @@ -148,6 +149,23 @@ $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';"; @@ -547,14 +565,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_de/listloaderMAIN.php b/LANG_www/vicidial_de/listloaderMAIN.php index 30c5fc5e..7564fd05 100644 --- a/LANG_www/vicidial_de/listloaderMAIN.php +++ b/LANG_www/vicidial_de/listloaderMAIN.php @@ -1,7 +1,7 @@ <? # listloaderMAIN.php # -# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2008 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 diff --git a/LANG_www/vicidial_de/listloader_rowdisplay.pl b/LANG_www/vicidial_de/listloader_rowdisplay.pl index 3f8695c0..bbfc8170 100644 --- a/LANG_www/vicidial_de/listloader_rowdisplay.pl +++ b/LANG_www/vicidial_de/listloader_rowdisplay.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl - -### listloader_rowdisplay.pl version 0.2 *DBI-version* -### -### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_rowdisplay.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# # # CHANGES # diff --git a/LANG_www/vicidial_de/listloader_super.pl b/LANG_www/vicidial_de/listloader_super.pl index 167fff5e..3af97f37 100644 --- a/LANG_www/vicidial_de/listloader_super.pl +++ b/LANG_www/vicidial_de/listloader_super.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader_super.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_super.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -17,6 +16,8 @@ # 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 # ### begin parsing run-time options ### @@ -149,21 +150,38 @@ $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 ##### +########################################### - ### 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(); + +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; @@ -549,14 +567,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_de/new_listloader_superL.php b/LANG_www/vicidial_de/new_listloader_superL.php index bdd3feb9..033617e4 100644 --- a/LANG_www/vicidial_de/new_listloader_superL.php +++ b/LANG_www/vicidial_de/new_listloader_superL.php @@ -1,7 +1,7 @@ <? # new_listloader_superL.php # -# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -19,11 +19,17 @@ # 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 # # 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.0.4'; -$build = '70510-1518'; +$version = '2.0.5-29'; +$build = '90310-2128'; require("dbconnect.php"); @@ -47,6 +53,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} 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"];} @@ -113,10 +120,28 @@ if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_co # $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); - +} $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -125,6 +150,7 @@ $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]; @@ -144,6 +170,9 @@ $browser = getenv("HTTP_USER_AGENT"); 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); @@ -290,7 +319,17 @@ function ParseFileName() { </script> <title>VICIDIAL ADMIN: Lead Loader - + + +
"; +?> + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> @@ -304,7 +343,7 @@ function ParseFileName() {
(nur Zahlen or leave blank for values in the file)
Phone Code Override: Telefon-Nr Override: (nur Zahlen or leave blank for values in the file)
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
diff --git a/LANG_www/vicidial_de/non_agent_api.php b/LANG_www/vicidial_de/non_agent_api.php new file mode 100644 index 00000000..2d525f39 --- /dev/null +++ b/LANG_www/vicidial_de/non_agent_api.php @@ -0,0 +1,1419 @@ + 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 +# + +$version = '2.0.5-5'; +$build = '90118-1056'; + +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"];} + + +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); +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) + { + $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); + } + +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';} + +$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; + } + + + + +################################################################################ +### 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';"; + if ($DB) {echo "|$stmt|\n";} + $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 + { + if ($dnc_check == 'Y') + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + if ($DB) {echo "|$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') + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';"; + if ($DB) {echo "|$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; + } + } + + ### 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';"; + if ($DB) {echo "$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) {echo "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) {echo "$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;"; + if ($DB) {echo "|$stmt|\n";} + $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) {echo "$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; + } + } + + + +$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 * 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 * 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 * 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 * 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 * 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-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 == '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 * 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 * 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/LANG_www/vicidial_de/remote_dispo.php b/LANG_www/vicidial_de/remote_dispo.php index 01d5eb2d..49637071 100644 --- a/LANG_www/vicidial_de/remote_dispo.php +++ b/LANG_www/vicidial_de/remote_dispo.php @@ -1,10 +1,12 @@ LICENSE: GPLv2 -### -# 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 - +# remote_dispo.php +# +# Copyright (C) 2008 Matt Florell 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 @@ -258,7 +260,7 @@ else echo "
+ +\n"; +echo "
Timeclock Datensatz bearbeiten for  
  \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 "ERROR-Es gibt ein Problem mit den Daten, die Sie eingegeben haben, gehen Sie bitte zurück
\n"; + echo "Ein timeclock Tagung können sich nicht ein anderes timeclock Sitzung
\n"; + echo "$LOGINepoch
\n"; + echo "$LOGOUTepoch
\n"; + echo "$LOGINevent_id
\n"; + echo "$LOGOUTevent_id
\n"; + echo "$LOGINuser
\n"; + echo "$PREVevent_epoch
\n"; + echo "$PREVevent_id
\n"; + echo "$NEXTevent_epoch
\n"; + echo "$NEXTevent_id
\n"; + exit; + } + if ( ($LOGINepoch > $StarTtimE) || ($LOGOUTepoch > $StarTtimE) || ($log_time > 86400) || ($log_time < 1) ) + { + echo "ERROR-Es gibt ein Problem mit den Daten, die Sie eingegeben haben, gehen Sie bitte zurück
\n"; + echo "$LOGINepoch
\n"; + echo "$LOGOUTepoch
\n"; + echo "$notes
\n"; + echo "$LOGINevent_id
\n"; + echo "$LOGOUTevent_id
\n"; + echo "$LOGINuser
\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 "\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 "\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 "\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 "\n"; + + echo "The timeclock session has been updated. Click here to view.
\n"; + exit; + } + } +##### END TIMECLOCK RECORD MODIFY ##### + + + + +echo "\n
"; + +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 "

\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "        USER: $LOGINuser ($full_name)         \n"; + echo "HOURS: $event_hours_int:$event_minutes_int \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LOGIN TIME:
TIMECLOCK ID: $LOGINevent_id
User Gruppe:$LOGINuser_group
IP ADDRESS: $LOGINip_address
MANAGER USER: $LOGINmanager_user
MANAGER IP: $LOGINmanager_ip
NOTES: $LOGINnotes
LAST CHANGE: $LOGINevent_datestamp
\n"; + + echo "
        \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LOGOUT TIME:
TIMECLOCK ID: $LOGOUTevent_id
User Gruppe:$LOGOUTuser_group
IP ADDRESS: $LOGOUTip_address
MANAGER USER: $LOGOUTmanager_user
MANAGER IP: $LOGOUTmanager_ip
NOTES: $LOGOUTnotes
LAST CHANGE: $LOGOUTevent_datestamp
\n"; + echo "
\n"; + echo "NEW NOTES: \n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "

\n"; + } + + +echo "VICIDIAL Time Sheet\n"; +echo " - User-Statistiken\n"; +echo " - Ändern Sie Benutzer\n"; + +echo "
\n"; + + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $StarTtimE); + +echo "\n\n\n


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


\nIndexlaufzeit: $RUNtime seconds
"; + +echo "|$stage|$group|"; + +} +else +{ + +echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n"; +} +?> + + +
+ + + + + diff --git a/LANG_www/vicidial_de/timeclock_report.php b/LANG_www/vicidial_de/timeclock_report.php new file mode 100644 index 00000000..264b6f4b --- /dev/null +++ b/LANG_www/vicidial_de/timeclock_report.php @@ -0,0 +1,359 @@ + 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 +# + +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($order)<2) {$order='hours_down';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Unzulässiges Username/Kennwort:|$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;"; +$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 ##### +?> + + + + + + + +VICIDIAL: UserTimeclock Report + +<? + +##### 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>\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>Zeitraum:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Benutzer-Gruppen:</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>User:</B></font><BR>\n"; +echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; + +echo "<BR><BR><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\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\">REPORTS</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "VICIDIAL: UserTimeclock 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/LANG_www/vicidial_de/timeclock_status.php b/LANG_www/vicidial_de/timeclock_status.php new file mode 100644 index 00000000..4d0dea26 --- /dev/null +++ b/LANG_www/vicidial_de/timeclock_status.php @@ -0,0 +1,548 @@ +<? +# timeclock_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# + +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day 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]; + $timeclock_end_of_day = $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"); +$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 "Unzulässiges Username/Kennwort:|$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;"; +$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>VICIDIAL ADMIN:Timeclock Status +<? + +##### 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>Timeclock Status for <? echo $user_group ?></TD><TD ALIGN=RIGHT>             +<? +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>User Group</a>\n"; +?> +</TD></TR> + + + + +<? + +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 User Gruppe:$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 CAMPAIGN</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 + } + + 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]);} + + $s++; + } + $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>\nIndexlaufzeit: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? +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 LOGIN/LOGOUT ZEIT:</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>FALL </td><td align=right><font size=2>DATUM</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:MINUTES</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>\nIndexlaufzeit: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_de/user_group_bulk_change.php b/LANG_www/vicidial_de/user_group_bulk_change.php new file mode 100644 index 00000000..d2883d5e --- /dev/null +++ b/LANG_www/vicidial_de/user_group_bulk_change.php @@ -0,0 +1,269 @@ +<? +# 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 +# + +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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Unzulässiges Username/Kennwort:|$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 * 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>VICIDIAL ADMIN: Benutzer-Gruppe Bulk ändern +<? + +##### 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>   Benutzer-Gruppe Bulk ändern</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<? + +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 Benutzer-Gruppe $old_group Benutzer changed to the $group Benutzer-Gruppe<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 User Group CHANGE', event_sql=\"$SQL_log\", event_notes='Old Gruppe:$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 Benutzer changed to the $group Benutzer-Gruppe<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 User Group 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 Benutzer 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=SUBMIT></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 Benutzer 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=SUBMIT></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>\nIndexlaufzeit: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_de/user_stats.php b/LANG_www/vicidial_de/user_stats.php index 8b7ac6eb..36c536a8 100644 --- a/LANG_www/vicidial_de/user_stats.php +++ b/LANG_www/vicidial_de/user_stats.php @@ -1,14 +1,22 @@ <? -### user_stats.php -### -### Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# user_stats.php +# +# Copyright (C) 2009 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 # header ("Content-type: text/html; charset=utf-8"); @@ -19,16 +27,18 @@ $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"];} + 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"])) {$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["submit"])) {$submit=$_GET["submit"];} +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"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -66,6 +76,7 @@ $browser = getenv("HTTP_USER_AGENT"); $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); } @@ -73,6 +84,8 @@ $browser = getenv("HTTP_USER_AGENT"); { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -88,14 +101,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> <html> <head> -<title>VICIDIAL ADMIN: User Stats + +VICIDIAL ADMIN: User-Statistiken <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   User-Statistiken for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> @@ -105,81 +139,130 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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=user value=\"$user\">\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n"; echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>  \n"; +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\n"; +echo "           $user - $full_name<BR><BR>\n"; -echo " - <a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_status.php?user=$user\">User Status</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">User Status</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">User multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\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); - $statuses_to_print = mysql_num_rows($rslt); - echo "<br><center>\n"; -echo "<B>GESPRÄCH ZEIT UND STATUS:</B>\n"; +##### vicidial agent talk time and status ##### + +echo "<B>VICIDIAL GESPRÄCH ZEIT UND STATUS:</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>ZÄHLIMPULS</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo "<tr $bgcolor><td><font size=2>$row[1]</td>"; - echo "<td align=right><font size=2> $row[0]</td>\n"; - echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; +$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 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'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; +$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_seconds = $call_sec[$o]; $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); + $call_hours_int = round($call_hours, 2); + $call_hours_int = intval("$call_hours_int"); $call_minutes = ($call_hours - $call_hours_int); $call_minutes = ($call_minutes * 60); $call_minutes_int = round($call_minutes, 0); if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + 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_int:$call_minutes_int</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_seconds = $total_sec; +$call_hours = ($call_seconds / 3600); +$call_hours_int = round($call_hours, 2); +$call_hours_int = intval("$call_hours_int"); +$call_minutes = ($call_hours - $call_hours_int); +$call_minutes = ($call_minutes * 60); +$call_minutes_int = round($call_minutes, 0); +if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + echo "<tr><td><font size=2>GESAMTANRUFE</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; echo "</TABLE></center>\n"; + + +##### Login and Logout time from vicidial agent interface ##### + echo "<br><br>\n"; echo "<center>\n"; -echo "<B>LOGIN/LOGOUT ZEIT:</B>\n"; +echo "<B>VICIDIAL MITTELLOGIN/LOGOUT ZEIT:</B>\n"; echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n"; @@ -215,8 +298,8 @@ echo "<tr><td><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td $event_seconds = ($event_stop_seconds - $event_start_seconds); $total_login_time = ($total_login_time + $event_seconds); $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); + $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); @@ -245,8 +328,8 @@ echo "<tr><td><font size=2>FALL </td><td align=right><font size=2>DATUM</td><td } $total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); $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); @@ -255,18 +338,152 @@ if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_mi echo "<tr><td><font size=2>GESAMTMENGE</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_int:$total_login_minutes_int</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 LOGIN/LOGOUT ZEIT:</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>FALL </td><td align=right><font size=2>DATUM</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:MINUTES</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 = ($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><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_int:$event_minutes_int"; + 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 = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); +$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";} + + 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_int:$total_login_minutes_int </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> KAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n"; + + $stmt="select * 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 "</tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound calls for this time period ##### + echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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> KAMPAGNE</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></tr>\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> KAMPAGNE</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 * 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); @@ -290,18 +507,20 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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></center><BR><BR>\n"; +echo "</TABLE><BR><BR>\n"; +##### vicidial agent inbound calls for this time period ##### -echo "<B>CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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> KAMPAGNE</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\n"; +echo "<B>INBOUND/CLOSER 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> KAMPAGNE</td><td align=right><font size=2> WAIT (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 * 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); @@ -325,7 +544,8 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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[17] </td></tr>\n"; } @@ -333,7 +553,7 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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"; @@ -353,6 +573,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$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 @@ -375,7 +619,45 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon } -echo "</TABLE></center>\n"; +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound user manual calls for this time period ##### + +echo "<B>MANUAL OUTBOUND 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"); diff --git a/LANG_www/vicidial_de/user_status.php b/LANG_www/vicidial_de/user_status.php index cfd46c20..0e984192 100644 --- a/LANG_www/vicidial_de/user_status.php +++ b/LANG_www/vicidial_de/user_status.php @@ -1,11 +1,15 @@ <? -### user_status.php -### -### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# 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 # header ("Content-type: text/html; charset=utf-8"); @@ -16,7 +20,7 @@ $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"];} + 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"];} @@ -25,21 +29,43 @@ 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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"); +$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]; @@ -61,18 +87,27 @@ $browser = getenv("HTTP_USER_AGENT"); if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $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]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $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 { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } } $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; @@ -99,6 +134,19 @@ $browser = getenv("HTTP_USER_AGENT"); $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 * from vicidial_campaigns;"; @@ -118,14 +166,35 @@ while ($i < $groups_to_print) ?> <html> <head> -<title>VICIDIAL ADMIN: User Status + +VICIDIAL ADMIN: User Status <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=<? echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> @@ -134,43 +203,216 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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") -{ + { $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; $rslt=mysql_query($stmt, $link); echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<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='Timeclock 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='User login time: $last_action_sec|Timeclock 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 "<PRE>"; - echo "Agent Logged in at server: $Aserver_ip\n"; - echo " in session: $Asession_id\n"; - echo " from phone: $Aextension\n"; - echo "Agent is in campaign: $Acampaign\n"; - echo " status: $Astatus\n"; - echo " hungup last call at: $Alast_call\n"; - echo " Closer groups: $Acl_campaigns\n\n"; + { + echo "<BR>\n"; + echo "$user - $full_name \n"; + echo "       GROUP: $user_group <BR>\n"; - echo "</PRE>"; + 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"; + 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 Kampagne: <SELECT SIZE=1 NAME=group>\n"; @@ -182,29 +424,56 @@ if ($agents_to_print > 0) $o++; } echo "</SELECT>\n"; - echo "<input type=submit name=submit value=CHANGE><BR></form>\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 MITTELOUT\"><BR></form>\n"; + } } -} else -{ - echo "Agent is not logged in\n<BR>"; + { + echo "Agent is not logged in to VICIDIAL\n<BR>"; + } -} +echo "\n<BR>"; + +if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) + { + echo "User $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 "User $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"; + } -echo "           $user - $full_name \n"; -echo "       GROUP: $user_group <BR><BR>\n"; - +$REPORTdate = date("Y-m-d"); +echo "<center>\n"; echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">User-Statistiken</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Ändern Sie Benutzer</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">User multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; @@ -212,7 +481,7 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; $ENDtime = date("U"); -$RUNtime = ($ENDtime - $STARTtime); +$RUNtime = ($ENDtime - $StarTtimE); echo "\n\n\n<br><br><br>\n\n"; @@ -236,7 +505,3 @@ exit; ?> - - - - diff --git a/LANG_www/vicidial_de/vdremote.php b/LANG_www/vicidial_de/vdremote.php index 58bcd035..011b3c44 100644 --- a/LANG_www/vicidial_de/vdremote.php +++ b/LANG_www/vicidial_de/vdremote.php @@ -1,7 +1,10 @@ <? # vdremote.php # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# make sure you have added a user to the vicidial_users MySQL table with at +# least user_level 4 to access this page the first time +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -9,7 +12,6 @@ # 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 # -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time $version = '1.1.12'; $build = '60619-1603'; diff --git a/LANG_www/vicidial_de/vicidial_admin_web_logo.gif b/LANG_www/vicidial_de/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/LANG_www/vicidial_de/vicidial_admin_web_logo.gif differ diff --git a/LANG_www/vicidial_de/vicidial_admin_web_logo_small.gif b/LANG_www/vicidial_de/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/LANG_www/vicidial_de/vicidial_admin_web_logo_small.gif differ diff --git a/LANG_www/vicidial_de/vicidial_sales_viewer.php b/LANG_www/vicidial_de/vicidial_sales_viewer.php new file mode 100644 index 00000000..5f065511 --- /dev/null +++ b/LANG_www/vicidial_de/vicidial_sales_viewer.php @@ -0,0 +1,236 @@ +<? header("Pragma: no-cache"); +# +# vicidial_sales_viewer.php - VICIDIAL administration page +# +# +# Copyright (C) 2009 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# + +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"];} + +?> +<html> +<head> +<title>VICIDIAL recent sales lookup + + + + + +
"; +?> + +
+ + + + + + + + + + + + + + + + + + + + + +
Vicidial OUTBOUND recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a VICIDIAL 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)
Kampagne 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/LANG_www/vicidial_de/vtiger_search.php b/LANG_www/vicidial_de/vtiger_search.php new file mode 100644 index 00000000..5e9c9761 --- /dev/null +++ b/LANG_www/vicidial_de/vtiger_search.php @@ -0,0 +1,788 @@ + 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 +# +# 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 +# + +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 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]; + } +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; + +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;} + + + + + +########################################################################## +##### 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 + { + 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) + { + 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]; + + 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/LANG_www/vicidial_de/vtiger_user.php b/LANG_www/vicidial_de/vtiger_user.php new file mode 100644 index 00000000..695c1622 --- /dev/null +++ b/LANG_www/vicidial_de/vtiger_user.php @@ -0,0 +1,316 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# + +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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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/LANG_www/vicidial_de/welcome.php b/LANG_www/vicidial_de/welcome.php index d4f31e18..015aac6f 100644 --- a/LANG_www/vicidial_de/welcome.php +++ b/LANG_www/vicidial_de/welcome.php @@ -1,20 +1,21 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # echo "VICIDIAL Willkommen\n"; echo "\n"; echo "\n"; -echo "




"; +echo "




"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "
Willkommen
 
Agent Login
 
Timeclock
 
Administration
 
\n"; diff --git a/LANG_www/vicidial_de/welcome_demo.php b/LANG_www/vicidial_de/welcome_demo.php new file mode 100644 index 00000000..49c0e470 --- /dev/null +++ b/LANG_www/vicidial_de/welcome_demo.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_de/welcome_languages.php b/LANG_www/vicidial_de/welcome_languages.php new file mode 100644 index 00000000..a89bbfcb --- /dev/null +++ b/LANG_www/vicidial_de/welcome_languages.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_el/AST_CLOSER_service_level.php b/LANG_www/vicidial_el/AST_CLOSER_service_level.php new file mode 100644 index 00000000..e79f8ec8 --- /dev/null +++ b/LANG_www/vicidial_el/AST_CLOSER_service_level.php @@ -0,0 +1,956 @@ + 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 +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +$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); +$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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 from vicidial_inbound_groups;"; +$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++; + } +?> + + + + + +\n"; +echo "VICIDIAL: VDAD Closer Service Level Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\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 "VICIDIAL: Closer Service-Level Stats                      $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 "---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE ΑΠΑΝΤΗΣΗ (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/LANG_www/vicidial_el/AST_CLOSERstats.php b/LANG_www/vicidial_el/AST_CLOSERstats.php index b10caf49..b04d7633 100644 --- a/LANG_www/vicidial_el/AST_CLOSERstats.php +++ b/LANG_www/vicidial_el/AST_CLOSERstats.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_CLOSERstats.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat @@ -10,6 +10,16 @@ # 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 # require("dbconnect.php"); @@ -20,24 +30,58 @@ $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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +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';} - $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); +############################################# +##### 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); - $auth=$row[0]; + $non_latin = $row[0]; + $i++; + } +##### 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); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = ($local_gmt * 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)) { @@ -52,16 +96,56 @@ $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 from vicidial_inbound_groups;"; $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); - $groups[$i] =$row[0]; + $LISTgroups[$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("--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++; } ?> @@ -79,36 +163,80 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: Στατιστικά VDAD Closer\n"; +echo "VICIDIAL: Στατιστικά VDAD Closer\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 "Χρονικό διάστημα:
\n"; echo "\n"; -echo "\n"; +echo "
\n"; +echo "Εισερχόμενες Ομάδες: \n"; +echo "\n"; +echo "\n"; -echo "\n"; +echo "           "; +echo "ΤΡΟΠΟΠΟΙΗΣΗ | "; +echo "ΑΝΑΦΟΡΕΣ | "; +echo "IVR REPORT \n"; +echo "\n"; + +echo "
\n"; + +#echo "\n"; +echo "Shift: \n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +echo "   \n"; +echo "
\n"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if ($groups_to_print < 1)
 {
 echo "\n\n";
-echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙΑ ΗΜΕΡΟΜΗΝΙΑ ΑΝΩΤΕΡΩ, ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
+echo "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
 }
 
 else
@@ -133,38 +261,124 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
-echo "VICIDIAL: Στατιστικά αυτόματης κλήσης Closer                      $NOW_TIME\n";
+echo "VICIDIAL: Στατιστικά αυτόματης κλήσης Closer: $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='" . mysql_real_escape_string($group) . "';";
+$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');";
+$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]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+$IVRcalls =	sprintf("%10s", $rowx[0]);
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
+	{$average_call_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);
+	$average_call_seconds = ($TOTALsec / $row[0]);
+	$average_call_seconds = round($average_call_seconds, 0);
+	$average_call_seconds =	sprintf("%10s", $average_call_seconds);
+	}
+$ΑΠΑΝΤΗΣΗEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($ΑΠΑΝΤΗΣΗEDcalls < 1) or ($TOTALcalls < 1) )
+	{$ΑΠΑΝΤΗΣΗEDpercent = '0';}
+else
+	{
+	$ΑΠΑΝΤΗΣΗEDpercent = (($ΑΠΑΝΤΗΣΗEDcalls / $TOTALcalls) * 100);
+	$ΑΠΑΝΤΗΣΗEDpercent = round($ΑΠΑΝΤΗΣΗEDpercent, 0);
+	}
+if ( ($rowy[0] < 1) or ($ΑΠΑΝΤΗΣΗEDcalls < 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 "Συνολικά κλήσεις που τοποθετήθηκαν από την Εκστρατεία: $TOTALcalls\n";
-echo "Average Call Length for all Calls:            $average_hold_seconds seconds\n";
+
+echo "Σύνολο κλήσεις που λαμβάνονται σε αυτό το In-Ομάδα:       $TOTALcalls\n";
+echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
+echo "Answered Calls:                               $ΑΠΑΝΤΗΣΗEDcalls  $ΑΠΑΝΤΗΣΗEDpercent%\n";
+echo "Average queue time for Answered Calls:        $average_answer_seconds seconds\n";
+echo "Calls taken into the IVR for this In-Ομάδα:  $IVRcalls\n";
+
 
 echo "\n";
 echo "---------- ΕΓΚΑΤΑΛ\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='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
+$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);
@@ -179,101 +393,111 @@ else
 	}
 
 if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+	{
+	$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 ( ($ΑΠΑΝΤΗΣΗEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_ΑΠΑΝΤΗΣΗEDpercent = '0';}
+else
+	{
+	$DROP_ΑΠΑΝΤΗΣΗEDpercent = (($DROPcalls / $ΑΠΑΝΤΗΣΗEDcalls) * 100);
+	$DROP_ΑΠΑΝΤΗΣΗEDpercent = round($DROP_ΑΠΑΝΤΗΣΗEDpercent, 0);
+	}
 
-echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls  $DROPpercent%\n";
+echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls  $DROPpercent%               drop/answered: $DROP_ΑΠΑΝΤΗΣΗEDpercent%\n";
 echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
 
 
 
-##############################
-#########  CALL STATUS STATS
 
-$TOTALcalls = 0;
+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;";
+	$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;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_two = $row[0];
+
+	if ( ($ΑΠΑΝΤΗΣΗEDcalls > 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 / $ΑΠΑΝΤΗΣΗEDcalls) * 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 / $ΑΠΑΝΤΗΣΗEDcalls) * 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 "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "---------- CUSTOM INDICATORS\n";
+echo "GDE (Answered/Συνολικές κλήσεις που διακομίστηκανin to this In-Group):  $ΑΠΑΝΤΗΣΗEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_ΑΠΑΝΤΗΣΗEDpercent%\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";
 
-$stmt="SELECT * from vicidial_statuses order by status";
-$rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
 
-$o=0;
-while ($statuses_to_print > $o) 
-	{
-	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="SELECT * from vicidial_campaign_statuses 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),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) . "' group by status;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+# 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);
-$i=0;
-while ($i < $statuses_to_print)
+$p=0;
+while ($p < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
-
-	$TOTALcalls = ($TOTALcalls + $row[0]);
-
-	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[1];
-	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}	
-		}
-	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');}	
-		}
-
-
-	echo "| $status | $status_name | $STATUScount |\n";
-
-	$i++;
+	$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++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
-
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
-
-
-
-
+##############################
+#########  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='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
+$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);
@@ -310,6 +534,563 @@ echo "Average QUEUE Length for queue calls:         $average_queue_seconds secon
 echo "Average QUEUE Length across all calls:        $average_total_queue_seconds seconds\n";
 
 
+
+##############################
+#########  CALL HOLD TIME BREAKDOWN IN SECONDS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ 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) 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 ΑΠΑΝΤΗΣΗED 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') 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 "---------- CALL HANGUP REASON STATS\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          | ΚΑΤΗΓΟΡΙΑ             | 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_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
+
+	$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_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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 ΚΑΤΗΓΟΡΙΑ STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| ΚΑΤΗΓΟΡΙΑ             | 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";
+
+
 ##############################
 #########  USER STATS
 
@@ -324,7 +1105,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| ΧΕΙΡΙΣΤΗΣ                   | CALLS      | TIME M   | AVRG M |\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='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+$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);
@@ -343,23 +1124,25 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$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";
+	$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
 	$USERtotTALK_MS =		sprintf("%8s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$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 = eregi_replace('-','',$USERavgTALK_MS);
 	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
 
 	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
@@ -367,22 +1150,25 @@ while ($i < $users_to_print)
 	$i++;
 	}
 
-if (!$TOTcalls) {$TOTcalls = 1;}
-$TOTavg = ($TOTtime / $TOTcalls);
-$TOTavg = round($TOTavg, 0);
-$TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
-$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
-$TOTavg_S = ($TOTavg_S * 60);
-$TOTavg_S = round($TOTavg_S, 0);
-if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
-$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
-$TOTavg =		sprintf("%6s", $TOTavg_MS);
+if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
+else
+	{
+	$TOTavg = ($TOTtime / $TOTcalls);
+	$TOTavg = round($TOTavg, 0);
+	$TOTavg_M = ($TOTavg / 60);
+	$TOTavg_M_int = round($TOTavg_M, 2);
+	$TOTavg_M_int = intval("$TOTavg_M_int");
+	$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
+	$TOTavg_S = ($TOTavg_S * 60);
+	$TOTavg_S = round($TOTavg_S, 0);
+	if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
+	$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	}
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -408,69 +1194,86 @@ echo "---------- ΣΤΑΤ.ΧΡΟΝ.\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",$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)
 	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
+	$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;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
+	$drop_count[$i] = $Fdrop[$i];
 	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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)
@@ -482,7 +1285,7 @@ else
 	}
 
 echo "\n";
-echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ ΠΟΥ ΤΟΠΟΘΕΤΟΥΝΤΑΙ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ\n";
+echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ TAKEN INTO THIS IN-GROUP\n";
 
 $k=1;
 $Mk=0;
@@ -597,13 +1400,99 @@ while ($i <= 96)
 	$h++;
 	}
 
-
 echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
 
 
 
 
 
+
+##### Answered wait time breakdown
+echo "\n";
+echo "---------- CALL ΑΠΑΝΤΗΣΗED 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";
@@ -611,7 +1500,9 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 
 
+
 ?>
 
+
- \ No newline at end of file + diff --git a/LANG_www/vicidial_el/AST_IVRfilter.php b/LANG_www/vicidial_el/AST_IVRfilter.php new file mode 100644 index 00000000..4d15a96e --- /dev/null +++ b/LANG_www/vicidial_el/AST_IVRfilter.php @@ -0,0 +1,248 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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 "Χρονικό διάστημα:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "ΑΝΑΦΟΡΕΣ\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 "| ΚΑΤΗΓΟΡΙΑ             | 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='Εισερχόμενα_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='Εισερχόμενα_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='Εισερχόμενα_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='Εισερχόμενα_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='Εισερχόμενα_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 ΧΕΙΡΙΣΤΗΣ  | $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/LANG_www/vicidial_el/AST_IVRstats.php b/LANG_www/vicidial_el/AST_IVRstats.php new file mode 100644 index 00000000..ffcaf04e --- /dev/null +++ b/LANG_www/vicidial_el/AST_IVRstats.php @@ -0,0 +1,684 @@ + 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 +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +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); +$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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 from vicidial_inbound_groups;"; +$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++; + } + +$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 "VICIDIAL: IVR 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 "Χρονικό διάστημα:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "Εισερχόμενες Ομάδες: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ΤΡΟΠΟΠΟΙΗΣΗ | "; +echo "ΑΝΑΦΟΡΕΣ | "; +echo "ΑΝΑΦΟΡΑ CLOSER \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 "Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ\n";
+}
+
+else
+{
+
+
+echo "VICIDIAL: IVR Stats: $group_string          $NOW_TIME\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 CALLS 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 "---------- ΣΤΑΤ.ΧΡΟΝ.\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 "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ 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/LANG_www/vicidial_el/AST_VDADstats.php b/LANG_www/vicidial_el/AST_VDADstats.php index d37410dd..5ae95cd0 100644 --- a/LANG_www/vicidial_el/AST_VDADstats.php +++ b/LANG_www/vicidial_el/AST_VDADstats.php @@ -1,14 +1,22 @@ LICENSE: GPLv2 -### -# CHANGES +# AST_VDADstats.php +# +# Copyright (C) 2009 Matt Florell 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 # header ("Content-type: text/html; charset=utf-8"); @@ -18,27 +26,51 @@ 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["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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} $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); +############################################# +##### 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); - $auth=$row[0]; + $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)) { @@ -53,18 +85,52 @@ $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";} -$groups_to_print = mysql_num_rows($rslt); +$campaigns_to_print = mysql_num_rows($rslt); $i=0; -while ($i < $groups_to_print) +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_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_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++; + } ?> @@ -80,33 +146,62 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: VDAD Stats\n"; +echo "VICIDIAL: VDAD Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + echo "
\n"; +echo "
Ημερομηνίες:
"; +echo "\n"; +echo "\n"; echo "\n"; -echo "\n"; +echo "
Εκστρατείες:
"; +echo "\n"; +echo "
Shift:
"; echo "\n"; +echo "

\n"; echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " ΤΡΟΠΟΠΟΙΗΣΗ | \n"; + echo " ΑΝΑΦΟΡΕΣ \n"; + } +else + { + echo " CAMPAIGNS | \n"; + echo " ΑΝΑΦΟΡΕΣ \n"; + } +echo "
"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if (strlen($group[0]) < 1)
 {
 echo "\n\n";
 echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙΑ ΗΜΕΡΟΜΗΝΙΑ ΑΝΩΤΕΡΩ, ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
@@ -134,7 +229,7 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
@@ -144,27 +239,29 @@ 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_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 
 $TOTALcalls =	sprintf("%10s", $row[0]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
 	{$average_hold_seconds = '         0';}
 else
 	{
-	$average_hold_seconds = ($row[1] / $row[0]);
+	$average_hold_seconds = ($TOTALsec / $row[0]);
 	$average_hold_seconds = round($average_hold_seconds, 2);
 	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
 	}
 echo "Συνολικά κλήσεις που τοποθετήθηκαν από την Εκστρατεία: $TOTALcalls\n";
 echo "Μέσος όρος σε δευτερόλεπτα για όλες τις κλήσεις: $average_hold_seconds\n";
 
+
 echo "\n";
 echo "---------- ΕΓΚΑΤΑΛ\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -172,11 +269,56 @@ $DROPcalls =	sprintf("%10s", $row[0]);
 $DROPcallsRAW =	$row[0];
 $DROPseconds =	$row[1];
 
-$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');";
+
+# 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]";
+	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) {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]";
+	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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
-$ANSWERcalls =	$row[0];
+$ΑΠΑΝΤΗΣΗcalls =	$row[0];
 
 if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
 	{$DROPpercent = '0';}
@@ -186,12 +328,12 @@ else
 	$DROPpercent = round($DROPpercent, 2);
 	}
 
-if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
-	{$DROPANSWERpercent = '0';}
+if ( ($DROPcalls < 1) or ($ΑΠΑΝΤΗΣΗcalls < 1) )
+	{$DROPΑΠΑΝΤΗΣΗpercent = '0';}
 else
 	{
-	$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
-	$DROPANSWERpercent = round($DROPANSWERpercent, 2);
+	$DROPΑΠΑΝΤΗΣΗpercent = (($DROPcallsRAW / $ΑΠΑΝΤΗΣΗcalls) * 100);
+	$DROPΑΠΑΝΤΗΣΗpercent = round($DROPΑΠΑΝΤΗΣΗpercent, 2);
 	}
 
 if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
@@ -204,13 +346,56 @@ else
 	}
 
 echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls  $DROPpercent%\n";
-echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ANSWERcalls  $DROPANSWERpercent%\n";
+echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ΑΠΑΝΤΗΣΗcalls  $DROPΑΠΑΝΤΗΣΗpercent%\n";
 echo "Μέσος όρος σε δευτερόλεπτα για ΕΓΚΑΤΑΕΙΜΕΝΕΣ κλήσεις: $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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$TOTALanswers = ($row[0] + $ΑΠΑΝΤΗΣΗcalls);
+
+
+$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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$agent_non_pause_sec = $row[0];
+
+if ($agent_non_pause_sec > 0)
+	{
+	$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+	$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = round($AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec, 2);
+	}
+else
+	{$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec=0;}
+$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = sprintf("%10s", $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec);
+
+echo "Productivity Rating:                          $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec\n";
+
+
+
+
 echo "\n";
 echo "---------- ΜΗ ΑΠΑΝΤ ΑΥΤ ΚΛΗΣΕΙΣ\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
+$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','B') and (length_in_sec <= 60 or length_in_sec is null);";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -237,6 +422,49 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls  $NApercent%\n";
 echo "Μέσος όρος σε δευτερόλεπτα για ΝΑ κλήσεις: $average_na_seconds\n";
 
 
+##############################
+#########  CALL HANGUP REASON STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CALL HANGUP REASON STATS\n";
+echo "+----------------------+------------+\n";
+echo "| HANGUP REASON        | CALLS      |\n";
+echo "+----------------------+------------+\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) {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 ΑΠΑΝΤΗΣΗ           ';}
+	if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
+
+	echo "| $reason | $REASONcount |\n";
+
+	$i++;
+	}
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "+----------------------+------------+\n";
+echo "| TOTAL:               | $TOTALcalls |\n";
+echo "+----------------------+------------+\n";
+
+
+
+
+
 ##############################
 #########  CALL STATUS STATS
 
@@ -244,36 +472,25 @@ $TOTALcalls = 0;
 
 echo "\n";
 echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
+echo "|        |                      |                      |            |      CALL TIME                   |ΧΕΙΡΙΣΤΗΣTIME|\n";
+echo "| STATUS | DESCRIPTION          | ΚΑΤΗΓΟΡΙΑ             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
 
-$stmt="SELECT * from vicidial_statuses order by status";
+
+## 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' $group_SQLand and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
 $rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
-
-$o=0;
-while ($statuses_to_print > $o) 
+$Ctally_to_print = mysql_num_rows($rslt);
+if ($Ctally_to_print > 0) 
 	{
 	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
+	$AGENTsec = "$rowx[0]";
 	}
 
-$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+## get counts and time totals for all statuses in this campaign
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END'  $group_SQLand group by status;";
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -283,34 +500,180 @@ while ($i < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
 
-	$TOTALcalls = ($TOTALcalls + $row[0]);
+	$STATUScount =	$row[0];
+	$RAWstatus =	$row[1];
+	$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 + $row[0]);
+	$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );
+		$STATUSrate =	sprintf("%.2f", $STATUSrate);
+	$AGENTrate =	($STATUScount / ($AGENTsec / 3600) );
+		$AGENTrate =	sprintf("%.2f", $AGENTrate);
+
+	$STATUShours_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
 
 	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[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);}
+	$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);}	
+		$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');}	
+		$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 | $STATUScount |\n";
+	echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
 
 	$i++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+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_H =	($AGENTsec / 3600);
+	$aTOTALhours_H_int = round($aTOTALhours_H, 2);
+	$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
+	$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
+	$aTOTALhours_M = ($aTOTALhours_M * 60);
+	$aTOTALhours_M_int = round($aTOTALhours_M, 2);
+	$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
+	$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
+	$aTOTALhours_S = ($aTOTALhours_S * 60);
+	$aTOTALhours_S = round($aTOTALhours_S, 0);
+	if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
+	if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
+	$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
+
+	$TOTALhours_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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);}
+
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+echo "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |          |\n";
+echo "|   ΧΕΙΡΙΣΤΗΣTIME                                                      | $aTOTALhours |                     | $aTOTALrate |\n";
+echo "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
+
+
+
+##############################
+#########  STATUS CATEGORY STATS
+
+echo "\n";
+echo "---------- CUSTOM STATUS ΚΑΤΗΓΟΡΙΑ STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| ΚΑΤΗΓΟΡΙΑ             | 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";
 
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
 
 
 ##############################
@@ -327,7 +690,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| ΧΕΙΡΙΣΤΗΣ                   | CALLS      | TIME M   | AVRG M |\n";
 echo "+--------------------------+------------+----------+--------+\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' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
+$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) {echo "$stmt\n";}
@@ -354,8 +717,8 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
 	$USERtotTALK_S = ($USERtotTALK_S * 60);
 	$USERtotTALK_S = round($USERtotTALK_S, 0);
@@ -364,8 +727,8 @@ while ($i < $users_to_print)
 	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
 	$USERavgTALK_S = ($USERavgTALK_S * 60);
 	$USERavgTALK_S = round($USERavgTALK_S, 0);
@@ -382,8 +745,8 @@ if (!$TOTcalls) {$TOTcalls = 1;}
 $TOTavg = ($TOTtime / $TOTcalls);
 $TOTavg = round($TOTavg, 0);
 $TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
+$TOTavg_M_int = round($TOTavg_M, 2);
+$TOTavg_M_int = intval("$TOTavg_M_int");
 $TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
 $TOTavg_S = ($TOTavg_S * 60);
 $TOTavg_S = round($TOTavg_S, 0);
@@ -392,8 +755,8 @@ $TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
 $TOTavg =		sprintf("%6s", $TOTavg_MS);
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -406,15 +769,15 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {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_M_int = round($AVGwait_M, 2);
+$AVGwait_M_int = intval("$AVGwait_M_int");
 $AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
 $AVGwait_S = ($AVGwait_S * 60);
 $AVGwait_S = round($AVGwait_S, 0);
@@ -442,14 +805,14 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -457,42 +820,42 @@ while ($i <= 96)
 	$i++;
 
 
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -643,5 +1006,6 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php index 538d8534..48b6a798 100644 --- a/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_VICIDIAL_hopperlist.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat @@ -126,7 +126,7 @@ echo "Αριθμός οδηγών στον hopper τώρα:: $TOTALcalls\n echo "\n"; echo "---------- LEADS IN HOPPER\n"; echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -echo "|ORDER |PRIORITY| LEAD ID | ID ΛΙΣΤΑΣ | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "|ORDER |ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ| LEAD ID | ID ΛΙΣΤΑΣ | 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.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; diff --git a/LANG_www/vicidial_el/AST_admin_log_display.php b/LANG_www/vicidial_el/AST_admin_log_display.php index a26ee60f..923954a8 100644 --- a/LANG_www/vicidial_el/AST_admin_log_display.php +++ b/LANG_www/vicidial_el/AST_admin_log_display.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_admin_log_display.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); diff --git a/LANG_www/vicidial_el/AST_agent_days_detail.php b/LANG_www/vicidial_el/AST_agent_days_detail.php new file mode 100644 index 00000000..857ddb11 --- /dev/null +++ b/LANG_www/vicidial_el/AST_agent_days_detail.php @@ -0,0 +1,601 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-2202 - First build +# 90225-1051 - Added CSV download option +# 90310-0752 - Added admin header +# + + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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 "VICIDIAL: Agent Ημέρες Status\n"; + echo ""; + + $short_header=1; + + require("admin_header.php"); + + echo "\n"; + echo "\n"; + echo "
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo "ΠΑΡΑΚΑΛΟΥΜΕ ΕΠΙΛΕΞΤΕ ΧΡΗΣΤΗ ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ-ΩΡΑ ΚΑΙ ΑΝΩ ΚΛΙΚ ΕΠΙΒΕΒΑΙΩΣΗ\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 "VICIDIAL: Agent Days Λεπτομέρειες: $user                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Days Λεπτομέρειες: $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 "CALL 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Ημερομηνίες:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Εκστρατείες:
"; +echo "\n"; +echo "
Χρήστης:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " ΛΗΨΗ | \n"; + echo " USER | \n"; + echo " USER STATS | \n"; + } +else + {echo " ΧΡΗΣΤΕΣ | \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) * 120 );
+		$h=0;
+		while ($h <= $TOPsortPLOT)
+			{
+			echo " ";
+			$h++;
+			}
+		echo "\n";
+		}
+	$m++;
+	}
+
+echo "\n";
+
+?>
+
+
diff --git a/LANG_www/vicidial_el/AST_agent_performance.php b/LANG_www/vicidial_el/AST_agent_performance.php
index 0d3690c9..e2436508 100644
--- a/LANG_www/vicidial_el/AST_agent_performance.php
+++ b/LANG_www/vicidial_el/AST_agent_performance.php
@@ -1,8 +1,8 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance.php
+# 
+# Copyright (C) 2008  Matt Florell     LICENSE: AGPLv2
+#
 # CHANGES
 #
 # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
@@ -127,7 +127,7 @@ if ($shift == 'PM')
 echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
+echo "---------- AGENTS Λεπτομέρειεςs -------------\n\n";
 
 echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
diff --git a/LANG_www/vicidial_el/AST_agent_performance_detail.php b/LANG_www/vicidial_el/AST_agent_performance_detail.php
index 0bbb9d35..bae61cd2 100644
--- a/LANG_www/vicidial_el/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_el/AST_agent_performance_detail.php
@@ -1,13 +1,21 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance_detail.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,28 +25,53 @@ $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["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
+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["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
-if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))	{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+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["ΕΠΙΒΕΒΑΙΩΣΗ"]))					{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+
 
 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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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];
+$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))
 	{
@@ -48,14 +81,15 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     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;";
-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);
@@ -67,7 +101,6 @@ while ($i < $campaigns_to_print)
 	$i++;
 	}
 $stmt="select user_group from vicidial_user_groups;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $user_groups_to_print = mysql_num_rows($rslt);
@@ -93,9 +126,18 @@ while ($i < $user_groups_to_print)
 
 \n";
-echo "VICIDIAL: Agent Performance\n";
+echo "VICIDIAL: Agent Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + echo "
\n"; -echo "\n"; +echo "\n"; +echo "\n"; +echo " to \n"; echo "
+ \ No newline at end of file diff --git a/LANG_www/vicidial_el/AST_agent_status_detail.php b/LANG_www/vicidial_el/AST_agent_status_detail.php new file mode 100644 index 00000000..ca8c15dd --- /dev/null +++ b/LANG_www/vicidial_el/AST_agent_status_detail.php @@ -0,0 +1,665 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# + + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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++; + } +$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 + { + $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 "VICIDIAL: Agent Ημέρες Status\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 "Επιλέξτε μια καμπάνια ή ομάδα χρηστών ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK ΕΠΙΒΕΒΑΙΩΣΗ\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 "VICIDIAL: Agent Status Λεπτομέρειες                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- ΧΕΙΡΙΣΤΗΣΛεπτομέρειεςs -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Status Λεπτομέρειες                     $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) )
+			{
+			$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 "CALL 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=$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 ( ($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 |";
+				}
+			### 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Ημερομηνίες:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Εκστρατείες:
"; +echo "\n"; +echo "
Ομάδες Χρήστη:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " ΛΗΨΗ | \n"; +echo " ΑΝΑΦΟΡΕΣ \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/LANG_www/vicidial_el/AST_agent_time_sheet.php b/LANG_www/vicidial_el/AST_agent_time_sheet.php
index 00985781..75c4cbb0 100644
--- a/LANG_www/vicidial_el/AST_agent_time_sheet.php
+++ b/LANG_www/vicidial_el/AST_agent_time_sheet.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
-###
+# AST_agent_time_sheet.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,13 +19,15 @@ $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"];}
+	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"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))	{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+
+$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);
@@ -62,15 +66,36 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 \n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "ΔΙΑΧΕΙΡΙΣΗ: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Τροποποίηση Χρήστη\n";
+echo "VICIDIAL: Agent Ώρα Φύλλο";
+
+
+##### 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 "AgentΏρα Φύλλοfor: $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 "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
+echo "Χρήστης ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
 echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n";
 echo "</FORM>\n\n";
 
@@ -97,7 +122,7 @@ if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $full_name = $row[0];
 
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
+echo "VICIDIAL: AgentΏρα Φύλλο                            $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- ΧΕΙΡΙΣΤΗΣTIME SHEET: $agent - $full_name -------------\n\n";
@@ -277,6 +302,104 @@ $login_time = ($end - $start);
 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  ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</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 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</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 = ($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><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_int:$event_minutes_int";
+			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 = ($total_login_time / 3600);
+$total_login_hours_int = round($total_login_hours, 2);
+$total_login_hours_int = intval("$total_login_hours_int");
+$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";}
+
+	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_int:$total_login_minutes_int  </td></tr>\n";
+
+echo "</TABLE>\n";
+
+
+
 }
 
 
diff --git a/LANG_www/vicidial_el/AST_inboundEXTstats.php b/LANG_www/vicidial_el/AST_inboundEXTstats.php
index 0181b547..77d6f8e4 100644
--- a/LANG_www/vicidial_el/AST_inboundEXTstats.php
+++ b/LANG_www/vicidial_el/AST_inboundEXTstats.php
@@ -1,7 +1,7 @@
 <? 
 # AST_inboundEXTstats.php
 # 
-# Copyright (C) 2006  Matt Florell <vicidial@gmail.com>    LICENSE: GPLv2
+# Copyright (C) 2008  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
 #
 # CHANGES
 # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
@@ -76,7 +76,7 @@ while ($i < $inbound_to_print)
  </STYLE>
 
 <? 
-echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
+echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
 #echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
 echo "<TITLE>ASTERISK: Στατιστικά Εισερχομένων Κλήσεων\n";
 echo "
\n"; diff --git a/LANG_www/vicidial_el/AST_server_performance.php b/LANG_www/vicidial_el/AST_server_performance.php index 01c91c40..3d371111 100644 --- a/LANG_www/vicidial_el/AST_server_performance.php +++ b/LANG_www/vicidial_el/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - 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 # require("dbconnect.php"); @@ -16,8 +18,6 @@ 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["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"];} @@ -54,9 +54,8 @@ $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($begin_query_time)) {$begin_query_time = '09:00:00';} -if (!isset($end_query_time)) {$end_query_time = '15:30:00';} +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;"; @@ -85,11 +84,18 @@ while ($i < $servers_to_print) \n"; -echo "VICIDIAL: Server Performance\n"; +echo "VICIDIAL: Server Performance\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + + echo "\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; +echo "Date/Time Range: \n"; +echo "to \n"; echo "Server:
+ \ No newline at end of file diff --git a/LANG_www/vicidial_el/AST_timeonVDAD.php b/LANG_www/vicidial_el/AST_timeonVDAD.php index a0f5f64d..11bf3ae8 100644 --- a/LANG_www/vicidial_el/AST_timeonVDAD.php +++ b/LANG_www/vicidial_el/AST_timeonVDAD.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonVDAD.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # live real-time stats for the VICIDIAL Auto-Dialer # # CHANGES @@ -10,6 +10,9 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -110,8 +113,15 @@ if ($closer_display>0) \n"; echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
+echo "VICIDIAL: Time On VDAD\n";
+
+$short_header=1;
+
+require("admin_header.php");
+
+echo "
"; + +echo "
";
 
 ###################################################################################
 ###### SERVER INFORMATION
@@ -137,15 +147,15 @@ echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    0)
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 }
 else
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+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;";
@@ -158,18 +168,77 @@ $talking_to_print = mysql_num_rows($rslt);
 	while ($i < $talking_to_print)
 		{
 		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
+		$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])) 
 			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('R/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
 			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
+		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", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
+		$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) )
 			{
@@ -177,8 +246,8 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cc[$i]++;
 			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
 			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
+		$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) )
 			{
@@ -186,10 +255,10 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cd[$i]++;
 			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
 			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
+		$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);
@@ -206,7 +275,7 @@ $talking_to_print = mysql_num_rows($rslt);
 			$G = '';		$EG = '';
 			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
+			if (eregi("PAUSED",$Sstatus[$i])) 
 				{
 				if ($call_time_M_int >= 1) 
 					{$i++; continue;} 
@@ -214,7 +283,7 @@ $talking_to_print = mysql_num_rows($rslt);
 					{$G=''; $EG='';}
 				}
 			$agentcount++;
-			echo "| $G$extension[$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";
+			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++;
 		}
@@ -259,18 +328,18 @@ $talking_to_print = mysql_num_rows($rslt);
 		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
 
-			echo "| $G$extension[$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";
+			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 "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 		echo "  $i Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n";
 	#	echo "             - 5 λεπτά ή παραπάνω σε κλήση\n";
 	#	echo "             - Πάνω από 10 λεπτά σε κλήση\n";
 		}
 	else
 		{
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
 		echo "  $agentcount Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n";
 
 		echo "             - Χειριστές σε παύση\n";
@@ -370,5 +439,6 @@ $parked_to_print = mysql_num_rows($rslt);
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_el/AST_timeonVDADall.php b/LANG_www/vicidial_el/AST_timeonVDADall.php index 808205af..69e911db 100644 --- a/LANG_www/vicidial_el/AST_timeonVDADall.php +++ b/LANG_www/vicidial_el/AST_timeonVDADall.php @@ -1,826 +1,1662 @@ - LICENSE: GPLv2 -# -# 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 (Chris Doyle) -# 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 -# - -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["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} -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($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} -if (!isset($usergroup)) {$usergroup='';} -if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes -if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name -if (!isset($orderby)) {$orderby='timeup';} -if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes - -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]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $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); - - -$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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++; - } - -$stmt="select * from vicidial_user_groups;"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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=''; - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Εκστρατεία: $group\n"; -echo "\n"; -echo "VICIDIAL Εκστρατεία: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -if ($UGdisplay > 0) - { - echo "\n"; - } -echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; -echo "SUMMARY | \n"; -echo "ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $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) from vicidial_campaigns;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select count(*) from vicidial_hopper;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="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),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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 LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "
"; - -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -if ($UGdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ USER GROUP"; - } -else - { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       ΕΜΦΑΝΙΣΗ ΧΕΙΡΙΣΤΗΣID"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ ΧΕΙΡΙΣΤΗΣNAME"; - } -if ($SERVdisplay>0) - { - echo "       ΑΠΟΚΡΥΨΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; - } -else - { - echo "       ΕΜΦΑΝΙΣΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; - } -echo "
"; - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if ($campaign_allow_inbound > 0) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} - $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;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - 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"; - } - else - { - echo "ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Εκστρατεία: $group $NOW_TIME\n\n"; - - -$HDbegin = "+"; -$HTbegin = "|"; -$HDstation = "------------+"; -$HTstation = " STATION |"; -$HDuser = "--------------------+"; -$HTuser = " USER |"; -$HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; -$HDsessionid = "------------------+"; -$HTsessionid = " SESSIONID |"; -$HDbarge = "-------+"; -$HTbarge = " BARGE |"; -$HDstatus = "----------+"; -$HTstatus = " STATUS |"; -$HDserver_ip = "-----------------+"; -$HTserver_ip = " ΔΙΑΚΟΜΙΣΤΗΣ IP |"; -$HDcall_server_ip = "-----------------+"; -$HTcall_server_ip = " CALL ΔΙΑΚΟΜΙΣΤΗΣ IP |"; -$HDtime = "---------+"; -$HTtime = " MM:SS |"; -$HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; - -if ($UGdisplay < 1) - { - $HDusergroup = ''; - $HTusergroup = ''; - } -if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) - { - $HDsessionid = "-----------+"; - $HTsessionid = " SESSIONID |"; - } -if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) - { - $HDbarge = ''; - $HTbarge = ''; - } -if ($SERVdisplay < 1) - { - $HDserver_ip = ''; - $HTserver_ip = ''; - $HDcall_server_ip = ''; - $HTcall_server_ip = ''; - } - - - -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; -$Aecho .= "$Aline"; -$Aecho .= "$Bline"; -$Aecho .= "$Aline"; - -if ($orderby=='timeup') {$orderSQL='status,last_call_time';} -if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} -if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';} -if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';} -if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';} -if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time 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 ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} -if (strlen($usergroup)<1) {$usergroupSQL = '';} -else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} - -$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - -#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;"; - -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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]; - } - if ($non_latin < 1) - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - } - else - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-40s", $extension); - while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} - } - $Luser = $row[1]; - $user = sprintf("%-18s", $row[1]); - $Lsessionid = $row[2]; - $sessionid = sprintf("%-9s", $row[2]); - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $comments= $row[11]; - - if (eregi("INCALL",$Lstatus)) - { - if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) - {$CM='A';} - else - { - if (eregi("INBOUND",$comments)) - {$CM='I';} - else - {$CM='M';} - } - } - else {$CM=' ';} - - if ($UGdisplay > 0) - { - if ($non_latin < 1) - { - $user_group = sprintf("%-12s", $row[9]); - while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} - } - else - { - $user_group = sprintf("%-40s", $row[9]); - 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("%-18s", $row[10]); - while(strlen($user)>18) {$user = substr("$user", 0, -1);} - } - else - { - $user = sprintf("%-40s", $row[10]); - while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} - } - } - 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 ($Lstatus=='INCALL') - { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - } - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - $G=''; $EG=''; - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$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_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$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 ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} - else {$UGD = "";} - - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} - else {$SVD = "";} - - $agentcount++; - - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "$Aline"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load 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"; - - 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 "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " ΚΑΝΕΝΑΣ ΧΕΙΡ. ΣΕ ΚΛΗΣΕΙΣ \n";
-	}
-
-?>
-
- - + 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 +# + +$version = '2.0.5-36'; +$build = '90310-0906'; + +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["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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} +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["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} + +############################################# +##### 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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +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=0;} # 0=id, 1=name +if (!isset($orderby)) {$orderby='timeup';} +if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 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='N';} # 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]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $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); + + +$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DAY = date("Y-m-d"); +$NOW_HOUR = date("H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id,campaign_name 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; + $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++; + } +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)"; + } + +#if ( (eregi('ALL-ACTIVE',$group_string)) and ($with_inbound=='O') and ($outbound_autodial_active > 0) ) +# {$with_inbound='N';} + +$stmt="select * 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_list .= ""; +$select_list .= "
Select Εκστρατείες:
"; +$select_list .= ""; +$select_list .= "
(Για να επιλέξετε περισσότερα από 1 εκστρατείας, κρατήστε πατημένο το πλήκτρο Ctrl και κάντε κλικ)"; +$select_list .= "
"; +$select_list .= "Κλείστε Panel

"; + +if ($UGdisplay > 0) + { + $select_list .= "Select Ομάδα Χρήστη:
"; + $select_list .= "

"; + } + +$select_list .= "   Inbound:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "ΕΚΔΟΣΗ: $version   ΔΗΜΙΟΥΡΓΙΑ: $build"; +$select_list .= "
"; + +$open_list = "
Επιλογές εμφάνισης Επιλέξτε Έκθεση
"; + +?> + + + + + + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id IN($group_SQL) and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Εκστρατεία: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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 "VICIDIAL Real-Time                                                                          \n"; +echo "\n"; +echo "
\n"; +echo "Επιλογές εμφάνισης Επιλέξτε Έκθεση"; +echo "
\n"; +echo "
\n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; + } +else + { + echo "       ΤΡΟΠΟΠΟΙΗΣΗ | \n"; + } +echo "SUMMARY \n"; +echo "\n\n"; + + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$multi_drop=0; + +##### INBOUND ONLY ### +if (ereg('O',$with_inbound)) + { + $multi_drop++; + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + if ($adastats>1) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = round($AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec, 2); + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = sprintf("%01.2f", $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec); + } + else + {$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ΑΠΑΝΤΗΣΗagent_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  
ΑΠΑΝΤΗΣΗS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + + } + + $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);"; + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + + + if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";} + + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_pause_codes_active = $row[0]; + + $rslt=mysql_query($stmtC, $link); + $row=mysql_fetch_row($rslt); + $agent_non_pause_sec = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = round($AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec, 2); + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec = sprintf("%01.2f", $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec); + } + else + {$AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ΑΠΑΝΤΗΣΗagent_non_pause_sec=0; + } + + 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 ""; + } + +##### NOT INBOUND ONLY ### +else + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $multi_drop++; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; + + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; + } + else + { + if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} + + if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) + { + $multi_drop++; + $stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $c=0; + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active 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) 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]; + $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); + $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); + $agent_pause_codes_active = $row[19]; + + + $stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select count(*) from vicidial_hopper;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDhop = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $DAleads = $row[0]; + $callsTODAY = $row[1]; + $dropsTODAY = $row[2]; + $drpctTODAY = $row[3]; + $diffONEMIN = $row[4]; + $agentsONEMIN = $row[5]; + $balanceFILL = $row[6]; + $answersTODAY = $row[7]; + if ($multi_drop > 0) + { + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + } + $VSCcat1 = $row[8]; + $VSCcat1tally = $row[9]; + $VSCcat2 = $row[10]; + $VSCcat2tally = $row[11]; + $VSCcat3 = $row[12]; + $VSCcat3tally = $row[13]; + $VSCcat4 = $row[14]; + $VSCcat4tally = $row[15]; + + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } + else {$diffpctONEMIN = '0.00';} + + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $balanceSHORT = $row[0]; + + 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  
ΑΠΑΝΤΗΣΗS TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_ΑΠΑΝΤΗΣΗagent_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 ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL ΕΠΙΠΕΔΟ:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX ΕΠΙΠΕΔΟ:  $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     ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ:  $DIALmethod    
HOPPER ΕΠΙΠΕΔΟ:  $HOPlev     DROPPED / ΑΠΑΝΤΗΣΗED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "       ΑΠΟΚΡΥΨΗ ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; + } +else + { + echo "       VIEW ΟΜΑΔΑ ΧΡΗΣΤΩΝ"; + } +if ($UidORname>0) + { + echo "       ΕΜΦΑΝΙΣΗ ΧΕΙΡΙΣΤΗΣID"; + } +else + { + echo "       ΕΜΦΑΝΙΣΗ ΧΕΙΡΙΣΤΗΣNAME"; + } +if ($SERVdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; + } +else + { + echo "       ΕΜΦΑΝΙΣΗ ΔΙΑΚΟΜΙΣΤΗΣ INFO"; + } +if ($CALLSdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ WAITING CALLS"; + } +else + { + echo "       ΕΜΦΑΝΙΣΗ WAITING CALLS"; + } +if ($PHONEdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ PHONES"; + } +else + { + echo "       ΕΜΦΑΝΙΣΗ PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       ΑΠΟΚΡΥΨΗ CUSTPHONES"; + } +else + { + echo "       ΕΜΦΑΝΙΣΗ CUSTPHONES"; + } +echo "
"; + +echo "\n\n"; +} +################################################################################### +###### INBOUND/OUTBOUND CALLS +################################################################################### +if ($campaign_allow_inbound > 0) + { + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $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); + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; + } +else + { + if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} + else {$UgroupSQL = " and campaign_id IN($group_SQL)";} + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;"; + } +if ($CALLSdisplay > 0) + { + $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority"; + } +else + { + $stmtA = "SELECT status"; + } + + +$k=0; +$stmt = "$stmtA $stmtB"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + $in_ivr=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + { + $out_live++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + else + { + if (eregi("IVR",$row[0])) + { + $in_ivr++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + + $out_total++; + $i++; + } + + ##### MIDI alert audio file test ##### + # $test_midi=1; + # if ($test_midi > 0) + # { + # # echo ""; + # # echo ""; + # 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 "ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ \n"; + } + + + +################################################################################### +###### CALLS WAITING +################################################################################### + +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ |\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-12s", $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]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_M = ($Ccall_time_S / 60); + $Ccall_time_M = round($Ccall_time_M, 2); + $Ccall_time_M_int = intval("$Ccall_time_M"); + $Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int); + $Ccall_time_SEC = ($Ccall_time_SEC * 60); + $Ccall_time_SEC = round($Ccall_time_SEC, 0); + if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";} + $Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC"; + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + $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 |\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: Agents Time On Calls Εκστρατεία: $group_string $NOW_TIME\n"; + + +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "------------+"; +$HTstation = " STATION |"; +$HDphone = "------------+"; +$HTphone = " PHONE |"; +$HDuser = "--------------------+"; +$HTuser = " USER |"; +$HDusergroup = "--------------+"; +$HTusergroup = " ΟΜΑΔΑ ΧΡΗΣΤΩΝ |"; +$HDsessionid = "------------------+"; +$HTsessionid = " SESSIONID |"; +$HDbarge = "-------+"; +$HTbarge = " BARGE |"; +$HDstatus = "----------+"; +$HTstatus = " STATUS |"; +$HDcustphone = "------------+"; +$HTcustphone = " CUST PHONE |"; +$HDserver_ip = "-----------------+"; +$HTserver_ip = " ΔΙΑΚΟΜΙΣΤΗΣ IP |"; +$HDcall_server_ip = "-----------------+"; +$HTcall_server_ip = " CALL ΔΙΑΚΟΜΙΣΤΗΣ IP |"; +$HDtime = "---------+"; +$HTtime = " MM:SS |"; +$HDcampaign = "------------+"; +$HTcampaign = " CAMPAIGN |"; +$HDcalls = "-------+"; +$HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; + +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) && ($IAXmonitorLINK<1) ) + { + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; + } +if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) + { + $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\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\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 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]; + + $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'"; + } + + $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]=$Acall_finish[$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("%-10s", $extension); + while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} + } + else + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-40s", $extension); + while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} + } + + $phone = sprintf("%-10s", $phone_split[0]); + $custphone = sprintf("%-10s", $custphone); + $Luser = $Auser[$i]; + $user = sprintf("%-18s", $Auser[$i]); + $Lsessionid = $Asessionid[$i]; + $sessionid = sprintf("%-9s", $Asessionid[$i]); + $Lstatus = $Astatus[$i]; + $status = sprintf("%-6s", $Astatus[$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)) + { + ### temporarily deactivate DEAD calls display until bug is fixed + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } + + if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) + {$CM='A';} + else + { + if (eregi("Εισερχόμενα",$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("%-18s", $Afull_name[$i]); + while(strlen($user)>18) {$user = substr("$user", 0, -1);} + } + else + { + $user = sprintf("%-40s", $Afull_name[$i]); + while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} + } + } + if (!eregi("INCALL|QUEUE",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Acall_finish[$i]);} + else + {$call_time_S = ($STARTtime - $Acall_time[$i]);} + + $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 ($Lstatus=='INCALL') + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$G=''; $EG='';} + # if ($call_time_M_int >= 10) {$G=''; $EG='';} + } + if ($Lstatus=='DEAD') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_dead++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + } + } + if ($Lstatus=='DISPO') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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)) ) {$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_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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 ($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 campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' 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[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 .= " System Load 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 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 πράκτορες νεκροί σε κλήσεις      \n"; + + echo "
";
+		echo "";
+		echo "$Cecho";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo " ΚΑΝΕΝΑΣ ΧΕΙΡ. ΣΕ ΚΛΗΣΕΙΣ \n";
+	echo "
$Cecho";
+	}
+
+?>
+
+
+ + diff --git a/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php index 0fe755a0..db0b93b8 100644 --- a/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -13,6 +13,8 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -104,7 +106,14 @@ if (!isset($RR)) {$RR=4;} \n"; -echo "VICIDIAL: Realtime All Εκστρατείες Summary\n"; +echo "VICIDIAL: Realtime All Εκστρατείες Summary\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "\n"; + $RANKcampaigns_list="\n"; $o=0; while ($campaigns_to_print > $o) @@ -1522,30 +2114,40 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($campaigns_to_print > $o) { - $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$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]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else - {$calls_today=0; $SELECT_campaign_rank=0;} + {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { 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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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); } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $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); } @@ -1600,8 +2202,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $RANKcampaigns_list .= ">$h"; $h--; } + if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) ) + {$campaign_web=$group_web_vars;} $RANKcampaigns_list .= "\n"; - $RANKcampaigns_list .= "\n"; + $RANKcampaigns_list .= "\n"; + $RANKcampaigns_list .= "\n"; $o++; } ##### END get campaigns listing for rankings ##### @@ -1609,7 +2214,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD ##### BEGIN get inbound groups listing for checkboxes ##### $xfer_groupsSQL=''; - if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) + 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); @@ -1659,12 +2264,13 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $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="\n"; + $RANKgroups_list="\n"; $o=0; while ($groups_to_print > $o) @@ -1678,14 +2284,17 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($groups_to_print > $o) { - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$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]; + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else {$calls_today=0; $SELECT_group_rank=0;} @@ -1693,15 +2302,23 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { 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' where group_id='$group_id_values[$o]' and user='$user';"; + $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); } 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';"; + $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); } @@ -1741,7 +2358,12 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $groups_list .= "> $group_id_values[$o] - $group_name_values[$o]
\n"; + $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 .= "> $group_id_values[$o] - $group_name_values[$o] - $VIG_priority
\n"; $XFERgroups_list .= "> $group_id_values[$o] - $group_name_values[$o]
\n"; $RANKgroups_list .= "> $group_id_values[$o] - $group_name_values[$o] "; $RANKgroups_list .= "\n"; - $RANKgroups_list .= "\n"; + $RANKgroups_list .= "\n"; + $RANKgroups_list .= "\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} @@ -1769,16 +2394,26 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) ) { - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';"; + $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]; + $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='4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_list.=" CHECKED"; $campaigns_value .= " -ALL-CAMPAIGNS- -"; } + if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) + { + $qc_campaigns_list.=" CHECKED"; + $qc_campaigns_value .= " -ALL-CAMPAIGNS- -"; + } + if (eregi('ALL-GROUPS',$qc_groups[$p])) + { + $qc_groups_list.=" CHECKED"; + $qc_groups_value .= " -ALL-GROUPS- -"; + } $p++; } $campaigns_list.="> ALL-CAMPAIGNS - ΟΙ ΧΡΗΣΤΕΣ ΜΠΟΡΟΥΝ ΝΑ ΔΟΥΝ ΟΠΟΙΑΔΗΠΟΤΕ ΕΚΣΤΡΑΤΕΙΑ
\n"; + $qc_campaigns_list.="> ALL-CAMPAIGNS - Οι χρήστες μπορούν να QC οποιαδήποτε καμπάνια
\n"; + $qc_groups_list.="> ALL-GROUPS - Οι χρήστες μπορούν να ANY QC εισερχόμενα ΟΜΑΔΑ
\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); @@ -1802,6 +2449,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaign_id_value = $rowx[0]; $campaign_name_value = $rowx[1]; $campaigns_list .= "4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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 ""; $p++; } $campaigns_list .= "> $campaign_id_value - $campaign_name_value
\n"; + $qc_campaigns_list .= "> $campaign_id_value - $campaign_name_value
\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 .= "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) ) + 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"; @@ -1900,6 +2582,11 @@ echo "
"; + echo "VICIDIAL: Realtime All Εκστρατείες Summary           \n"; echo "STOP | "; echo "SLOW | "; @@ -201,7 +210,7 @@ $row=mysql_fetch_row($rslt); $balanceSHORT = $row[0]; echo "
"; -echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -211,7 +220,7 @@ echo ""; if ($adastats>1) { echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -229,12 +238,12 @@ echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; -echo ""; -echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -305,6 +314,7 @@ $parked_to_print = mysql_num_rows($rslt); $out_total=0; $out_ring=0; $out_live=0; + $in_ivr=0; while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); @@ -313,6 +323,8 @@ $parked_to_print = mysql_num_rows($rslt); {$out_live++;} else { + if (eregi("IVR",$row[0])) + {$in_ivr++;} if (eregi("CLOSER",$row[0])) {$nothing=1;} else @@ -334,6 +346,7 @@ $parked_to_print = mysql_num_rows($rslt); 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 { @@ -438,5 +451,6 @@ $k++; ?> +
DIAL LEVEL:  $DIALlev    DIAL ΕΠΙΠΕΔΟ:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  MAX LEVEL:  $maxDIALlev     MAX ΕΠΙΠΕΔΟ:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL METHOD:  $DIALmethod     ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   HOPPER ΕΠΙΠΕΔΟ:  $HOPlev     DROPPED / ΑΠΑΝΤΗΣΗED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
diff --git a/LANG_www/vicidial_el/AST_timeonpark.php b/LANG_www/vicidial_el/AST_timeonpark.php index aa79106a..b21f49fc 100644 --- a/LANG_www/vicidial_el/AST_timeonpark.php +++ b/LANG_www/vicidial_el/AST_timeonpark.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonpark.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60620-1042 - Added variable filtering to eliminate SQL injection attack threat diff --git a/LANG_www/vicidial_el/admin.php b/LANG_www/vicidial_el/admin.php index 0c2f9dbf..25217b5e 100644 --- a/LANG_www/vicidial_el/admin.php +++ b/LANG_www/vicidial_el/admin.php @@ -1,14 +1,11 @@ LICENSE: GPLv2 # - +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); - ###################################################################################################### ###################################################################################################### ####### static variable settings for display options @@ -16,7 +13,7 @@ require("dbconnect.php"); ###################################################################################################### $page_width='770'; -$section_width='720'; +$section_width='750'; $header_font_size='3'; $subheader_font_size='2'; $subcamp_font_size='2'; @@ -32,22 +29,16 @@ $scripts_color = '#99FFCC'; $filters_color = '#CCCCCC'; $admin_color = '#FF99FF'; $reports_color = '#99FF33'; -#$users_color = '#FFFF99'; -#$campaigns_color = '#FFFF99'; -#$lists_color = '#FFFF99'; -#$ingroups_color = '#FFFF99'; -#$remoteagent_color ='#FFFF99'; -#$usergroups_color = '#FFFF99'; -#$scripts_color = '#FFFF99'; -#$filters_color = '#FFFF99'; -#$admin_color = '#FFFF99'; -#$reports_color = '#FFFF99'; $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'; +$subcamp_color = '#FF9933'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -64,9 +55,32 @@ $reports_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; $status_font = 'BLACK'; -$subcamp_color = '#FF9933'; $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'; +$subcamp_color = '#C6C6C6'; +### + + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -178,6 +192,8 @@ if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec 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"];} @@ -292,8 +308,8 @@ if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seco 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_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} +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"];} @@ -428,8 +444,8 @@ 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["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} +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"];} @@ -472,6 +488,8 @@ if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["update 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"];} @@ -570,7 +588,8 @@ if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["ca 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["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"];} @@ -669,6 +688,272 @@ 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($script_id)) {$script_id= strtoupper($script_id);} @@ -680,6 +965,26 @@ if (strlen($dial_status) > 0) $status = $dial_status; } +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,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]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -750,7 +1055,6 @@ $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); $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); @@ -782,7 +1086,6 @@ $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); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); $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); @@ -807,10 +1110,49 @@ $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); + +### 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("[^\n0-9]","",$phone_numbers); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -818,24 +1160,39 @@ $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); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); $selectable = ereg_replace("[^NY]","",$selectable); $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$use_campaign_dnc = ereg_replace("[^NY]","",$use_campaign_dnc); $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); -$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $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); +$disable_alter_custphone = ereg_replace("[^NY]","",$disable_alter_custphone); +$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); + +$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); + ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -853,10 +1210,19 @@ $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_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); $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); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -866,6 +1232,7 @@ $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); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -913,8 +1280,8 @@ $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); +$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); @@ -940,11 +1307,61 @@ $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); +$hold_time_option_callback_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_option_callback_filename); +$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); + +### 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 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); @@ -954,6 +1371,7 @@ $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); @@ -977,6 +1395,15 @@ $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); ### 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); @@ -994,15 +1421,36 @@ $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pas $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); +$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); + +### 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); + +### 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); +$globals_string = ereg_replace(";","",$globals_string); +$dialplan_entry = ereg_replace(";","",$dialplan_entry); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url # $admin_home_url +# $qc_web_form_address +# $vtiger_url ### VARIABLES not filtered at all ### # $script_text @@ -1141,17 +1589,74 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 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 # -# # 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.0.4-119'; -$build = '71125-1751'; +$admin_version = '2.0.5-172'; +$build = '90310-2203'; $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); @@ -1169,11 +1674,28 @@ if ($force_logout) exit; } - $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); +############################################# +##### 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); - $auth=$row[0]; + $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 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");} @@ -1196,46 +1718,50 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * 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[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]; + $stmt="SELECT * 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]; - $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]; + $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|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); } } @@ -1272,18 +1798,25 @@ if ($ADD==111) {$hh='lists'; echo "Πρόσθεσε Νέα Λίστα";} if ($ADD==121) {$hh='lists'; echo "Προσθέστε νέο DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Πρόσθεσε Νέα Εισ-Ομάδα";} if ($ADD==1211) {$hh='ingroups'; echo "$$$-ΟΜΑΔΑ αντιγράφων";} +if ($ADD==1311) {$hh='ingroups'; echo "Προσθήκη νέουDID";} +if ($ADD==1411) {$hh='ingroups'; echo "ΑντιγραφήDID";} if ($ADD==11111) {$hh='remoteagent'; echo "Πρόσθεσε Νέους Απομακρυσμένους Χειριστές";} if ($ADD==111111) {$hh='usergroups'; echo "Πρόσθεσε Νέα Ομάδα Χρηστών";} if ($ADD==1111111) {$hh='scripts'; echo "Πρόσθεσε Νέο Βοηθό";} if ($ADD==11111111) {$hh='filters'; echo "Πρόσθεσε Φίλτρο";} if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Πρόσθεσε Νέο Χρόνο Κλήσης";} +if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Προσθήκη νέου Shift";} if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Πρόσθεσε Νέο Χρόνο Κλήσης Κατάστασης";} if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ΠΡΟΣΘΕΣΕ ΝΕΟ ΤΗΛΕΦΩΝΟ";} +if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "Προσθήκη νέου PHONE ALIAS";} +if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "Προσθήκη νέου GROUP ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΣΕ ΝΕΟ ΔΙΑΚΟΜΙΣΤΗ";} +if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Προσθήκη νέου ΠΙΣΤ TEMPLATE";} +if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Προσθήκη νέου ΘΑΛΑΜΙΣΚΟ";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΕΣΕ ΝΕΑ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD=="2") {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} -if ($ADD=="2A") {$hh='users'; echo "Νέα αντιγραμμένη προσθήκη χρηστών";} +if ($ADD=='2') {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} +if ($ADD=='2A') {$hh='users'; echo "Νέα αντιγραμμένη προσθήκη χρηστών";} if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Νέα αντιγραμμένη προσθήκη εκστρατείας";} if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Προσθήκη Νέας Εκστρατείας";} if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Προσθήκη Νέας Κατάστασης Εκστρατείας";} @@ -1296,34 +1829,55 @@ if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγ if ($ADD==211) {$hh='lists'; echo "Προσθήκη Νέας Λίστας";} if ($ADD==2111) {$hh='ingroups'; echo "Προσθήκη Νέας Εισ-Ομάδας";} if ($ADD==2011) {$hh='ingroups'; echo "Νέα αντιγραμμένη προσθήκη-ΟΜΑΔΑΣ";} +if ($ADD==2311) {$hh='ingroups'; echo "Νέα προσθήκη DID";} +if ($ADD==2411) {$hh='ingroups'; echo "Νέα προσθήκη αντιγραφή DID";} if ($ADD==21111) {$hh='remoteagent'; echo "Προσθήκη Νέων Απομακρυσμένων Χειριστών";} if ($ADD==211111) {$hh='usergroups'; echo "Προσθήκη Νέας Ομάδας Χρηστών";} if ($ADD==2111111) {$hh='scripts'; echo "Νέα προσθήκη Βοηθού";} if ($ADD==21111111) {$hh='filters'; echo "Προσθήκη Νέου Φίλτρου";} if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "Προσθήκη Νέου Χρόνου Κλήσης";} +if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "Νέα προσθήκη Shift";} if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "Προσθήκη Νέου Χρόνου Κλήσης Κατάστασης";} if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΤΗΛΕΦΩΝΟΥ";} +if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "Την προσθήκη νέων PHONE ALIAS";} +if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "Την προσθήκη νέων GROUP ALIAS";} if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΔΙΑΚΟΜΙΣΤΗ";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΤΕΙ ΝΕΑ ΕΓΓΡΑΦΗ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΡΜΟΥ";} +if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Την προσθήκη νέων ΠΙΣΤ TEMPLATE";} +if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Την προσθήκη νέων ΘΑΛΑΜΙΣΚΟ";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΣΥΝΔΙΑΛΕΞΗΣ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ΠΡΟΣΘΗΚΗ ΤΩΝ ΘΈΣΕΩΝ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ΠΡΟΣΘΗΚΗ ΤΗΣ ΚΑΤΗΓΟΡΊΑΣ ΘΈΣΗΣ VICIDIAL";} +if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "Adding VICIDIAL QC Κατάσταση ΚΩΔΙΚΟΣ";} if ($ADD==3) {$hh='users'; echo "Τροποποίηση Χρήστη";} if ($ADD==30) {$hh='campaigns'; echo "Εκστρατεία δεν επιτρέπεται";} if ($ADD==31) - { - $hh='campaigns'; $sh='detail'; echo "Τροποποίηση Εκστρατείας - Detail - $campaign_id"; - if ($SUB==22) {echo " - Statuses";} - if ($SUB==23) {echo " - HotKeys";} - if ($SUB==25) {echo " -Μόλυβδος ανακύκλωσηςEntries";} - if ($SUB==26) {echo " - Auto Alt Dial Statuses";} - if ($SUB==27) {echo " - Agent Pause Codes";} - if ($SUB==29) {echo " - List Mixes";} - } + { + $hh='campaigns'; $sh='detail'; echo "Τροποποίηση Εκστρατείας - Λεπτομέρειες - $campaign_id"; + if ($SUB==22) {echo " - Καθεστώτων";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Μόλυβδος ανακύκλωσηςEntries";} + if ($SUB==26) {echo " - Alt Auto Dial Καθεστώτων";} + if ($SUB==27) {echo " - Agent Παύση Κώδικες";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Κατάλογος Mixes";} + if ($SUB=='20A') {echo " - Έρευνα";} + } +if ($ADD==34) + { + $hh='campaigns'; $sh='basic'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση - $campaign_id"; + if ($SUB==22) {echo " - Καθεστώτων";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Μόλυβδος ανακύκλωσηςEntries";} + if ($SUB==26) {echo " - Alt Auto Dial Καθεστώτων";} + if ($SUB==27) {echo " - Agent Παύση Κώδικες";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Κατάλογος Mixes";} + if ($SUB=='20A') {echo " - Έρευνα";} + } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Θέσεις εκστρατείας";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Εκστρατεία HotKeys";} -if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Ανακύκλωσης καταχωρήσεις μολύβδου εκστρατείας";} if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Αυτόματες ALT θέσεις πινάκων εκστρατείας";} if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Κώδικες μικρής διακοπής πρακτόρων εκστρατείας";} @@ -1331,20 +1885,27 @@ if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Θέσεις πινάκ if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Μίγματα καταλόγων εκστρατείας";} if ($ADD==311) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==3111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} +if ($ADD==3311) {$hh='ingroups'; echo "ModifyDID";} if ($ADD==31111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} if ($ADD==311111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} if ($ADD==3111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} if ($ADD==31111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Τροποποίηση Χρόνου Κλήσης";} if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Τροποποίηση Λίστας Ορισμών Χρόνου Κλήσης Κατάστασης ";} +if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Τροποποιήστε Shift";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Τροποπίηση Χρόνου Κλήσης Κατάστασης";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ";} +if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ ALIAS";} +if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ";} +if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "MODIFY ΠΙΣΤ TEMPLATE";} +if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY ΘΑΛΑΜΙΣΚΟ";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΘΈΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΗΝ ΚΑΤΗΓΟΡΊΑ ΘΈΣΗΣ VICIDIAL";} +if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC Κατάσταση ΚΩΔΙΚΟΣ";} if ($ADD=="4A") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} if ($ADD=="4B") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} if ($ADD==4) {$hh='users'; echo "Τροποποίηση Χρήστη";} @@ -1354,41 +1915,56 @@ if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Τροποποίηση Ε if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Τροποποιήστε τον οδηγό εκστρατείας ανακύκλωσης";} if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Τροποποιήστε τον κώδικα μικρής διακοπής πρακτόρων";} +if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Τροποποίηση Ρυθμίσεων Καμπάνιας QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Τροποποιήστε το μίγμα καταλόγων εκστρατείας";} +if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Τροποποίηση Καμπάνιας Έρευνα";} if ($ADD==411) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==4111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} +if ($ADD==4311) {$hh='ingroups'; echo "ModifyDID";} if ($ADD==41111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} if ($ADD==411111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} if ($ADD==4111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} if ($ADD==41111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Τροποποίηση Χρόνου Κλήσης";} +if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Τροποποιήστε Shift";} if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Τροποπίηση Χρόνου Κλήσης Κατάστασης";} if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ";} +if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ ALIAS";} +if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ";} if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΡΜΟΥ";} +if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "MODIFY ΠΙΣΤ TEMPLATE";} +if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY ΘΑΛΑΜΙΣΚΟ";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΘΈΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΚΑΤΗΓΟΡΊΕΣ ΘΈΣΗΣ VICIDIAL";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Εκστρατεία";} +if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC Κατάσταση ΚΩΔΙΚΟΣ";} +if ($ADD==5) {$hh='users'; echo "ΔιαγράφωΧρήστης";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "ΔιαγράφωΕκστρατεία";} if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Αποσυνδεμένοι Χειριστές";} if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==511) {$hh='lists'; echo "ΔιαγράφωList";} +if ($ADD==5111) {$hh='ingroups'; echo "ΔιαγράφωIn-Group";} +if ($ADD==5311) {$hh='ingroups'; echo "ΔιαγράφωDID";} if ($ADD==51111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} if ($ADD==511111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} if ($ADD==5111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} if ($ADD==51111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Διαγραφή Χρόνου Κλήσης";} +if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Διαγραφή Shift";} if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Διαγραφή Χρόνου Κλήσης Κατάστασης";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} +if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "Διαγραφή ομάδας ALIAS";} if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "DELETE ΠΙΣΤ TEMPLATE";} +if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "DELETE ΘΑΛΑΜΙΣΚΟ";} 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 "Delete User";} -if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Εκστρατεία";} +if ($ADD==6) {$hh='users'; echo "ΔιαγράφωΧρήστης";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "ΔιαγράφωΕκστρατεία";} if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Αποσυνδεμένοι Χειριστές";} if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Διαγράψτε τον οδηγό ανακύκλωσης";} @@ -1396,21 +1972,31 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Διαγράψτε την if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Διαγράψτε τον κώδικα μικρής διακοπής πρακτόρων";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Θέση πινάκων εκστρατείας αφαιρούμενη";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγων εκστρατείας αφαιρούμενο";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==611) {$hh='lists'; echo "ΔιαγράφωList";} +if ($ADD==6111) {$hh='ingroups'; echo "ΔιαγράφωIn-Group";} +if ($ADD==6311) {$hh='ingroups'; echo "ΔιαγράφωDID";} if ($ADD==61111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} if ($ADD==611111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} if ($ADD==6111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} if ($ADD==61111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Διαγραφή Χρόνου Κλήσης";} +if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Διαγραφή Shift";} if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Διαγραφή Χρόνου Κλήσης Κατάστασης";} if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} +if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "Διαγραφή ομάδας ALIAS";} if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "ΔΙΑΓΡΑΦΗ ΕΓΓΡΑΦΗΣ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΡΜΟΥ";} +if ($ADD==621111111111) {$hh='admin'; $sh='templates'; echo "DELETE ΠΙΣΤ TEMPLATE";} +if ($ADD==621111111111) {$hh='admin'; $sh='carriers'; echo "DELETE ΘΑΛΑΜΙΣΚΟ";} 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 "Μετρητής Κληθέντων Οδηγών";} if ($ADD==7111111) {$hh='scripts'; echo "Προεπισκόπιση Βοηθού";} +if ($ADD==700000000000000) {$hh='reports'; echo "ΔΙΑΧΕΙΡΙΣΗ CHANGE LOG";} +if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL ΧΡΗΣΤΗΣ ΔΙΟΙΚΗΣΗΣ CHANGE LOG";} +if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL ΤΜΗΜΑ ΔΙΟΙΚΗΣΗΣ CHANGE LOG";} +if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL ΛΕΠΤΟΜΕΡΕΙΑ ADMIN CHANGE LOG";} if ($ADD==0) {$hh='users'; echo "Λίστα Χρηστών";} if ($ADD==8) {$hh='users'; echo "Επανακλήσεις μέσα στον χειριστή";} if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Επανακλήσεις μέσα στην εκστρατεία";} @@ -1419,14 +2005,20 @@ if ($ADD==8111) {$hh='usergroups'; echo "CallBacks μέσα στην ομάδ if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Εκστρατείες";} if ($ADD==100) {$hh='lists'; echo "Λίστες";} if ($ADD==1000) {$hh='ingroups'; echo "Εισ-Ομάδες";} +if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} if ($ADD==10000) {$hh='remoteagent'; echo "Απομακρυσμένοι Χειριστές";} if ($ADD==100000) {$hh='usergroups'; echo "Ομάδες Χρήστη";} if ($ADD==1000000) {$hh='scripts'; echo "Βοηθοί";} if ($ADD==10000000) {$hh='filters'; echo "Φίλτρα";} if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Χρόνοι Κλήσεων";} +if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Βάρδιες";} if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "ΛΙΣΤΑ ΤΗΛΕΦΩΝΟΥ";} +if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS ΚΑΤΑΛΟΓΟΣ";} +if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "ΟΜΑΔΑ ALIAS ΚΑΤΑΛΟΓΟΣ";} if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "ΛΙΣΤΑ ΔΙΑΚΟΜΙΣΤΗ";} +if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "ΠΙΣΤ TEMPLATE ΚΑΤΑΛΟΓΟΣ";} +if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "ΘΑΛΑΜΙΣΚΟ ΚΑΤΑΛΟΓΟΣ";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "ΛΙΣΤΑ ΣΥΝΔΙΑΛΕΞΕΩΝ";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL ΛΙΣΤΑ ΣΥΝΔΙΑΛΕΞΕΩΝ";} if ($ADD==550) {$hh='users'; echo "Φόρμα Αναζήτησης";} @@ -1507,7 +2099,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="
CAMPAIGN     RANK     CALLS
CAMPAIGN     RANK     CALLSWEB VARS
    $calls_today
    $calls_today    
INBOUND GROUP     RANK     CALLS
Εισερχόμενα GROUP     RANK     CALLSWEB VARS
        $calls_today
    $calls_today    
Κωδικός Τηλεφώνου - εδώ μπορείτε να θέσετε ένα προκαθορισμένο κωδικό τηλεφώνου κατά την είσοδο του χειριστή στο vicidial.php. +
+ +
+Ενεργή - Το πεδίο αυτό καθορίζει αν ο χρήστης είναι ενεργός στο σύστημα και μπορεί να χρησιμοποιήσει VICIDIAL πόρων. Προεπιλεγμένο είναι Y +

@@ -1935,31 +2622,53 @@ echo "
Μεταφορές- Αυτή η επιλογή μπορεί να απαγορεύσει σε έναν χειριστή να ανοίξει την διαδικασία μεταφορά-συνδιάσκεψη. Αν είναι απενεργοποιημένη, ο χρήστης δεν μπορεί να μεαφέρει κλήσεις ή να κάνει κλήση σε τρίτο. -
- -
-Πιό στενή προεπιλογή που συνδυάζεται - αυτή η επιλογή προκαθορίζει απλά το συνδυασμένο τετραγωνίδιο σε μια ΠΙΟ ΣΤΕΝΉ οθόνη σύνδεσης. + 0) + { + ?> +
+
+
+ Πιό στενή προεπιλογή που συνδυάζεται - αυτή η επιλογή προκαθορίζει απλά το συνδυασμένο τετραγωνίδιο σε μια ΠΙΟ ΣΤΕΝΉ οθόνη σύνδεσης. +

VICIDIAL συμπληρωματική προμήθεια καταγραφής - αυτή η επιλογήθα αγνοήσει οποιο δήποτε η επιλογή είναι στην εκστρατεία για τηνκαταγραφή. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΑΓΚΕΣ δεν θα αγνοήσουν τηρύθμιση καταγραφής εκστρατείας. Δεν θα θέσει εκτός λειτουργίαςΠΟΤΕ την καταγραφή στον πελάτη. ONDEMAND είναι η προεπιλογήκαι επιτρέπει στον πράκτορα για να αρχίσει και να σταματήσει όπωςαπαιτείται. ALLCALLS θα αρχίσει την καταγραφή στον πελάτηόποτε μια κλήση στέλνεται σε έναν πράκτορα. ALLFORCE θααρχίσει την καταγραφή στον πελάτη όποτε μια κλήση στέλνεται σεέναν πράκτορα που δεν δίνει στον πράκτορα καμία επιλογή νασταματήσει. Για ALLCALLS και ALLFORCE υπάρχει μια επιλογή ναχρησιμοποιηθεί η καθυστέρηση καταγραφής για να περικόψει στιςπολύ σύντομα καταγραφές και recude το φορτίο συστημάτων. +
+
+
+Agent Shift Επιβολή Override - Η ρύθμιση αυτή θα αντικαταστήσει τους χρήστες ανεξάρτητα από την ομάδα χρηστών που έχει για την εκτέλεση Shift. DISABLED θα χρησιμοποιήσει ο χρήστης ομάδα ρύθμιση. OFF δεν θα επιβάλει σε όλες τις βάρδιες. START θα επιβάλει μόνο το χρόνο σύνδεσης, αλλά δεν θα επηρεάσει έναν πράκτορα που εκτελεί τους πάνω μετατόπιση του χρόνου και αν είναι ήδη συνδεδεμένος in. ALL θα επιβάλλει μετατόπιση χρόνος έναρξης και θα συνδεθείτε ορίζονται μετά από έναν πράκτορα που τρέχουν πάνω από το τέλος του χρόνου τους βάρδια. Η προεπιλογή είναι άτομα με ειδικές ανάγκες. + +
+
+
+Alert Enabled - Το πεδίο αυτό δείχνει κατά πόσο ο μεσάζων έχει τη δυνατότητα web browser ειδοποιήσεις για κλήσεις όταν έρθουν σε vicidial.php συνόδου τους. Η προεπιλογή είναι 0 για τα NO. +

-Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων campaign_rank. +Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων campaign_rank. Επίσης σε αυτό το τμήμα της WEB VARs για κάθε καμπάνια. Αυτά επιτρέπουν κάθε παράγοντα να έχει μια διαφορετική μεταβλητή συμβολοσειρά που μπορεί να προστεθεί στην ηλεκτρονική φόρμα ή SCRIPT καρτέλα URLs από απλά θέτοντας - Α - web_vars - Β - όπως θα την κάθε άλλο τομέα.

-Εισερχόμενες Ομάδες - Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. Θα είστε σε θέση επίσης να θέσετε την τάξη, ή το επίπεδοικανότητας, σε αυτό το τμήμα κάθε μιας από τις εισερχόμενεςομάδες καθώς επίσης και όντας σε θέση να δείτε τοναριθμό κλήσεων που παραλαμβάνονται από κάθε εισερχόμενη ομάδαγια αυτόν τον συγκεκριμένο πράκτορα. Επίσης σε αυτό το τμήμα είναι η δυνατότητα να δοθεί στονπράκτορα μια τάξη για κάθε εισερχόμενη ομάδα. Αυτές οι τάξειςμπορούν να χρησιμοποιηθούν για την προτιμημένη κλήση καθοδηγώνταςόταν επιλέγεται εκείνη η επιλογή στην οθόνη-ΟΜΑΔΑΣ. +Εισερχόμενες Ομάδες - Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. Θα είστε σε θέση επίσης να θέσετε την τάξη, ή το επίπεδοικανότητας, σε αυτό το τμήμα κάθε μιας από τις εισερχόμενεςομάδες καθώς επίσης και όντας σε θέση να δείτε τοναριθμό κλήσεων που παραλαμβάνονται από κάθε εισερχόμενη ομάδαγια αυτόν τον συγκεκριμένο πράκτορα. Επίσης σε αυτό το τμήμα είναι η δυνατότητα να δοθεί στονπράκτορα μια τάξη για κάθε εισερχόμενη ομάδα. Αυτές οι τάξειςμπορούν να χρησιμοποιηθούν για την προτιμημένη κλήση καθοδηγώνταςόταν επιλέγεται εκείνη η επιλογή στην οθόνη-ΟΜΑΔΑΣ. Επίσης σε αυτό το τμήμα της WEB VARs για κάθε καμπάνια. Αυτά επιτρέπουν κάθε παράγοντα να έχει μια διαφορετική μεταβλητή συμβολοσειρά που μπορεί να προστεθεί στην ηλεκτρονική φόρμα ή SCRIPT καρτέλα URLs από απλά θέτοντας - Α - web_vars - Β - όπως θα την κάθε άλλο τομέα.

Ο πράκτορας αλλάζει τη συμπληρωματική προμήθεια στοιχείωνπελατών - αυτή η επιλογή θα αγνοήσει οποιος δήποτε η επιλογήείναι στην εκστρατεία για την αλλαγή των στοιχείων πελατών.NOT_ACTIVE θα χρησιμοποιήσει οποιου δήποτε που θέτει είναιπαρών για την εκστρατεία. ALLOW_ALTER θα επιτρέψει πάντα τονπράκτορα να αλλάξει τα στοιχεία πελατών, η των οποίων ρύθμισηεκστρατείας είναι. Η προεπιλογή είναι NOT_ACTIVE. +
+
+
+Agent Alter Πελατών τηλέφωνο Παράκαμψη - Η επιλογή αυτή θα υπερισχύσει του όποια κι αν είναι η επιλογή είναι στην εκστρατεία για την τροποποίηση του πελάτη τον αριθμό του τηλεφώνου. NOT_ACTIVE θα χρησιμοποιήσει όποια ρύθμιση είναι παρόντες κατά την εκστρατεία. ALLOW_ALTER θα επιτρέπει πάντα για τον πράκτορα να τροποποιήσει τον αριθμό τηλεφώνου του πελάτη, δεν το θέμα αυτό η εκστρατεία η ρύθμιση. Προεπιλεγμένο είναι NOT_ACTIVE. +

@@ -1995,10 +2704,17 @@ echo "
Διαγράψτε τους Απομακρυσμένους Χειριστές - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τους απομακρυσμένους χειριστές από το σύστημα. -
- -
-Εισαγωγή Οδηγών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να εισάγει τους οδηγούς στον πίνακα vicidial_list μέσω του βασισμένου σε Ιστοσελίδα Εισαγωγέα οδηγών. + 0) + { + ?> +
+
+
+ Εισαγωγή Οδηγών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να εισάγει τους οδηγούς στον πίνακα vicidial_list μέσω του βασισμένου σε Ιστοσελίδα Εισαγωγέα οδηγών. +
@@ -2030,10 +2746,17 @@ echo "
Αλλαγή Εκστρατείας Χειριστού - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να αλλάξει την εκτρατεία όπου ένας πράκτορας έχει συνδεθεί . -
- -
-Διαγραφή Φίλτρων - Αυτή η επιλογή επιτρέπει στον χειριστή να διαγράφει φίλτρα από το σύστημα. + 0) + { + ?> +
+
+
+ Διαγραφή Φίλτρων - Αυτή η επιλογή επιτρέπει στον χειριστή να διαγράφει φίλτρα από το σύστημα. +
@@ -2055,6 +2778,82 @@ echo "
Εκθέσεις άποψης - αυτή η επιλογή επιτρέπει στο χρήστη για να δειτις εκθέσεις VICIDIAL. + 0) + { + ?> +
+ +
+ QC Enabled - Η επιλογή αυτή επιτρέπει στο χρήστη να συνδεθείτε με το γραφείο ποιοτικού ελέγχου της οθόνης. + +
+
+
+ QC επίπεδο χρήστη - Αυτή η ρύθμιση ορίζει τι ο πράκτορας Ελέγχου Ποιότητας χρήστη επίπεδο. Αυτό θα υπαγορεύσει το επίπεδο λειτουργικότητας για τον αντιπρόσωπο στο τμήμα QC:
+ 1 - Τίποτα δεν Modify
+ 2 - Τίποτα δεν ModifyΕκτός Status
+ 3 - Τροποποιήστε Όλα τα πεδία
+ 4 - Βεβαιωθείτε πρώτου γύρου, QC
+ 5 - Δείτε QC Στατιστικά
+ 6 - Ικανότητα ModifyΕΤΟΙΜΑ αρχεία
+ 7 - Manager Επίπεδο
+ +
+
+
+ QC Εγγραφή Pass - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι μια εγγραφή έχει περάσει από τον πρώτο γύρο, QC, μετά την επανεξέταση των ρεκόρ. + +
+
+
+ QC Εγγραφή Finish - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι μια εγγραφή έχει τελειώσει ο δεύτερος γύρος των QC πέρασε μετά την επανεξέταση των ρεκόρ. + +
+
+
+ QC Αναλήψεις Record - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι ένα ρεκόρ το οποίο έχει δεσμευθεί στην QC. Αυτό δεν είναι πλέον δυνατό να τροποποιηθεί από κανέναν. + + +
+
+
+ΠροσθήκηΏρα ρολόι Εγγραφή Εγγραφή - Η επιλογή αυτή επιτρέπει στο χρήστη να προσθέσετε εγγραφές στο μητρώο timeclock. + +
+
+
+ΤροποποιήστεΏρα ρολόι Εγγραφή Εγγραφή - Η επιλογή αυτή επιτρέπει στο χρήστη να τροποποιήσει τις εγγραφές του timeclock log. + +
+
+
+Εγγραφή ΔιαγραφήΏρα ρολόι Record - Η επιλογή αυτή επιτρέπει στο χρήστη να διαγράψει αρχεία στο timeclock log. + +
+
+
+Agent API Πρόσβαση - Η επιλογή αυτή επιτρέπει τον λογαριασμό που πρέπει να χρησιμοποιούνται με την vicidial πράκτορας API εντολές. + +
+
+
+Manager Shift Επιβολή Override - Η ρύθμιση αυτή ορίζεται σε 1, αν θα επιτρέψει ο διαχειριστής του να εισέλθει στα χρήστη και κωδικό πρόσβασης σε έναν πράκτορα της οθόνης για να παρακάμψετε τους περιορισμούς σχετικά με τη μετατόπιση ενός πράκτορα συνόδου εάν ο πράκτορας προσπαθεί να συνδεθείτε με τους εκτός της βάρδιας. Η προεπιλογή είναι 0. + +
+
+
+Download Κατάλογοι - Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει τη Διαχείριση κλικ για να κατεβάσετε την λίστα σύνδεσμο στο κάτω μέρος της οθόνης μια λίστα τροποποίηση για την εξαγωγή του συνόλου του περιεχομένου του καταλόγου σε μια επίπεδη αρχείο δεδομένων. Η προεπιλογή είναι 0. + +
+
+
+Εξαγωγή Εκθέσεις - Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει την πρόσβαση του διευθυντή της εξαγωγής κλήση εκθέσεις σχετικά με τις εκθέσεις της οθόνης. Η προεπιλογή είναι 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 + + + @@ -2108,7 +2907,12 @@ echo "

-Ιστοσελίδα - Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυτήν την ομάδα. +Ιστοσελίδα - Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυτήν την ομάδα. Για να προσαρμόσετε το ερώτημα string μετά την ηλεκτρονική φόρμα, απλά αρχίζει την ηλεκτρονική φόρμα με VAR και στη συνέχεια τη διεύθυνση URL που θέλετε να χρησιμοποιήσετε, σε αντικατάσταση των μεταβλητών με τις ονομασίες των μεταβλητών που θέλετε να χρησιμοποιήσετε - Α - phone_number - Β -- όπως ακριβώς και στην καρτέλα scripts τμήμα. + +
+
+
+Web Μορφή Target- Αυτό είναι όπου μπορείτε να ρυθμίσετε το έθιμο ιστοσελίδα πλαίσιο ότι η ηλεκτρονική φόρμα θα ανοίξει όταν ο χρήστης κάνει κλικ στην ηλεκτρονική φόρμα κουμπί. Προεπιλεγμένο είναι _blank.
@@ -2125,99 +2929,264 @@ echo "
Ομάδες μεταφοράς - με αυτές τις λίστες τετραγωνιδίου μπορείτε ναεπιλέξετε τις ομάδες ότι οι πράκτορες σε αυτήν την εκστρατείαμπορούν να μεταφέρουν τις κλήσεις. Επιτρέψτε ότι Closersπρέπει να επιτραπεί για αυτήν την επιλογή να παρουσιάσει. -
- -
-Επιτρέψτε πλησίον και συνδύασε - αυτό είναι όπου μπορείτε ναθέσετε εάν οι χρήστες αυτής της εκστρατείας θα έχουν τηνεπιλογή να πάρουν τις εισερχόμενες κλήσεις με αυτήν τηνεκστρατεία. Εάν θέλετε να κάνετε συνδυασμένων εισερχόμενος καιεξερχόμενος έπειτα αυτό πρέπει να τεθεί το Υ. Εάν θέλετε μόνονα κάνετε τον εξερχόμενο σχηματισμό σε αυτήν την εκστρατείαθέστε αυτό σε Ν. Default είναι ν. + 0) + { + ?> +
+
+
+ Επιτρέψτε πλησίον και συνδύασε - αυτό είναι όπου μπορείτε ναθέσετε εάν οι χρήστες αυτής της εκστρατείας θα έχουν τηνεπιλογή να πάρουν τις εισερχόμενες κλήσεις με αυτήν τηνεκστρατεία. Εάν θέλετε να κάνετε συνδυασμένων εισερχόμενος καιεξερχόμενος έπειτα αυτό πρέπει να τεθεί το Υ. Εάν θέλετε μόνονα κάνετε τον εξερχόμενο σχηματισμό σε αυτήν την εκστρατείαθέστε αυτό σε Ν. Default είναι ν. -
-
-
-Κατάσταση Κλήσης - Εδώ ορίζετε τις καταστάσεις που θέλετε να κληθούν μέσα στις λίστες, οι οποίες είναι ενεργές για την εκστρατεία παρακάτω. Να προσθέσει μια άλλη θέση στον πίνακα, να το επιλέξει από τονεξελισσόμενους κατάλογο και τον κρότο ΠΡΟΣΘΕΤΕΙ. Για να αφαιρέσετεμια από τις θέσεις πινάκων, χτυπήστε στη REMOVE σύνδεση δίπλαστη θέση που θέλετε να αφαιρέσετε. +
+
+
+ Κατάσταση Κλήσης - Εδώ ορίζετε τις καταστάσεις που θέλετε να κληθούν μέσα στις λίστες, οι οποίες είναι ενεργές για την εκστρατεία παρακάτω. Να προσθέσει μια άλλη θέση στον πίνακα, να το επιλέξει από τονεξελισσόμενους κατάλογο και τον κρότο ΠΡΟΣΘΕΤΕΙ. Για να αφαιρέσετεμια από τις θέσεις πινάκων, χτυπήστε στη REMOVE σύνδεση δίπλαστη θέση που θέλετε να αφαιρέσετε. -
-
-
-Ταξινόμηση Λίστας - Σε αυτόν τον κατάλογο επιλογών μπορείτε να επιλέξετε πώς οι οδηγοί, που ταιριάζουν με τις καταστάσεις που επιλέξατε παραπάνω, θα τοποθετηθούν στον hopper: -
  - DOWN: επιλογή των πρώτων οδηγών που εισήχθησαν στον πίνακα vicidial_list -
  - UP: επιλογή των τελευταίων οδηγών που εισήχθησαν στον πίνακα vicidial_list -
  - UP PHONE: επιλογή του υψηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα κάτω -
  - DOWN PHONE: επιλογή του χαμηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα πάνω -
  - UP LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Ζ και συνεχίζει προς τα κάτω -
  - DOWN LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Α και συνεχίζει προς τα πάνω -
  - UP COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα κάτω -
  - DOWN COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει -
  - DOWN COUNT 2nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε άλλο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων -
  - DOWN COUNT 3nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τρίτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων -
  - DOWN COUNT 4th NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τέταρτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων +
+
+
+ Ταξινόμηση Λίστας - Σε αυτόν τον κατάλογο επιλογών μπορείτε να επιλέξετε πώς οι οδηγοί, που ταιριάζουν με τις καταστάσεις που επιλέξατε παραπάνω, θα τοποθετηθούν στον hopper: +
  - DOWN: επιλογή των πρώτων οδηγών που εισήχθησαν στον πίνακα vicidial_list +
  - UP: επιλογή των τελευταίων οδηγών που εισήχθησαν στον πίνακα vicidial_list +
  - UP PHONE: επιλογή του υψηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα κάτω +
  - DOWN PHONE: επιλογή του χαμηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα πάνω +
  - UP LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Ζ και συνεχίζει προς τα κάτω +
  - DOWN LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Α και συνεχίζει προς τα πάνω +
  - UP COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα κάτω +
  - DOWN COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει +
  - DOWN COUNT 2nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε άλλο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων +
  - DOWN COUNT 3nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τρίτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων +
  - DOWN COUNT 4th NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τέταρτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων -
-
-
-Επίπεδο Hopper - Αυτό είναι το πόσους οδηγούς η διαδικασία VDhopper, προσπαθεί να διατηρήσει στον πίνακα vicidial_hopper για αυτήν την εκστρατεία. Εάν η διαδικασία VDhopper τρέχει κάθε λεπτό, ρυθμίστε αυτό λίγο περισσότερο από τον αριθμό των οδηγών που περνούν σε ένα λεπτό. +
+
+
+ Επίπεδο Hopper - Αυτό είναι το πόσους οδηγούς η διαδικασία VDhopper, προσπαθεί να διατηρήσει στον πίνακα vicidial_hopper για αυτήν την εκστρατεία. Εάν η διαδικασία VDhopper τρέχει κάθε λεπτό, ρυθμίστε αυτό λίγο περισσότερο από τον αριθμό των οδηγών που περνούν σε ένα λεπτό. -
-
-
-Φίλτρο Οδηγοιύ - αυτή είναι μία μέθοδος για να δημιουργήτε φίλτρα για την SQL ερώτηση. Χρησιμοποιήστε αυτό το χαρακτηριστικό με προσοχή, είναι εύκολο να σταματήσει το σύστημα με μία μικρή αλλαγή στη δήλωση SQL. Η προεπιλογή είναι ΚΑΜΙΑ. +
+
+
+ Φίλτρο Οδηγοιύ - αυτή είναι μία μέθοδος για να δημιουργήτε φίλτρα για την SQL ερώτηση. Χρησιμοποιήστε αυτό το χαρακτηριστικό με προσοχή, είναι εύκολο να σταματήσει το σύστημα με μία μικρή αλλαγή στη δήλωση SQL. Η προεπιλογή είναι ΚΑΜΙΑ. -
-
-
-Υποχρεωτική Επαναφορά του Hopper - Αυτό σας επιτρέπει καθαρίσετε τα περιεχόμενα κατά την επιβεβαίωση της φόρμας. Αυτό θα συμβεί πάλι όταν η διαδικασία VDhopper θα τρέξει. +
+
+
+ Υποχρεωτική Επαναφορά του Hopper - Αυτό σας επιτρέπει καθαρίσετε τα περιεχόμενα κατά την επιβεβαίωση της φόρμας. Αυτό θα συμβεί πάλι όταν η διαδικασία VDhopper θα τρέξει. -
-
-
-Μέθοδος Κλήσης +
+
+
+ Μέθοδος Κλήσης - 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 Μέθοδος Κλήσης - 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. Δεν μπορείτε να αλλάξετε το επίπεδο Αυτόματης Κλήσης, εάν έχετε ορίσει κάποια μέθοδο Προσαρμογής Κλήσεων. Μόνο ο διακομιστής μπορεί να το αλλάξει όταν είναι σε διαδικασία αυτόματων κλήσεων. -. + is changed. If RATIO then the normal dialing a number of lines for Ενεργό 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. Δεν μπορείτε να αλλάξετε το επίπεδο Αυτόματης Κλήσης, εάν έχετε ορίσει κάποια μέθοδο Προσαρμογής Κλήσεων. Μόνο ο διακομιστής μπορεί να το αλλάξει όταν είναι σε διαδικασία αυτόματων κλήσεων. +. Εισερχόμενα_MAN επιτρέπει στον αντιπρόσωπο να πραγματοποιηθεί χειροκίνητη κλήση κλήσεις από μια εκστρατεία λίστα, ενώ είναι σε θέση να λάβει εισερχόμενη κλήση κλήσεις μεταξύ εγχειρίδιο κλήσεις. -
-
-
-Επίπεδο Αυτόματης Κλήσης - Εδώ είναι που καθορίζεται πόσες γραμμές θα χρησιμοποιούνται ανά ενεργό χρήστη. Μηδέν (0) σημαίνει ότι η αυτόματη κλήση είναι μη ενεργή και οι χρήστες πατούν το πλήκτρο για την κλήση κάθε αριθμού. Διαφορετικά, το σύστημα καλεί γραμμές ίσες με τους ενεργούς χρήστες, πολλαπλασιασμένους με το επίπεδο κλήσης και σύμφωνα με το πόσες γραμμές η εκστρτεία σε κάθε διακομιστή επιτρέπει. Το ADAPT τετραγωνίδιο ΣΥΜΠΛΗΡΩΜΑΤΙΚΗΣ ΠΡΟΜΉΘΕΙΑΣ επιτρέπει σεσας για να αναγκάσει ένα νέο επίπεδο πινάκων ακόμα κι αν ημέθοδος πινάκων είναι σε έναν ADAPT τρόπο. Αυτό είναιχρήσιμο εάν υπάρχει μια δραματική μετατόπιση στην ποιότητα τωνμολύβδων και θέλετε να αλλάξετε δραστικά το dial_level με τοχέρι. +
+
+
+ Επίπεδο Αυτόματης Κλήσης - Εδώ είναι που καθορίζεται πόσες γραμμές θα χρησιμοποιούνται ανά ενεργό χρήστη. Μηδέν (0) σημαίνει ότι η αυτόματη κλήση είναι μη ενεργή και οι χρήστες πατούν το πλήκτρο για την κλήση κάθε αριθμού. Διαφορετικά, το σύστημα καλεί γραμμές ίσες με τους ενεργούς χρήστες, πολλαπλασιασμένους με το επίπεδο κλήσης και σύμφωνα με το πόσες γραμμές η εκστρτεία σε κάθε διακομιστή επιτρέπει. Το ADAPT τετραγωνίδιο ΣΥΜΠΛΗΡΩΜΑΤΙΚΗΣ ΠΡΟΜΉΘΕΙΑΣ επιτρέπει σεσας για να αναγκάσει ένα νέο επίπεδο πινάκων ακόμα κι αν ημέθοδος πινάκων είναι σε έναν ADAPT τρόπο. Αυτό είναιχρήσιμο εάν υπάρχει μια δραματική μετατόπιση στην ποιότητα τωνμολύβδων και θέλετε να αλλάξετε δραστικά το dial_level με τοχέρι. -
-
-
-Διαθέσιμα μόνο ετικέτες - Εάν θέσετε σε Ν αυτό το πεδίο, θα αφήσει εκτός τις καταστάσεις των χειριστών out INCALL και QUEUE, καθώς υπολογίζεται ο αριθμός των κλήσεων όταν δεν είναι σε κατάσταση κλήσης MANUAL. Προκαθορισμένα είναι Ο. +
+
+
+ Διαθέσιμα μόνο ετικέτες - Εάν θέσετε σε Ν αυτό το πεδίο, θα αφήσει εκτός τις καταστάσεις των χειριστών out INCALL και QUEUE, καθώς υπολογίζεται ο αριθμός των κλήσεων όταν δεν είναι σε κατάσταση κλήσης MANUAL. Προκαθορισμένα είναι Ο. -
-
-
-Ποσοστό Ορίου Εγκατ. Κλήσεων - Σε αυτό το πεδίο μπορείτε να θέσετε το όριο του ποσοστού εγκατ. κλήσεων καθώς χρησιμοποιείτε μία μέθοδος προσαρμοσμένης-πρόβλεψη κλήσεων, όχι MANUAL ή RATIO. +
+
+
+ Ποσοστό Ορίου Εγκατ. Κλήσεων - Σε αυτό το πεδίο μπορείτε να θέσετε το όριο του ποσοστού εγκατ. κλήσεων καθώς χρησιμοποιείτε μία μέθοδος προσαρμοσμένης-πρόβλεψη κλήσεων, όχι MANUAL ή RATIO. -
-
-
-Μέγιστο Επίπεδο Προσαρμογής Κλήσεων - Σε αυτό το πεδίο μπορείτε να θέσετε το όριο για το όριο του αριθμού γραμμών για κάθε χειριστή καθώς χρησιμοποιείτε μία μέθοδος προσαρμοσμένης-πρόβλεψη κλήσεων, όχι MANUAL ή RATIO. Αυτός ο αριθμός μπορεί να είναι μεγαλύτερος από το επίπεδο αυτόματης κλήσης εάν το υλικό σας το υποστηρίζει. Η τιμή πρέπει να είναι θετικός αριθμός μεγαλύτερος από ένα και μπορεί να έχει δεκαδικά. Προκαθορισμένα είναι 3.0. +
+
+
+ Μέγιστο Επίπεδο Προσαρμογής Κλήσεων - Σε αυτό το πεδίο μπορείτε να θέσετε το όριο για το όριο του αριθμού γραμμών για κάθε χειριστή καθώς χρησιμοποιείτε μία μέθοδος προσαρμοσμένης-πρόβλεψη κλήσεων, όχι MANUAL ή RATIO. Αυτός ο αριθμός μπορεί να είναι μεγαλύτερος από το επίπεδο αυτόματης κλήσης εάν το υλικό σας το υποστηρίζει. Η τιμή πρέπει να είναι θετικός αριθμός μεγαλύτερος από ένα και μπορεί να έχει δεκαδικά. Προκαθορισμένα είναι 3.0. -
-
-
-Τελευταίος Χρόνος Διακομιστή - Αυτό το πεδίο χρησιμοποιείτε μόνο από την μέθοδο ADAPT_TAPERED. Θα πρέπει να καταχωρήσετε την ώρα και τα λεπτά που θα σταματήσει τις κλήσεις η εκστρατεία. Αυτό επιτρέπει στον αλγόριθμο να αποφασίσει πόσο επιθετικά θα κάνει κλήσεις και πόσο χρόνο. +
+
+
+ Τελευταίος Χρόνος Διακομιστή - Αυτό το πεδίο χρησιμοποιείτε μόνο από την μέθοδο ADAPT_TAPERED. Θα πρέπει να καταχωρήσετε την ώρα και τα λεπτά που θα σταματήσει τις κλήσεις η εκστρατεία. Αυτό επιτρέπει στον αλγόριθμο να αποφασίσει πόσο επιθετικά θα κάνει κλήσεις και πόσο χρόνο. -
-
-
-Ενταση Τροποποίησης Προσαρμογής - Αυτό το πεδίο χρησιμοποιείτε για να αλλάζει ένταση προβλέψεων είτε υψηλότερα ή χαμηλότερα. Προκαθορισμένα είναι 0. Αυτό το πεδίο δεν χρησιμοποιείται από τις μεθόδους MANUAL ή RATIO. +
+
+
+ Ενταση Τροποποίησης Προσαρμογής - Αυτό το πεδίο χρησιμοποιείτε για να αλλάζει ένταση προβλέψεων είτε υψηλότερα ή χαμηλότερα. Προκαθορισμένα είναι 0. Αυτό το πεδίο δεν χρησιμοποιείται από τις μεθόδους MANUAL ή RATIO. -
-
-
-Επίπεδο Κλήσεων Μεταβολής Στόχου - Αυτό το πεδίο χρησιμοποιείτε για να έχει στόχο ένα συγκεκριμένο αριθμό χειριστών να περιμένουν κλήσεις ή κλήσεις να περιμένουν για χειριστές. Π.χ. εάν θέλετε πάντα να έχετε κατά μέσο όρο έναν χειριστή ελεύθερο για ν παίρνει τις κλήσεις, τότε πρέπει να το θέσετε σε -1. Εάν στόχος είναι να έχετε πάντα μία κλήση σε αναμονή για ένα χειριστή, τότε πρέπει να το θέσετε σε 1. Προκαθορισμένα είναι 0. Αυτό το πεδίο δεν χρησιμοποιείται από τις μεθόδους MANUAL ή RATIO. +
+
+
+ Επίπεδο Κλήσεων Μεταβολής Στόχου - Αυτό το πεδίο χρησιμοποιείτε για να έχει στόχο ένα συγκεκριμένο αριθμό χειριστών να περιμένουν κλήσεις ή κλήσεις να περιμένουν για χειριστές. Π.χ. εάν θέλετε πάντα να έχετε κατά μέσο όρο έναν χειριστή ελεύθερο για ν παίρνει τις κλήσεις, τότε πρέπει να το θέσετε σε -1. Εάν στόχος είναι να έχετε πάντα μία κλήση σε αναμονή για ένα χειριστή, τότε πρέπει να το θέσετε σε 1. Προκαθορισμένα είναι 0. Αυτό το πεδίο δεν χρησιμοποιείται από τις μεθόδους MANUAL ή RATIO. -
-
-
-Ταυτόχρονες μεταφορές - αυτή η ρύθμιση χρησιμοποιείται για νακαθορίσει τον αριθμό κλήσεων που μπορεί να σταλεί στουςπράκτορες συγχρόνως. Συνιστάται αυτή η ρύθμιση να αφήνεται στοΑΥΤΟΚΙΝΗΤΟ. Αυτός ο τομέας δεν χρησιμοποιείται με τη ΧΕΙΡΩΝΑΚΤΙΚΗμέθοδο πινάκων. +
+
+
+ Ταυτόχρονες μεταφορές - αυτή η ρύθμιση χρησιμοποιείται για νακαθορίσει τον αριθμό κλήσεων που μπορεί να σταλεί στουςπράκτορες συγχρόνως. Συνιστάται αυτή η ρύθμιση να αφήνεται στοΑΥΤΟΚΙΝΗΤΟ. Αυτός ο τομέας δεν χρησιμοποιείται με τη ΧΕΙΡΩΝΑΚΤΙΚΗμέθοδο πινάκων. -
-
-
-Αυτόματος ALT-ARJCMO'S που σχηματίζει - αυτή η ρύθμισηχρησιμοποιείται για να σχηματίσει αυτόματα τους εναλλάσσομαιτομείς αριθμού σχηματίζοντας σε ΑΝΑΛΟΓΙΑ και ΝΑ ΠΡΟΣΑΡΜΟΣΕΙ τιςμεθόδους πινάκων όταν δεν υπάρχει καμία επαφή στον κύριοτηλεφωνικό αριθμό για έναν μόλυβδο, τις θέσεις NA, β,συνεχούς ρεύματος και ν. Αυτή η ρύθμιση δεν χρησιμοποιείται με τηΧΕΙΡΩΝΑΚΤΙΚΗ μέθοδο πινάκων. +
+
+
+ Κοτσίδας Προτεραιότητα - Αυτή η ρύθμιση χρησιμοποιείται για να καθορίσει τη σειρά με την οποία οι εξερχόμενες κλήσεις από αυτή την εκστρατεία θα πρέπει να απαντηθούν σε σχέση με τις εισερχόμενες κλήσεις αν η συγκεκριμένη καμπάνια είναι αναμεμειγμένο σε λειτουργία. + +
+
+
+ Αυτόματος ALT-ARJCMO'S που σχηματίζει - αυτή η ρύθμισηχρησιμοποιείται για να σχηματίσει αυτόματα τους εναλλάσσομαιτομείς αριθμού σχηματίζοντας σε ΑΝΑΛΟΓΙΑ και ΝΑ ΠΡΟΣΑΡΜΟΣΕΙ τιςμεθόδους πινάκων όταν δεν υπάρχει καμία επαφή στον κύριοτηλεφωνικό αριθμό για έναν μόλυβδο, τις θέσεις NA, β,συνεχούς ρεύματος και ν. Αυτή η ρύθμιση δεν χρησιμοποιείται με τηΧΕΙΡΩΝΑΚΤΙΚΗ μέθοδο πινάκων. EXTENDED αναπληρωματικών αριθμοί είναι αριθμοί που φορτώνονται στο σύστημα εκτός του κανονικού οδηγήσει πληροφορίες οθόνης. Χρησιμοποιώντας EXTENDED σας μπορεί να έχει εκατοντάδες αριθμούς τηλεφώνου για ένα μόνο πελάτη ρεκόρ. + +
+
+
+ Κλήση Εκτός Χρόνου - άν έχει οριστεί, οι κλήσεις που φυσιολογικά θα έκλειναν μετά το χρόνο που έχει οριστεί στο extensions.conf, θα κλείσουν σε αυτόν τον χρόνο εάν είναι μικρότερος του extensions.conf. Αυτό επιτρέπει στην γρήγορη αλλαγή των χρόνων από διακομιστή σε διακομιστή και περιορίζοντας τα αοτελέσματα σε μία εκστρατεία. Εάν έχετε πολλές κλήσεις με Αυτόματους Τηλεφωνητές ή Φωνητικών Ταχυδρομείων, μπορείτε να αλλάξετε αυτή την τιμή μεταξύ 21-26 και να δείτε αν τα αποτελέσματα είναι καλύτερα. + +
+
+
+ Καμπάνια VDAD επέκταση - Το πεδίο αυτό επιτρέπει για μια προσαρμοσμένη VDAD μεταφορά επέκταση. Αυτό σας επιτρέπει να χρησιμοποιήσετε διάφορες μεθόδους χειρισμού κλήσεων, ανάλογα με την καμπάνια σας. +- 8364 - 8368 ως ίδια +- 8365 - Θα στείλετε την πρόσκληση σε ένα μόνο παράγοντα στον ίδιο διακομιστή, όπως είναι η πρόσκληση για +- 8366 - Χρησιμοποιείται για Τύπο-1 εκστρατείες και έρευνα +- 8367 - Θα προσπαθήσουμε πρώτα να στείλετε την πρόσκληση σε έναν πράκτορα για τον τοπικό διακομιστή, τότε θα ψάξει για άλλους servers + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on +- 8369 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση ότι μετά, ίδια συμπεριφορά ως 8368 +- 8373 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση μετά την ίδια συμπεριφορά ως 8366 + +
+
+
+ Μήνυμα αυτόματου τηλεφωνητού - αυτός το πεδίο χρησιμοποιείτε για τις τυφλές κλήσεις μεταφοράς όταν παίρνει ο χειριστής έναν αυτόματο τηλεφωνητή και χτυπά στο πλήκτρο μηνυμάτων αυτόματων τηλεφωνητών στο πλαίσιο διασκέψεων μεταφοράς. Πρέπει το θέσετε αυτό στο dial plan - extensions.conf - και σιγουρευτείτε ότι παίζει ένα αρχείο μουσικής κατόπιν κλείνει το τηλέφωνο. + +
+
+
+ AMD στέλνει στο VM - αυτές οι επιλογές επιτρέπουν να καθορίσετε εάν ένα μήνυμα αφήνεται σε έναν αυτόματο τηλεφωνητή όταν ανιχνεύεται ότι η κλήση είναι ένας αυτόματος τηλεφωνητής και εάν το AMD είναι ενεργό. + +
+
+
+ CPD AMD Δράση - Αν χρησιμοποιείτε τον Sangoma ParaXip Πρόσκληση πρόοδος Ανίχνευση λογισμικό και στη συνέχεια θα θέλετε να ενεργοποιήσετε αυτή τη ρύθμιση, είτε να DISPO που θα διαθέσεις την πρόσκληση ως AA και να κολλήσει το πάνω αν η πρόσκληση είναι υπό επεξεργασία και δεν έχει σταλεί σε έναν πράκτορα ή ακόμη μήνυμα που θα αποστείλει την πρόσκληση προς το τηλεφωνητή Μήνυμα ορίζεται για αυτή την καμπάνια. Προεπιλεγμένο είναι DISABLED. + +
+
+
+ Κλήση Εναλ Αρ Χρήστη - Αυτή η επιλογή επιτρέπει στον χειριστή να κάνει χειροκίνητη κλήση του εναλλακτικού αριθμού τηλεφώνου ή το πεδίο address3 μετά την κλήση του κυρίου αριθμού. + +
+
+
+ Δευτερ. Εγκαταλ. Κλήσης - Ο αριθμός των δευτερολέπτων από την στιγμή που ο πελάτης σηκώνει το τηλ μέχρι η κλήση να θεωρηθεί εγκαταλειμένη. Μόνο για εξερχόμενες κλήσεις . + +
+
+
+ Drop δράσης - Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα Inbound που καθορίζονται κατωτέρω + +
+
+
+ Εσωτ.σύνδεση Ασφαλούς Φύλαξης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Ασφαλής Φύλαξης στον διακομιστή. + +
+
+
+ Φωνητικό Ταχυδρομείο - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα ΕΓΚΑΤΑΛΕΙΠΟΝΤΑΝ, θα κατευθυνθούν σε αυό το φωνητικό ταχυδρομείο, ώστε να ακούσετε και να αφήσετε ένα μήνυμα. + +
+
+
+ Drop Μεταφορά Όμιλος - Αν Drop Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα εάν ανέρχεται Drop Call Δευτερόλεπτα. + +
+
+
+ Επιτρέψτε τους κανένας-χοάνη-μολύβδους Logins - εάν θέστε τοΥ, επιτρέπει στους πράκτορες στη σύνδεση στην εκστρατεία ακόμα κιαν δεν υπάρχει κανένας μόλυβδος που φορτώνεται στη χοάνη γιαεκείνη την εκστρατεία. Αυτή η λειτουργία δεν απαιτείται στιςεκστρατείες στενός-τύπων. Η προεπιλογή είναι ν. + +
+
+
+ Μίγμα διαταγής καταλόγων - αγνοεί τους τομείς θέσης διαταγήςκαι πινάκων μολύβδου. Θα χρησιμοποιήσει τις παραμέτρους καταλόγωνκαι θέσης για την επιλεγμένη είσοδο μιγμάτων καταλόγων στο υπο-τμήμα μιγμάτων καταλόγων αντ' αυτού. Η προεπιλογή είναι ΕΚΤΟΣΛΕΙΤΟΥΡΓΊΑΣ. + +
+
+
+ Ταυτότητα μιγμάτων καταλόγων - ταυτότητα του μίγματος καταλόγων.Πρέπει να είστε από 2-20 χαρακτήρες στο μήκος χωρίς ταδιαστήματα ή άλλη ειδική στίξη. + +
+
+
+ Όνομα μιγμάτων καταλόγων - περιγραφικό όνομα του μίγματοςκαταλόγων. Πρέπει να είστε από 2-50 χαρακτήρες στο μήκος. + +
+
+
+ Λεπτομέρεια μιγμάτων καταλόγων - η σύνθεση της εισόδου μιγμάτωνκαταλόγων. Περιέχει τον κατάλογο ταυτότητα, τη διαταγή μιγμάτων,τα ποσοστά και τις θέσεις που αποτελούν αυτό το μίγμα καταλόγων.Τα ποσοστά πρέπει πάντα να προσθέσουν μέχρι 100, και οικατάλογοι όλοι πρέπει να είναι ενεργοί και καθορισμένοι τηνεκστρατεία για την είσοδο μιγμάτων διαταγής που ενεργοποιείται. + +
+
+
+ Μέθοδος μιγμάτων καταλόγων - η μέθοδος όλα τα μέρη τηςλεπτομέρειας μιγμάτων καταλόγων από κοινού. EVEN_MIX θααναμίξει τους μολύβδους από κάθε μέρος που παρεμβάλλεται λευκέςσελίδες με τα άλλα μέρη, όπως αυτό το 1,2,3,1,2,3,1,2,3.IN_ORDER θα βάλει τους μολύβδους στη διαταγή στην οποίαπαρατίθενται στην οθόνη λεπτομέρειας μιγμάτων καταλόγων1,1,1,2,2,2,3,3,3. ΤΥΧΑΊΑ θα τους βάλουν στην ΤΥΧΑΊΑ προεπιλογήδιαταγής 1,3,2,1,1,3,2,1,3. είναι IN_ORDER. + +
+
+
+ Agent Screen Εκτεταμένη Alt Dial - Αυτό το χαρακτηριστικό επιτρέπει σε υπαλλήλους να επεκταθεί η πρόσβαση των αναπληρωματικών τους αριθμούς τηλεφώνου για οδηγεί πέρα από την κανονική Alt τηλέφωνο και Address3 τομείς που μπορούν να χρησιμοποιηθούν σε VICIDIAL για αριθμούς τηλεφώνου πέραν της κύριας αριθμό τηλεφώνου. Η παράταση μπορεί να είναι αριθμοί τηλεφώνου κλήσης αυτόματα χρησιμοποιώντας το πρόγραμμα Auto-Alt-Dial χαρακτηριστικό στο VICIDIAL ρυθμίσεις της καμπάνιας, αλλά αυτό που επιτρέπει Agent Screen χαρακτηριστικό θα επιτρέψει επίσης τον αντιπρόσωπο για να καλέσετε τους αριθμούς αυτούς από τους πράκτορα οθόνη, καθώς και να επεξεργαστούν τις πληροφορίες. + +
+
+
+ Έρευνα Πρώτο αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται από τη στιγμή που ο πελάτης παραλαμβάνει το τηλέφωνο όταν τρέχει μια έρευνα καμπάνια. + +
+
+
+ Έρευνα DTMF Digits - Αυτό το πεδίο όπου θα καθοριστούν οι θέσεις ότι ο πελάτης μπορεί να πατήσει ως επιλογή για μια έρευνα της καμπάνιας. ψηφία DTMF είναι έγκυρο0123456789*# + +
+
+
+ Έρευνα δεν ενδιαφέρεται Digit - Αυτό το πεδίο όπου θα καθορίσει ο πελάτης ψηφίο πιεστεί θα δείτε ότι δεν ενδιαφέρονται. + +
+
+
+ Έρευνα δεν ενδιαφέρεται Status - Το πεδίο αυτό είναι που έχετε επιλέξει το καθεστώς που θα χρησιμοποιηθεί για δεν ενδιαφέρεται. DNC Εάν χρησιμοποιείται και η καμπάνια είναι ρυθμισμένη να χρησιμοποιεί DNC στη συνέχεια τον αριθμό τηλεφώνου, θα προστίθεται αυτόματα στο VICIDIAL εσωτερική DNC λίστα.και πιθανώς η εκστρατεία ειδικά DNC λίστα. + +
+
+
+ Έρευνα Opt-σε αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται όταν ο πελάτης έχει επιλέξει-in με την έρευνα, δεν επέλεξε-ή που δεν απάντησαν και αν η μη ανταπόκριση ενέργεια έχει οριστεί σε OptOut. Μετά από αυτό το αρχείο ήχου παίζεται, η μέθοδος έρευνας δράση. + +
+
+
+ Έρευνα δεν ενδιαφέρεται αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται όταν ο πελάτης έχει επιλέξει-από την έρευνα, δεν επέλεξε-ή σε περίπτωση που δεν απαντήσει η μη ανταπόκριση ενέργεια έχει οριστεί σε OptIn. Μετά από αυτό το αρχείο ήχου παίζεται, η πρόσκληση θα είναι ανηρτημένα. + +
+
+
+ Μέθοδος Έρευνα - Αυτή η επιλογή καθορίζει τι θα συμβεί σε μια κλήση μετά ο πελάτης επέλεξε-in. AGENT_XFER θα αποστείλει την πρόσκληση για το επόμενο διαθέσιμο πράκτορα. Τηλεφωνητής θα αποστείλει την πρόσκληση προς το τηλεφωνητή θέση που καθορίζεται στο Τηλεφωνητής τομέα. ΕΠΕΚΤΑΣΗ θα στείλει ο πελάτης με την παράταση που ορίζεται στην έκθεση Xfer Επέκταση τομέα. HANGUP θα κλείσεις τον πελάτη. CAMPREC_60_WAV θα στείλει ο πελάτης να έχουμε μια καταγραφή που γίνεται με τους απάντηση, η καταγραφή αυτή θα πρέπει να τοποθετούνται σε ένα φάκελο με το όνομα, όπως η εκστρατεία στο εσωτερικό της καμπάνιας Έρευνα Καταγραφή Directory. + +
+
+
+ Έρευνα της μη αντίδρασης Δράση - Αυτό είναι που σας καθορίζουν τι θα συμβεί αν δεν υπάρχει απάντηση στο ερώτημα της έρευνας. OptIn θα στείλει την πρόσκληση για την Έρευνα για την μέθοδο και αν ο πελάτης θα πατήσει το ψηφίο DTMF. OptOut θα στείλει ο πελάτης για να μέθοδος έρευνας, ακόμα και εάν δεν πιέσετε ένα ψηφίο DTMF. + +
+
+
+ Έρευνα Απάντηση Digit Map - Αυτό είναι το σημείο όπου μπορείτε να ορίσετε μια περιγραφή για να πάνε με κάθε ψηφίο DTMF επιλογή που ο πελάτης μπορεί να επιλέξει. + +
+
+
+ Έρευνα Xfer Επέκταση - , εάν η έρευνα Μέθοδος ΕΠΕΚΤΑΣΗ είναι επιλεγμένο τότε ο πελάτης θα πρέπει να απευθύνεται έκκληση για την επέκταση αυτής της dialplan. + +
+
+
+ Έρευνα Καμπάνια Καταγραφή Directory - Εάν η μέθοδος έρευνας της CAMPREC_60_WAV είναι επιλεγμένο, τότε η αντίδραση των πελατών θα πρέπει να καταχωρούνται και να τοποθετούνται σε έναν κατάλογο το όνομα του από την εκστρατεία στο εσωτερικό αυτού του καταλόγου. + +
@@ -2235,11 +3204,6 @@ echo "
Τοπική Ωρα Κλήσης - Εδώ, μπορείτε να ορίσετε τις ώρες που θα θέλατε να γίνουν οι κλήσεις. Αυτό ελέγχετε από τον κωδικό περις και ρυθμίζεται για Daylight Savings εάν είναι εφαρμόσιμο. -
- -
-Κλήση Εκτός Χρόνου - άν έχει οριστεί, οι κλήσεις που φυσιολογικά θα έκλειναν μετά το χρόνο που έχει οριστεί στο extensions.conf, θα κλείσουν σε αυτόν τον χρόνο εάν είναι μικρότερος του extensions.conf. Αυτό επιτρέπει στην γρήγορη αλλαγή των χρόνων από διακομιστή σε διακομιστή και περιορίζοντας τα αοτελέσματα σε μία εκστρατεία. Εάν έχετε πολλές κλήσεις με Αυτόματους Τηλεφωνητές ή Φωνητικών Ταχυδρομείων, μπορείτε να αλλάξετε αυτή την τιμή μεταξύ 21-26 και να δείτε αν τα αποτελέσματα είναι καλύτερα. -

@@ -2255,11 +3219,6 @@ echo "
CallerID Εκστρατείας - Αυτός ο τομέας επιτρέπει την αποστολή ενός αριθμού συνήθειας callerid στις εξερχόμενες κλήσεις. Αυτό είναι ο αριθμός που θα παρουσίαζε στο callerid του προσώπου που καλείτε. Η προεπιλογή είναι ΑΓΝΩΣΤΗ. Εάν χρησιμοποιείτε το T1 ή Eί να σχηματίσει έξω αυτήν την επιλογή είναι μόνο διαθέσιμος εάν χρησιμοποιετε PRIs - ISDN Tί ή Eί - που ανοίγουν το χαρακτηριστικό γνώρισμα συνήθειας callerid, αυτό δεν θα λειτουργήσει με την υπηρεσία ληστεύω-κομματιών - RBS - κυκλώματα. Αυτό θα λειτουργήσει επίσης μέσω του περισσότερου VOIP - ΓΟΥΛΙΑ ή κορμοί IAX - προμηθευτές που επιτρέπουν δυναμικό εξερχόμενο callerID. Η σνήθεια callerID ισχύει μόνο για τις κλήσεις που τοποθετούνται για την εκστρατεία VICIDIAL άμεσα, οποιεσδήποτε κλήσεις ή μεταφορές 3$ων συμβαλλόμενων μερών δεν θα στείλουν τη συνήθεια callerID. ΣΗΜΕΙΩΣΗ: Μερικές φορές να βάλει ΑΓΝΩΣΤΗ ή ΙΔΙΩΤΙΚΗ στον τομέα θα παραγάγει την αποστολή του αριθμού προεπιλογής σας callerID από το μεταφορέα σας με τις κλήσεις. Μπορείτε να θελήσετε να εξετάσετε αυτό και να υποβάλετε 0000000000 ο τομέας callerid αντ' αυτού εάν δεν θέλετε να σας στείλετε CallerID. -
- -
-Τηλ.Σύνδεση Εκστρατείας VDAD - Αυτό το πεδίο επιτρέπει γαι μία προσαρμόσιμη VDAD εσωτ.σύνδεση μεταφοράς. Αυτό σας επιτρέπει να χρησιμοποιήσετε διαφορετικές διαδικασίες VDADtransfer.agi, σύμφωνα με την κστρατεία. Η προκαθορισμένη AGI μεταφορά - εσωτ.σύνδ. 8365 agi VDADtransfer.agi - στέλνει αμέσως τις κλήσεις στον χρήστη, μόλις το σηκώσουν. Ενα πρόσθετο AGI παράεα πολιτικής έρευνας συμπεριλαμβάνεται - 8366 agi - VDADtransferSURVEY.agi - όπου παίζει ένα μήνυμα στο κληθέν πρόσωπο και επιτρέπει να κάνουν επιλογς με τα πλήκτρα. -

@@ -2290,51 +3249,16 @@ echo "
Κατά την έναρξη κλήσης - αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μεάβαση στον Βοηθό ή τίποτα. -
- -
-Μήνυμα αυτόματου τηλεφωνητού - αυτός το πεδίο χρησιμοποιείτε για τις τυφλές κλήσεις μεταφοράς όταν παίρνει ο χειριστής έναν αυτόματο τηλεφωνητή και χτυπά στο πλήκτρο μηνυμάτων αυτόματων τηλεφωνητών στο πλαίσιο διασκέψεων μεταφοράς. Πρέπει το θέσετε αυτό στο dial plan - extensions.conf - και σιγουρευτείτε ότι παίζει ένα αρχείο μουσικής κατόπιν κλείνει το τηλέφωνο. - -
-
-
-AMD στέλνει στο VM - αυτές οι επιλογές επιτρέπουν να καθορίσετε εάν ένα μήνυμα αφήνεται σε έναν αυτόματο τηλεφωνητή όταν ανιχνεύεται ότι η κλήση είναι ένας αυτόματος τηλεφωνητής και εάν το AMD είναι ενεργό. -

Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. Εάν θέλετε να επιτρέψετε τις μεταφορές σε σύμβουλο, ενός fronter σε έναν closer, θα πρέπει να θέσετε CXFER στο πεδίο number-to-dial και το σωστό κείμενο κλήσης θα σταλεί να κάνει μία τοπική μεταφορά σε σύμβουλο. Καθώς η κλήση θα απαντηθεί, μπορείτε να αφήσετε το πελάτη με τον χειριστή closer και να συνεχίσετε στην επόμενη κλήση πατώντας το πλήκτρο ΑΠΟΧΩΡΗΣΗ 3μελής ΚΛΗΣΗΣ. Εάν θέλετε να μεταφέρετε τους πελάτες σε AGI διαδικασία ή σε IVR, τότε θα πρέπει να θέσετε AXFER στο πεδίο number-to-dial. Μπορείτε επίσης να θέσετε και μία προσωπική τηλ. σύνδεση μετά το AXFER ή CXFER. -
-
-
-Κλήση Εναλ Αρ Χρήστη - Αυτή η επιλογή επιτρέπει στον χειριστή να κάνει χειροκίνητη κλήση του εναλλακτικού αριθμού τηλεφώνου ή το πεδίο address3 μετά την κλήση του κυρίου αριθμού. -

Προγραμματισμένες Επανακλήσεις - Αυτή η επιλογή επιτρέπει στον χειριστή να τερματίσει μία κλήση ως CALLBK και να επιλέξει τα δεδομένα και την ώρα κατά την οποία ο οδηγός θα ξανα-ενεργοποιηθεί. -
-
-
-Δευτερ. Εγκαταλ. Κλήσης - Ο αριθμός των δευτερολέπτων από την στιγμή που ο πελάτης σηκώνει το τηλ μέχρι η κλήση να θεωρηθεί εγκαταλειμένη. Μόνο για εξερχόμενες κλήσεις . - -
-
-
-Φωνητικό Ταχυδρομείο - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα ΕΓΚΑΤΑΛΕΙΠΟΝΤΑΝ, θα κατευθυνθούν σε αυό το φωνητικό ταχυδρομείο, ώστε να ακούσετε και να αφήσετε ένα μήνυμα. - -
-
-
-Μήνυμα Ασφαλούς Φύλαξης - Εάν είναι Υ θα παίξει ένα μήνυμα στον πελάτη μετά το πέρας των δευτερολέπτων ασφαλούς εγκατάλειψης, χωρίς να μεταφερθεί σε ένν χειριστή. Αυτή η επιλογή υπερβαίνει την αποστολή σε θυρίδα ηχητικού μηνύματος εάν είναι Υ. - -
-
-
-Εσωτ.σύνδεση Ασφαλούς Φύλαξης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Ασφαλής Φύλαξης στον διακομιστή. -

@@ -2350,6 +3274,11 @@ echo "
Εσωτερικός κατάλογος DNC χρήσης - αυτό καθορίζει εάν αυτή ηεκστρατεία είναι στους μολύβδους φίλτν ενάντια στον εσωτερικόκατάλογο DNC. Εάν τίθεται το Υ, η χοάνη θα ψάξει κάθετηλεφωνικό αριθμό στον κατάλογο DNC πρίν τοποθετεί τον στηχοάνη. Εάν είναι στον κατάλογο DNC έπειτα θα αλλάξει ότιθέση μολύβδου σε DNCL έτσι που δεν μπορεί να σχηματιστεί. Ηπροεπιλογή είναι ν. +
+ +
+Χρησιμοποίησε Καμπάνια DNC List - Αυτό καθορίζει αν αυτό είναι η εκστρατεία εναντίον ενός φίλτρου οδηγεί DNC λίστα που είναι ειδικά για τη συγκεκριμένη καμπάνια μόνο. Αν είναι να Y, η χοάνη θα εξετάσει, για κάθε αριθμό τηλεφώνου στον αγώνα-ειδικά DNC λίστα πριν από την τοποθέτησή του στην χοάνη. Αν είναι στην εκστρατεία ειδικά DNC λίστα τότε θα αλλάξει το καθεστώς που οδηγούν σε DNCC έτσι δεν μπορεί να εξερχόμενων. Προεπιλεγμένο είναι Ν. +

@@ -2358,7 +3287,7 @@ echo "

-Η μικρή διακοπή πρακτόρων κωδικοποιεί ενεργό - επιτρέπει στουςπράκτορες για να επιλέξει έναν κώδικα μικρής διακοπής ότανχτυπούν στο κουμπί ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ στους κώδικες μικρής διακοπήςvicidial.php. είναι ευπροσδιόριστοι ανά εκστρατεία στοκατώτατο σημείο της οθόνης λεπτομέρειας άποψης εκστρατείας καιαποθηκεύονται στον πίνακα vicidial_agent_log. Η προεπιλογήείναι ν. +Η μικρή διακοπή πρακτόρων κωδικοποιεί ενεργό - επιτρέπει στουςπράκτορες για να επιλέξει έναν κώδικα μικρής διακοπής ότανχτυπούν στο κουμπί ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ στους κώδικες μικρής διακοπήςvicidial.php. είναι ευπροσδιόριστοι ανά εκστρατεία στοκατώτατο σημείο της οθόνης λεπτομέρειας άποψης εκστρατείας καιαποθηκεύονται στον πίνακα vicidial_agent_log. Η προεπιλογήείναι ν. ΙΣΧΥΟΝΤΑ θα ισχύουν οι παράγοντες να επιλέγουν μια παύση κωδικό αν κάντε κλικ στο κουμπί PAUSE.
@@ -2366,40 +3295,113 @@ echo "
Θέστε εκτός λειτουργίας αλλάζει τα στοιχεία πελατών - εάνθέστε το Υ, δεν αλλάζει οποιων δήποτε από το αρχείο στοιχείωνπελατών όταν διαθέσεις πρακτόρων η κλήση. Η προεπιλογή είναι ν.
- +
-Επιτρέψτε τους κανένας-χοάνη-μολύβδους Logins - εάν θέστε τοΥ, επιτρέπει στους πράκτορες στη σύνδεση στην εκστρατεία ακόμα κιαν δεν υπάρχει κανένας μόλυβδος που φορτώνεται στη χοάνη γιαεκείνη την εκστρατεία. Αυτή η λειτουργία δεν απαιτείται στιςεκστρατείες στενός-τύπων. Η προεπιλογή είναι ν. +Απενεργοποίηση Alter Πελατών τηλέφωνο - Σε περίπτωση που σε Y, δεν αλλάζει ο πελάτης τον αριθμό τηλεφώνου όταν ένας πράκτορας διαθέσεις την κλήση. Προεπιλεγμένο είναι Y.
-
+
-Μίγμα διαταγής καταλόγων - αγνοεί τους τομείς θέσης διαταγήςκαι πινάκων μολύβδου. Θα χρησιμοποιήσει τις παραμέτρους καταλόγωνκαι θέσης για την επιλεγμένη είσοδο μιγμάτων καταλόγων στο υπο-τμήμα μιγμάτων καταλόγων αντ' αυτού. Η προεπιλογή είναι ΕΚΤΟΣΛΕΙΤΟΥΡΓΊΑΣ. - -
-
-
-Ταυτότητα μιγμάτων καταλόγων - ταυτότητα του μίγματος καταλόγων.Πρέπει να είστε από 2-20 χαρακτήρες στο μήκος χωρίς ταδιαστήματα ή άλλη ειδική στίξη. - -
-
-
-Όνομα μιγμάτων καταλόγων - περιγραφικό όνομα του μίγματοςκαταλόγων. Πρέπει να είστε από 2-50 χαρακτήρες στο μήκος. - -
-
-
-Λεπτομέρεια μιγμάτων καταλόγων - η σύνθεση της εισόδου μιγμάτωνκαταλόγων. Περιέχει τον κατάλογο ταυτότητα, τη διαταγή μιγμάτων,τα ποσοστά και τις θέσεις που αποτελούν αυτό το μίγμα καταλόγων.Τα ποσοστά πρέπει πάντα να προσθέσουν μέχρι 100, και οικατάλογοι όλοι πρέπει να είναι ενεργοί και καθορισμένοι τηνεκστρατεία για την είσοδο μιγμάτων διαταγής που ενεργοποιείται. - -
-
-
-Μέθοδος μιγμάτων καταλόγων - η μέθοδος όλα τα μέρη τηςλεπτομέρειας μιγμάτων καταλόγων από κοινού. EVEN_MIX θααναμίξει τους μολύβδους από κάθε μέρος που παρεμβάλλεται λευκέςσελίδες με τα άλλα μέρη, όπως αυτό το 1,2,3,1,2,3,1,2,3.IN_ORDER θα βάλει τους μολύβδους στη διαταγή στην οποίαπαρατίθενται στην οθόνη λεπτομέρειας μιγμάτων καταλόγων1,1,1,2,2,2,3,3,3. ΤΥΧΑΊΑ θα τους βάλουν στην ΤΥΧΑΊΑ προεπιλογήδιαταγής 1,3,2,1,1,3,2,1,3. είναι IN_ORDER. +Εμφάνιση Agent Queue Count - Σε περίπτωση που σε Y, σε περίπτωση που ο πελάτης περιμένει για έναν πράκτορα, ο κοτσίδας ζητεί απεικόνιση στο πάνω μέρος της οθόνης πράκτορας θα γίνονται κόκκινα και δείχνουν τον αριθμό των αναμονής κλήσεων. Προεπιλεγμένο είναι Y.

Χειρωνακτικός κατάλογος ταυτότητα πινάκων - η προεπιλογήlist_id για να χρησιμοποιηθεί όταν δημιουργείται έναςπράκτορας placces μια χειρωνακτική κλήση και ένα νέο αρχείομολύβδου στο vicidial_list. Η προεπιλογή είναι 999. Αυτός οτομέας μπορεί να περιέχει τα ψηφία μόνο. +
+
+
+Εγχειρίδιο Dial Διηθείται - Αυτό σας επιτρέπει να φιλτράρετε τις κλήσεις που πράκτορες να καλέσετε στο εγχειρίδιο λειτουργίας για την εκστρατεία αυτή με οποιονδήποτε συνδυασμό από τα ακόλουθα: DNC - προβλέπονται για την έναρξη, CAMPAIGNΛΙΣΤΕΣ - ο αριθμός πρέπει να είναι εντός των καταλόγων για την εκστρατεία, ΚΑΝΕΝΑ - δεν υπάρχει φίλτρο για χειροκίνητη κλήση ή γρήγορα dial καταλόγους. + +
+
+
+Agent Screen Clipboard Αντιγραφή - Αυτή η δυνατότητα είναι ενεργοποιημένη για το παρόν μόνο τον Internet Explorer. Η λειτουργία αυτή σας επιτρέπει να επιλέξετε ένα πεδίο που θα αντιγραφεί στον υπολογιστή πρόχειρο του παράγοντα υπολογιστή σε μια πρόσκληση που απηύθυνε σε έναν πράκτορα. Κοινές χρήσεις για αυτό είναι να καταστεί δυνατή η εύκολη επικόλληση του λογαριασμού αριθμούς ή αριθμούς τηλεφώνου κληρονομιά σε πελάτη σχετικά με τις εφαρμογές πράκτορα υπολογιστή. + +
+
+
+3-Way Outbound Call CallerID - Αυτό ορίζει τι έστειλε ως εξερχόμενο callerID σειρά από 3 δρόμων κλήσεις που διατίθενται από το γραφείο, η καμπάνια χρησιμοποιεί το έθιμο εκστρατεία callerID, ΠΕΛΑΤΗ χρησιμοποιεί τον αριθμό των πελατών που είναι ενεργή παράγοντες για την οθόνη και AGENT_PHONE χρησιμοποιεί το callerID για το τηλέφωνο ότι ο παράγοντας που είναι συνδεδεμένοι στο. AGENT_CHOOSE επιτρέπει να επιλέγουν τον πράκτορα που callerID να χρησιμοποιήσετε για την 3-way ζητεί από μια λίστα επιλογών. + +
+
+
+3-Way Call Πρόθεμα Κλήσης - Αυτό ορίζει τι είναι χρησιμοποιείται ως πρόθεμα κλήσης για 3-way κλήσεις, προεπιλογή είναι άδειο, ώστε η εκστρατεία dial πρόθεμα χρησιμοποιείται, passthru έτσι ώστε να μπορείτε να ακούτε τους ήχους είναι 88. + + 0) + { + ?> +
+
+
+ QC Enabled - Η ρύθμιση αυτού του τομέα να Y επιτρέπει τον παράγοντα Ποιοτικός Έλεγχος χαρακτηριστικά στην εργασία. Προεπιλεγμένο είναι Ν. + +
+
+
+ QC καθεστώτων - Η περιοχή αυτή είναι που θα επιλέξετε το οποίο οδηγεί των καθεστώτων θα πρέπει να φύγει πάνω από το σύστημα, QC. Τοποθετήστε ένα δίπλα στο ελέγξτε την κατάσταση που θέλετε, QC για την αναθεώρηση. + +
+
+
+ QC Shift - Αυτό είναι το χρονοδιάγραμμα μετάβασης που χρησιμοποιούνται για την έλξη, QC αρχεία για μια καμπάνια. Οι μέρες της εβδομάδας αγνοούνται για αυτές τις λειτουργίες. + +
+
+
+ QC Get Record Launch- Αυτό επιτρέπει σε μια από τις ακόλουθες δράσεις, το οποίο θα ενεργοποιείται σε ένα QC πράκτορας που λαμβάνει ένα νέο ρεκόρ. + +
+
+
+ QC Δείτε Καταγραφή - Αυτό επιτρέπει την καταγραφή που μπορεί να συνδέεται με την εγγραφή QC να εμφανίζονται στην οθόνη QC πράκτορα. + +
+
+
+ QC WebForm Διεύθυνση - Αυτό είναι το ότι μια διεύθυνση ιστοσελίδας, QC, μπορεί να πάει στο γραφείο, όταν κάνετε κλικ στο σύνδεσμο WEBFORM στην οθόνη QC. + +
+
+
+ QC Σενάριο - Αυτό είναι το σενάριο που μπορεί να χρησιμοποιηθεί από τους πράκτορες, QC στην SCRIPT καρτέλα στην οθόνη, QC. + + +
+
+
+Αναζήτηση Vtiger Κατηγορία - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεων στη συνέχεια τη ρύθμιση αυτή θα καθορίσει εάν η σελίδα vtiger_search.php θα αναζητήσετε τον αριθμό τηλεφώνου που είχε εγγραφεί. Υπάρχουν 4 επιλογές που μπορεί να χρησιμοποιηθεί στον τομέα αυτό: ΜΟΛΥΒΔΟΥ-Η επιλογή αυτή θα αναζητήσει μέσω του Vtiger οδηγεί μόνο, ΛΟΓΑΡΙΑΣΜΟΥ-Η επιλογή αυτή θα ψάξει μέσω των λογαριασμών Vtiger και όλες τις επαφές και επιμέρους επαφές για τον αριθμό τηλεφώνου, VENDOR-Αυτή η επιλογή μόνο μέσω της αναζήτησης Vtiger πωλητές, ACCTID-Η επιλογή αυτή λειτουργεί μόνο για τους λογαριασμούς και θα λάβει τα vicidial vendor_lead_code τομέα και προσπαθήστε να αναζητήσετε το αναγνωριστικό λογαριασμού Vtiger. Αν ανεπιτυχή θα προσπαθήσουμε τυχόν άλλες μεθόδους που αναφέρονται που έχετε επιλέξει. Πολλαπλές επιλογές μπορούν να χρησιμοποιηθούν για κάθε αναζήτηση, αλλά σε μεγάλες βάσεις δεδομένων που αυτό δεν συνιστάται. Προεπιλεγμένο είναι ΜΟΛΥΒΔΟΥ. + +
+
+
+Δημιουργία Vtiger Call Record - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεις τότε αυτή η ρύθμιση θα καθορίσει κατά πόσο ένα νέο ρεκόρ Vtiger δραστηριότητα δημιουργείται για την πρόσκληση, όταν ο αντιπρόσωπος πηγαίνει στο vtiger_search σελίδα. Προεπιλεγμένο είναι Y. + +
+
+
+Δημιουργία Vtiger Μόλυβδος Record - Εάν είναι ενεργοποιημένη Vtiger ενσωμάτωση στο σύστημα και τις ρυθμίσεις Vtiger Αναζήτηση ΜΟΛΥΒΔΟ τότε η κατηγορία περιλαμβάνει τη ρύθμιση αυτή θα καθορίσει κατά πόσο ένα νέο ρεκόρ Vtiger οδηγήσει δημιουργείται όταν ο πράκτορας πηγαίνει στη σελίδα vtiger_search και δεν είναι βρέθηκαν να έχουν την κλήση του αριθμού τηλεφώνου. Προεπιλεγμένο είναι Y. + +
+
+
+Vtiger Screen Είσοδος - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεις τότε αυτή η ρύθμιση θα καθορίσει κατά πόσο ο χρήστης είναι συνδεδεμένος στο Vtiger διεπαφής αυτόματα όταν συνδεθείτε στο VICIDIAL. Προεπιλεγμένο είναι Y. + +
+
+
+Ομάδα Γνωστός Επιτρέπεται - Αν θέλετε να σας επιτρέψει πράκτορες να χρησιμοποιούν ψευδώνυμα ομάδα τότε πρέπει να ορίσετε αυτή την ομάδα να Y. Γνωστός εξηγούνται περισσότερο στο τμήμα Διοίκησης, που επιτρέπει στους εκπροσώπους να επιλέξετε διαφορετικό callerIDs εγχειρίδιο για εξερχόμενες κλήσεις ότι μπορεί να πραγματοποιηθεί. Προεπιλεγμένο είναι Ν. + +
+
+
+Προεπιλεγμένη ομάδα Γνωστός - Αν έχετε επιτρέπεται Γνωστός ομάδα, τότε αυτό είναι γνωστός και ότι η ομάδα έχει επιλεγεί από προεπιλογή κατά την πρώτη του πράκτορα επιλέγει να χρησιμοποιήσει μια ομάδα Γνωστός για εξερχόμενες κλήσης εγχειρίδιο. Προεπιλεγμένο είναι ΚΑΝΕΝΑ ή κενό. + + @@ -2448,13 +3450,13 @@ echo "

-Κατάλογος VICIDIAL DNC - αυτό δεν καλεί τον κατάλογοπεριέχει κάθε μόλυβδο που έχει τεθεί μια θέση DNC στοσύστημα. Μέσω των ΚΑΤΑΛΩΝ - ΠΡΟΣΘΕΣΤΕ τον ΑΡΙΘΜΟ στη σελίδαDNC που είστε σε θέση να προσθέσετε με το χέρι έναν αριθμό σεαυτόν τον κατάλογο έτσι ώστε δεν θα κληθεί από τις εκστρατείεςπου χρησιμοποιούν τον εσωτερικό κατάλογο DNC. +Κατάλογος VICIDIAL DNC - Αυτό δεν θέτουν κάθε λίστα περιέχει μόλυβδο που έχει τεθεί σε καθεστώς των DNC στο σύστημα. Μέσω του ΚΑΤΑΛΟΓΟΙ - ADD TO ΑΡΙΘΜΟΣ DNC σελίδα μπορείτε να προσθέσετε τους αριθμούς σε αυτόν τον κατάλογο, έτσι ώστε δεν θα ονομάζεται από καμπάνιες που χρησιμοποιούν την εσωτερική DNC λίστα. Υπάρχει επίσης η δυνατότητα να προσθέσετε οδηγεί στην καμπάνια-DNC ειδικών καταλόγων για αυτές τις καμπάνιες που έχουν τους.



-VICIDIAL_INBOUND_GROUPS ΠΙΝΑΚΑΣ

+VICIDIAL_Εισερχόμενα_GROUPS ΠΙΝΑΚΑΣ


ID Ομάδας - Αυτό είναι το σύντομο όνομα της εισερχόμενης ομάδας, δεν μπορεί να διορθωθεί μετά από την αρχική παράδοση, δεν μπορεί να περιέχει κενά και πρέπει να είναι μεταξύ 2 και 20χαρακτήρες. @@ -2492,6 +3494,12 @@ echo "
  - campaign_rank: διαταγές από την τάξη που δίνεται στον πράκτοραγια την εκστρατεία. Ο υψηλότερος σε χαμηλότερο.
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.
+ +
+ +
+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. +

Οθόνη Μπροστινού - Αυτό το πεδίο καθορίζει κατά πόσον στον VICIDIAL χόμενος χρήστης θα εμφανίζεται το όνομα του μπροστινού - εάν υπάρχει κάποιο - στο πεδίο κατάστασης όταν η κλήση έρχεται στον χρήστη. @@ -2514,22 +3522,27 @@ echo "

-Δευτερ. Εγκαταλ. Κλήσης - Ο αριθμός των δευτερολέπτων από την στιγμή που ο πελάτης σηκώνει το τηλ μέχρι η κλήση να θεωρηθεί εγκαταλειμένη. Μόνο για εξερχόμενες κλήσεις . +Drop Call δευτερόλεπτα - Ο αριθμός των δευτερολέπτων σε μια κλήση θα παραμείνουν στην ουρά πριν να θεωρείται DROP.
-
+
-Φωνητικό Ταχυδρομείο - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα ΕΓΚΑΤΑΛΕΙΠΟΝΤΑΝ, θα κατευθυνθούν σε αυό το φωνητικό ταχυδρομείο, ώστε να ακούσετε και να αφήσετε ένα μήνυμα. - -
-
-
-Μήνυμα Εγκατάλειψης - Εάν είναι Υ θα παίξει ένα μήνυμα στον πελάτη μετά το πέρας των δευτερολέπτων Εγκατάλειψης, χωρίς να μεταφερθεί σε έναν χειριστή. Αυτή η επιλογή υπερβαίνει την αποστολή σε θυρίδα ηχητικού μηνύματος εάν είναι Υ. +Drop δράσης - Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα Inbound που καθορίζονται κατωτέρω.

-Εσωτ.Σύνδεση Εγκατάλειψης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Εγκατάλειψης στον διακομιστή. +Drop παράταση - Αν Drop δράση που να είναι μήνυμα, αυτό είναι η κλήση σχέδιο επέκτασης ότι η πρόσκληση θα σταλεί στο εάν ανέρχεται Drop Call Δευτερόλεπτα. + +
+
+
+ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + +
+
+
+Drop Μεταφορά Όμιλος - Αν Drop Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα εάν ανέρχεται Drop Call Δευτερόλεπτα.
@@ -2539,7 +3552,7 @@ echo "

-Μετά από τη δράση ωρών - η δράση για να εκτελέσει εάν είναιμετά από τις ώρες όπως καθορίζεται στο χρόνο πρόσκλησης γιααυτήν την εισερχόμενη ομάδα. HANGUP hangup αμέσως η κλήση,MESSASGE θα παίξει το αρχείο στο μετέπειτα τομέα Filenamμηνυμάτων ωρών, η ΕΠΈΚΤΑΣΗ θα στείλει την κλήση στη μετέπειταπαράταση ωρών στον dialplan και το ΦΩΝΗΤΙΚΌ ΤΑΧΥΔΡΟΜΕΊΟ θαστείλει την κλήση στο παράθυρο φωνητικού ταχυδρομείου πουαπαριθμείται στο μετέπειτα τομέα φωνητικού ταχυδρομείου ωρών. Ηπροεπιλογή είναι ΜΗΝΥΜΑ. +Μετά από ώρες δράσης - Η δράση για την εκτέλεση, αν είναι μετά από ώρες, όπως ορίζεται στην πρόσκληση αυτή την φορά για τα εισερχόμενα ομάδα. HANGUP θα hangup αμέσως την πρόσκληση, MESSASGE θα παίξει το αρχείο στο Μετά από ώρες Μήνυμα Filenam τομέα, ΕΠΕΚΤΑΣΗ θα αποστείλει την πρόσκληση για την Μετά από ώρες Παράταση στο dialplan τηλεφωνητή και θα απευθύνει την πρόσκληση προς το τηλεφωνητή κουτί που απαριθμούνται στο Μετά Ώρες Τηλεφωνητής τομέα , IN_GROUP θα αποστείλει την πρόσκληση προς την εισερχόμενη ομάδα επιλεγμένων στο Μετά Ώρες Μεταφορά Ομάδα επιλέξτε λίστα. Προεπιλεγμένο είναι ΜΗΝΥΜΑ.
@@ -2556,11 +3569,21 @@ echo "
Μετά από το φωνητικό ταχυδρομείο ωρών - το κιβώτιο φωνητικούταχυδρομείου για να στείλει την πρόσκληση εάν η δράση τίθεται τοΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΊΟ. +
+ +
+Μετά από ώρες Μεταφορά Όμιλος - Εάν Μετά Ώρες Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα, αν αυτή τεθεί σε-η ομάδα εκτός από τη διάρκεια των κλήσεων για το καθεστώς που ορίζεται στην ομάδα. +

Ευπρόσδεκτο όνομα αρχείου μηνυμάτων - το ακουστικό αρχείο πουβρίσκεται στον κεντρικό υπολογιστή που παίζεται όταν μπαίνει ηκλήση. Εάν θέστε ΚΑΝΕΝΑΣ --- έπειτα κανένα μήνυμα δεν θαπαιχτεί. Η προεπιλογή είναι ΚΑΜΙΑ --- +
+
+
+Παίξτε Καλωσόρισμα - Οι ρυθμίσεις αυτές, όταν επιλέγουν να παίξουν το μήνυμα υποδοχής που ορίζεται, πάντα θα παίζει κάθε φορά, ΠΟΤΕ δεν πρόκειται ποτέ να παίξετε, IF_WAIT_ONLY μόνο θα παίξει το μήνυμα υποδοχής, αν η κλήση δεν πάνε αμέσως σε ένα παράγοντα , και YES_UNLESS_NODELAY θα είναι πάντα ευπρόσδεκτη παίξει το μήνυμα Αν δεν το NO_DELAY η ρύθμιση είναι ενεργοποιημένη. Προεπιλεγμένο είναι πάντα. +

@@ -2574,7 +3597,52 @@ echo "

-Στο γρήγορο διάστημα λαβής - το χρονικό διάστημα σταδευτερόλεπτα για να περιμένει πρίν παίζει επάνω κρατά γρήγορος.Η προεπιλογή είναι 60. +Στο γρήγορο διάστημα λαβής - το χρονικό διάστημα σταδευτερόλεπτα για να περιμένει πρίν παίζει επάνω κρατά γρήγορος.Η προεπιλογή είναι 60. Για να απενεργοποιήσετε την Προτροπή σε αναμονή, που το χρονικό διάστημα έως 0. + +
+
+
+Παίξτε στο Τόπος Γραμμή - Αυτό καθορίζει αν ο καλών θα ακούσει τη θέση τους στη γραμμή όταν εισέλθουν στην ουρά, καθώς και όταν ακούν την announcemend. Προεπιλεγμένο είναι Ν. + +
+
+
+Παίξτε Κρατήστε Εκτιμώμενη ώρα - Αυτό καθορίζει αν ο καλών θα ακούσει τον εκτιμώμενο χρόνο κατέχουν προτού μεταφερθούν σε έναν πράκτορα. Προεπιλεγμένο είναι Ν. + +
+
+
+Κρατήστε Ώρα Επιλογή - Αυτό σας επιτρέπει να καθορίσετε την δρομολόγηση των κλήσεων, εάν ο εκτιμώμενος χρόνος κατέχουν πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλεγμένο είναι ΚΑΝΕΝΑ. + +
+
+
+Κρατήστε Ώρα Επιλογή δευτερόλεπτα - Αν Κρατήστε Ώρα Επιλογή έχει οριστεί σε οτιδήποτε, αλλά ΚΑΝΕΝΑ, αυτό είναι ο αριθμός των δευτερολέπτων του χρόνου εκτιμάται ότι κατέχουν θα ενεργοποιήσει την αναμονή ώρα της επιλογής. Η προεπιλογή είναι 360 δευτερόλεπτα. + +
+
+
+Κρατήστε Ώρα Επιλογή Επέκταση - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε ΕΠΕΚΤΑΣΗ, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + +
+
+
+Κρατήστε Ώρα Επιλογή Τηλεφωνητής - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε τηλεφωνητή, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + +
+
+
+Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε IN_GROUP, αυτή είναι η ομάδα που την εισερχόμενη κλήση θα αποσταλεί στο εάν ο εκτιμώμενος χρόνος αναμονή υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + +
+
+
+Κρατήστε Ώρα Επιλογή αρχείου Callback - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε CALLERID_CALLBACK, αυτό είναι το όνομα του αρχείου εντολών που έπαιξε πριν από την κλήση καταγράφεται ως μια νέα πρωτοβουλία στον κατάλογο ID που καθορίζονται κατωτέρω, εάν η εκτιμώμενη κατέχει υπερβαίνει το χρόνο Κρατήστε Ώρα Επιλογή Δευτερόλεπτα. + +
+
+
+Κρατήστε Ώρα Επιλογή Callback Κατάλογος ID - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε CALLERID_CALLBACK, αυτός είναι ο Κατάλογος ID η κλήση προστίθεται ως μια νέα πρωτοβουλία, αν το εκτιμώμενο χρόνο κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα.
@@ -2591,6 +3659,176 @@ echo "
Ομάδα μεταφοράς προεπιλογής - αυτός ο τομέας είναι η-ΟΜΑΔΑπροεπιλογής που θα επιλεχτεί αυτόματα όταν πηγαίνει ο πράκτοραςστο πλαίσιο μεταφορά-διασκέψεων στη διεπαφή πρακτόρων τους. +
+ +
+-Στην ομάδα Καταγραφή Παράκαμψη - Το πεδίο αυτό επιτρέπει την πρωταρχική της εκστρατείας πρόσκληση εγγραφής ρύθμιση. Η ρύθμιση αυτή μπορεί να παρακαμφθεί από την καταγραφή vicidial_user υπερισχύει ρύθμιση. DISABLED δεν θα υπερισχύσει του εκστρατεία καταγραφής ρύθμιση. ΠΟΤΕ θα απενεργοποιήσει την εγγραφή για τον πελάτη. ONDEMAND είναι η προεπιλεγμένη και επιτρέπει στον αντιπρόσωπο να ξεκινήσετε και να σταματήσετε την εγγραφή, όπως απαιτείται. ALLCALLS θα αρχίσει η εγγραφή του υπολογιστή-πελάτη κάθε φορά που μια κλήση στέλνεται σε έναν πράκτορα. ALLFORCE θα αρχίσει η εγγραφή του υπολογιστή-πελάτη κάθε φορά που μια κλήση στέλνεται σε έναν πράκτορα που ο πράκτορας δεν την επιλογή για να σταματήσει η εγγραφή. + +
+
+
+-Στην ομάδα αρχείου Καταγραφή - Το πεδίο αυτό θα αντικαταστήσει το Εκστρατεία Καταγραφή Filenaming σύστημα εάν δεν έχει οριστεί σε ΚΑΝΕΝΑ. Οι μεταβλητές που επιτρέπονται είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH ΠΡΑΚΤΟΡΑ. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζει κάπως έτσι 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει κάπως έτσι TESTCAMP_51020103108_3125551212. 50 char max. Προεπιλεγμένο είναι ΚΑΝΕΝΑ. + + 0) + { + ?> +
+
+
+ QC Enabled - Η ρύθμιση αυτού του τομέα να Y επιτρέπει τον παράγοντα Ποιοτικός Έλεγχος χαρακτηριστικά στην εργασία. Προεπιλεγμένο είναι Ν. + +
+
+
+ QC καθεστώτων - Η περιοχή αυτή είναι που θα επιλέξετε το οποίο οδηγεί των καθεστώτων θα πρέπει να φύγει πάνω από το σύστημα, QC. Τοποθετήστε ένα δίπλα στο ελέγξτε την κατάσταση που θέλετε, QC για την αναθεώρηση. + +
+
+
+ QC Shift - Αυτό είναι το χρονοδιάγραμμα μετάβασης που χρησιμοποιούνται για την έλξη, QC αρχεία για μια inbound_group. Οι μέρες της εβδομάδας αγνοούνται για αυτές τις λειτουργίες. + +
+
+
+ QC Get Record Launch- Αυτό επιτρέπει σε μια από τις ακόλουθες δράσεις, το οποίο θα ενεργοποιείται σε ένα QC πράκτορας που λαμβάνει ένα νέο ρεκόρ. + +
+
+
+ QC Δείτε Καταγραφή - Αυτό επιτρέπει την καταγραφή που μπορεί να συνδέεται με την εγγραφή QC να εμφανίζονται στην οθόνη QC πράκτορα. + +
+
+
+ QC WebForm Διεύθυνση - Αυτό είναι το ότι μια διεύθυνση ιστοσελίδας, QC, μπορεί να πάει στο γραφείο, όταν κάνετε κλικ στο σύνδεσμο WEBFORM στην οθόνη QC. + +
+
+
+ QC Σενάριο - Αυτό είναι το σενάριο που μπορεί να χρησιμοποιηθεί από τους πράκτορες, QC στην SCRIPT καρτέλα στην οθόνη, QC. + + +
+
+
+Κρατήστε Ανάκληση Μεταφορά σε ομάδα - Σε περίπτωση που ο πελάτης ζητά πίσω σε αυτή την ομάδα-σε περισσότερες από μία φορές και αυτό δεν έχει οριστεί σε ΚΑΝΕΝΑ, τότε η κλήση θα αποστέλλονται αυτόματα στην επιλεγμένη ομάδα σε αυτό το πεδίο . Προεπιλεγμένο είναι ΚΑΝΕΝΑ. + +
+
+
+Δεν Υστέρηση Call διαδρομή - Η ρύθμιση αυτής να Y θα άρουν όλες τις φορές περιμένουμε και ήχου προτροπές και επιχειρείτε να στείλετε την πρόσκληση δικαίωμα ενός πράκτορα. Δεν υπερισχύει ευπρόσδεκτο μήνυμα ή σε αναμονή εντολών ρυθμίσεις. Προεπιλεγμένο είναι Ν. + +
+
+
+Στατιστικά Ποσοστό ζητεί απάντηση εντός Χ δευτερόλεπτα - Αυτό το πεδίο σας επιτρέπει να ορίσετε τον αριθμό των δευτερολέπτων που κατέχουν την απεικόνιση σε πραγματικό χρόνο stats θα χρησιμοποιήσουν για να υπολογίσουν το ποσοστό των κλήσεων απαντά ότι απαντήθηκαν εντός Χ αριθμό των δευτερολέπτων σε αναμονή. + +
+
+
+Προεπιλεγμένη ομάδα Γνωστός - Αν έχετε τη δυνατότητα Ομάδα Γνωστός για την εκστρατεία ότι ο αντιπρόσωπος είναι συνδεδεμένοι στο τότε αυτή είναι η ομάδα που έχει επιλεγεί άλλως πρώτα από προεπιλογή για μια κλήση που προέρχεται από αυτή την ομάδα, όταν ο εισερχόμενος πράκτορας επιλέγει να χρησιμοποιήσετε μια ομάδα Γνωστός για εξερχόμενες κλήσης εγχειρίδιο. Προεπιλεγμένο είναι ΚΑΝΕΝΑ ή κενό. + + + + + +



+ +VICIDIAL_Εισερχόμενα_DIDS ΠΙΝΑΚΑΣ

+
+
+
+DID Επέκταση - Αυτό είναι το πλήθος, την παράταση ή DID που θα ενεργοποιήσουν την παρούσα θέση και που θα σας διαδρομή, και εντός του συστήματος με τη βοήθεια αυτής της λειτουργίας. Υπάρχει reserved προεπιλογή DID που μπορείτε να χρησιμοποιήσετε το οποίο είναι μόνο η λέξη-default-χωρίς παύλες, ότι θα μπορείτε να στείλετε ΑΛΛΟΣ κάθε κλήση που δεν ταιριάζει με οποιαδήποτε άλλα υφιστάμενα πρότυπα στην προεπιλεγμένη DID. + +
+
+
+DID Περιγραφή - Αυτή είναι η περιγραφή της DID δρομολόγησης εισόδου. + +
+
+
+DID Ενεργό - Αυτό το πεδίο όπου το σύνολο DID εισόδου σε ενεργό ή μη. Προεπιλεγμένο είναι Y. + +
+
+
+DID Route - Αυτό το είδος της διαδρομής που μπορείτε να ρυθμίσετε το DID χρήση. Παράταση θα αποστείλει τις κλήσεις προς την επέκταση τέθηκε κάτω, τηλεφωνητή θα αποστείλει κλήσεις απευθείας στον τηλεφωνητή τέθηκε κάτω από το πλαίσιο, ο πράκτορας θα αποστείλει κλήσεις σε VICIDIAL παράγοντα όταν είναι συνδεδεμένοι, τηλέφωνο θα στείλει την κλήση σε τηλέφωνα εισόδου επιλεγεί στη συνέχεια, θα IN_GROUP αποστέλλουν κλήσεις απευθείας από την καθορισμένη εισερχόμενα ομάδα. Προεπιλεγμένο είναι παράταση. + +
+
+
+Επέκταση - Εάν είναι επιλεγμένο παράταση ως τις DID διαδρομή, τότε αυτή είναι η επέκταση dialplan που ζητά θα αποσταλεί στο. Προεπιλεγμένο είναι 9998811112, της μη παροχής υπηρεσιών. + +
+
+
+Παράταση Πλαίσιο - Εάν είναι επιλεγμένο παράταση ως τις DID διαδρομή, τότε αυτό είναι το πλαίσιο dialplan ότι οι κλήσεις θα σταλούν σε. Προεπιλογή είναι προεπιλογή. + +
+
+
+Τηλεφωνητής Πλαίσιο - Τηλεφωνητής Εάν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η θέση τηλεφωνητή ότι οι κλήσεις που θα αποσταλεί στο. Προεπιλεγμένο είναι άδειο. + +
+
+
+Τηλέφωνο Επέκταση - ΤΗΛΕΦΩΝΟΥ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το τηλέφωνο που καλεί επέκταση θα αποσταλεί στο. + +
+
+
+Τηλέφωνο IP Διακομιστή - ΤΗΛΕΦΩΝΟΥ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το server IP για το τηλέφωνο που καλεί επέκταση θα σταλεί στο. + +
+
+
+Χρήστης Agent - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το γραφείο που VICIDIAL κλήσεις θα σταλούν σε. + +
+
+
+Χρήστης Unavailable Δράση - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομής, και ο χρήστης είναι συνδεδεμένος ή δεν υπάρχουν, τότε αυτή είναι η διαδρομή που θα λάβουν τις προσκλήσεις. + +
+
+
+Ρυθμίσεις χρήστη Οδός-Στην Ομάδα - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η ομάδα-Στο ότι θα πρέπει να χρησιμοποιείται για την ουρά ρυθμίσεις του καλούντος είναι σε αναμονή για αποστολή προς τον πράκτορα. Προεπιλεγμένο είναι AGENTDIRECT. + +
+
+
+Στην Ομάδα-ID - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η ομάδα-Στο ότι οι κλήσεις που θα σταλεί στο. + +
+
+
+Στην Ομάδα-Call Χειριστείτε Μέθοδος - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η πρόσκληση χειρισμό μέθοδος που χρησιμοποιείται για αυτές τις κλήσεις. CID θα προσθέσετε ένα νέο ρεκόρ οδηγήσει με κάθε κλήση χρησιμοποιώντας το CallerID όπως τον αριθμό τηλεφώνου, θα προσπαθήσει να CIDLOOKUP lookup τον αριθμό τηλεφώνου από το CallerID σε ολόκληρο το σύστημα, θα attampt να CIDLOOKUPRL lookup τον αριθμό τηλεφώνου από το CallerID ορίζεται σε ένα μόνο κατάλογο , CIDLOOKUPRC θα attampt να lookup τον αριθμό τηλεφώνου από το CallerID σε όλες τις λίστες που ανήκουν στην καθορίζονται εκστρατεία, ΣΤΕΝΟΤΕΡΗΣ καθορίζεται για VICIDIAL Στενότερος κλήσεις, ANI θα προσθέσει ένα νέο ρεκόρ οδηγήσει με κάθε κλήση χρησιμοποιώντας την ANI όπως ο αριθμός τηλεφώνου, ANILOOKUP θα προσπαθήσει να lookup τον αριθμό τηλεφώνου από το ANI σε ολόκληρο το σύστημα, ANILOOKUPRL θα attampt να lookup τον αριθμό τηλεφώνου από το ANI ορίζεται σε ένα μόνο κατάλογο, θα XDIGITID εντολών του καλούντος για μια Χ ψήφιο κωδικό πριν από την πρόσκληση θα τεθούν σε την ουρά. Προεπιλεγμένο είναι CID. + +
+
+
+Στην Ομάδα-Agent Search Μέθοδος - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η μέθοδος αναζήτησης παράγοντας που πρέπει να χρησιμοποιούνται από τα εισερχόμενα ομάδα, LO είναι Load-Balanced-Υπερχείλιση και θα προσπαθήσει να στείλει την πρόσκληση σε έναν πράκτορα για τον τοπικό διακομιστή πριν δοκιμάσετε να το στείλετε σε έναν πράκτορα σε άλλο διακομιστή, LB Load είναι ισορροπημένη και θα προσπαθήσει να στείλει την πρόσκληση για την επόμενη πράκτορα θέμα αυτό δεν είναι για server, SO-Server είναι το μόνο και θα μόνο να προσπαθήσουμε να στείλουμε τις κλήσεις σε παράγοντες σχετικά με το διακομιστή ότι η πρόσκληση ήταν για. Προεπιλεγμένο είναι LB. + +
+
+
+-Στην ομάδα Κατάλογος ID - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτός είναι ο Κατάλογος ID που οδηγεί μπορεί να ερευνάται και ότι οδηγεί θα προστεθούν στο αν χρειάζεται. + +
+
+
+-Στην ομάδα καμπάνιας ID - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το ID Εκστρατείας που οδηγεί μπορεί να αναζητήσει σε περίπτωση που η πρόσκληση χειριστεί μέθοδος CIDLOOKUPRC. + +
+
+
+-Στην ομάδα Τηλέφωνο κώδικα - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το τηλέφωνο κώδικα που χρησιμοποιείται εάν μια νέα πρωτοβουλία δημιουργείται. + +



@@ -2648,36 +3886,42 @@ echo "



+ 0) + { + ?> +



-VICIDIAL_CAMPAIGN_HOTKEYS ΠΙΝΑΚΑΣ

- -
-Με την χρήση προσαρμοσμένων κλειδιών εκστρατείας, οι χρήστες που χρησιμοποιούν την εφαρμογή vicidial μπορούν να κλείσουν και να τερματίσουν την κλήση, με ένα μόνο πάτημα πλήκτρου. 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. + VICIDIAL_CAMPAIGN_HOTKEYS ΠΙΝΑΚΑΣ

+
+
+ Με την χρήση προσαρμοσμένων κλειδιών εκστρατείας, οι χρήστες που χρησιμοποιούν την εφαρμογή vicidial μπορούν να κλείσουν και να τερματίσουν την κλήση, με ένα μόνο πάτημα πλήκτρου. 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. -



+



-VICIDIAL_LEAD_RECYCLE ΠΙΝΑΚΑΣ

-
-
-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. + VICIDIAL_LEAD_RECYCLE ΠΙΝΑΚΑΣ

+
+
+ 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. -



- -VICIDIAL ΑΥΤΟΜΑΤΕΣ ΘΈΣΕΙΣ ΠΙΝΑΚΩΝ ALT

-
-
-Εάν ο αυτόματος τομέας σχηματισμού ALT-ARJCMOY' τίθεται,κατόπιν οι μόλυβδοι που είναι κάτω από αυτές τις αυτόματεςθέσεις πινάκων ALT θα σχηματίσουν το alt_phone και-ή τουςτομείς address3 τους αφότου τίθενται οποιεσδήποτε από αυτέςτις θέσεις κανένας-απάντησης. +



+ VICIDIAL ΑΥΤΟΜΑΤΕΣ ΘΈΣΕΙΣ ΠΙΝΑΚΩΝ ALT

+
+
+ Εάν ο αυτόματος τομέας σχηματισμού ALT-ARJCMOY' τίθεται,κατόπιν οι μόλυβδοι που είναι κάτω από αυτές τις αυτόματεςθέσεις πινάκων ALT θα σχηματίσουν το alt_phone και-ή τουςτομείς address3 τους αφότου τίθενται οποιεσδήποτε από αυτέςτις θέσεις κανένας-απάντησης. + @@ -2704,11 +3948,42 @@ echo "
Ονομα Ομάδας- Αυτή είναι η περιγραφή της vicidial ομάδας χρήστη μέχρι 40 χαρακτήρες. +
+ +
+ΔύναμηΏρα ρολόι Είσοδος - Αυτή η επιλογή σας επιτρέπει να μην επιτρέπει να συνδεθείτε με έναν πράκτορα στην VICIDIAL διεπαφή πράκτορα, εάν δεν έχουν συνδεθεί στο timeclock. Προεπιλεγμένο είναι Ν. Υπάρχει η δυνατότητα να εξαιρούν admin χρήστες, 8 και 9 επίπεδα. + +
+
+
+Shift εκτέλεση - Η ρύθμιση αυτή σας επιτρέπει να περιορίσετε πράκτορα συνδέσεις με βάση τις αλλαγές που έχουν επιλεγεί. OFF δεν θα επιβάλει σε όλες τις βάρδιες. START θα επιβάλει μόνο το χρόνο σύνδεσης, αλλά δεν θα επηρεάσει έναν πράκτορα που εκτελεί τους πάνω μετατόπιση του χρόνου και αν είναι ήδη συνδεδεμένος in. ALL θα επιβάλλει μετατόπιση χρόνος έναρξης και θα συνδεθείτε ορίζονται μετά από έναν πράκτορα που τρέχουν πάνω από το τέλος του χρόνου τους βάρδια. Προεπιλεγμένο είναι OFF. + +
+
+
+Ομάδα Βάρδιες - Αυτό είναι ένα επιλέξιμο λίστα των βαρδιών που μπορούν να περιορίσουν το χρόνο παράγοντες σύνδεσης, για το σύστημα. +

Εκστρατείες - αυτό είναι ένας επιλέξιμος κατάλογος εκστρατειώνστον οποίο τα μέλη αυτής της ομάδας χρηστών μπορούν νασυνδεθούν. Η επιλογή όλος-ΕΚΣΤΡΑΤΕΙΩΝ επιτρέπει στους χρήστες σεαυτήν την ομάδα για να δει και να συνδεθεί σε οποιαδήποτεεκστρατεία στο σύστημα. + 0) + { + ?> +
+
+
+ QC Επιτρέπονται Καμπάνιες - Αυτό είναι ένα επιλέξιμο κατάλογο των καμπάνιες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-CAMPAIGNS επιλογή επιτρέπει στους χρήστες αυτής της ομάδας να QC οποιαδήποτε εκστρατεία για το σύστημα. + +
+
+
+ QC Επιτρέπονται Inbound Ομάδες - Αυτό είναι ένα επιλέξιμο λίστα των εισερχόμενων ομάδες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα χρηστών να QC οποιαδήποτε εισερχόμενα ομάδας για το σύστημα. + @@ -2746,25 +4021,31 @@ echo "



+ 0) + { + ?> +



-VICIDIAL_LEAD_ΦΙΛΤΡΑ ΠΙΝΑΚΑΣ

- -
-ID Φίλτρου - Αυτό είναι το σύντομο όνομα ενός Φίλτρου Οδηγού. Πρέπει να είναι ένας μοναδικός κωδικός. Μην χρησιμοποιήσετε κενά ή στίξη για αυτό το πεδίο. Χαρακτήρες 2 με 10. + VICIDIAL_LEAD_ΦΙΛΤΡΑ ΠΙΝΑΚΑΣ

+
+
+ ID Φίλτρου - Αυτό είναι το σύντομο όνομα ενός Φίλτρου Οδηγού. Πρέπει να είναι ένας μοναδικός κωδικός. Μην χρησιμοποιήσετε κενά ή στίξη για αυτό το πεδίο. Χαρακτήρες 2 με 10. -
-
-Ονομα Φίλτρου - Αυτό είναι ένα πιο περιγραφικό όνομα για το Φίλτρο. Είναι μία σύντομη περιγρφή του φίλτρου. Χαρακτήρες 2 με 30. +
+
+ Ονομα Φίλτρου - Αυτό είναι ένα πιο περιγραφικό όνομα για το Φίλτρο. Είναι μία σύντομη περιγρφή του φίλτρου. Χαρακτήρες 2 με 30. -
-
-Σχόλια Φίλτρου - Εδώ μπορείτε σχολιάσετε το φίλτρο. Χαρακτήρες 2 με 255. - -
-
-SQL Φίλτρου - Εδώ μπορείτε να ορίσετε SQL ερώτημα για το φίλτρο. Μην ξεκινήσετε ή τελειώσετε με ένα AND, αυτό θα γίνει αυτόματα από το hopper. Ένα παράδειγμα είναι- called_count > 4 and called_count < 8 -. +
+
+ Σχόλια Φίλτρου - Εδώ μπορείτε σχολιάσετε το φίλτρο. Χαρακτήρες 2 με 255. +
+
+ SQL Φίλτρου - Εδώ μπορείτε να ορίσετε SQL ερώτημα για το φίλτρο. Μην ξεκινήσετε ή τελειώσετε με ένα AND, αυτό θα γίνει αυτόματα από το hopper. Ένα παράδειγμα είναι- called_count > 4 and called_count < 8 -. + @@ -2806,43 +4087,75 @@ echo "



-ΛΕΙΤΟΥΡΓΙΑ ΕΙΣΑΓΩΓΗΣ ΛΙΣΤΑΣ

- +VICIDIAL_SHIFTS ΠΙΝΑΚΑΣ

+

-Ο βασικός βασισμένος στο WEB φορτωτής μολύβδου VICIDIALσχεδιάζεται απλά για να πάρει ένα αρχείο μολύβδου - μέχρι8MB στο μέγεθος - που είναι είτε ετικέττα είτε σωλήνας πουοριοθετείται και τον φορτώνει στον πίνακα vicidial_list. Οφορτωτής μολύβδου επιτρέπει τον τομέα επιλέγοντας και TXT -σαφές κείμενο, CSV - κόμμα χώρισε τις τιμές και XLS -σχήματα αρχείων Excel. Ο φορτωτής μολύβδου δεν κάνει τηνεπικύρωση στοιχείων, αλλά επιτρέπει σε σας για να ελέγξει για τααντίγραφα σε το, μέσα στην εκστρατεία ή μέσα το σε ολόκληροσύστημα. Επίσης, σιγουρευτείτε ότι έχετε δημιουργήσει τονκατάλογο ότι αυτοί οι μόλυβδοι πρόκειται να κάτω έτσι ώστεμπορείτε να τους χρησιμοποιήσετε. Εδώ είναι ένας κατάλογος τωντομέων στην κατάλληλη διαταγή τους για τα αρχεία μολύβδου: -
    -
  1. Κωδικός Οδηγού Προμηθευτού -
  2. Πηγαίος Κώδικας - εσωτερική χρήση μόνο από διαχειριστές και DBAs -
  3. ID λίστας - ο αριθμός λίστας που οι οδηγοί θα παρουσιαστούν κάτω από -
  4. Κωδικός τηλεφώνου - το πρόθεμα του τηλεφωνικού αριθμού (1 για ΗΠΑ, 01144 για Βρετανία κλπ) -
  5. Ο αριθμός τηλεφώνου - πρέπει να είναι τουλάχιστον 8 ψηφία -
  6. Τίτλος - ο τίτλος του πελάτη (κος. κα. κλπ) -
  7. Ονομα -
  8. Μεσαίο Αρχικό -
  9. Επίθετο -
  10. 1 Γραμμή Διεύθυνσης -
  11. 2 Γραμμή Διεύθυνσης -
  12. 3 Γραμμή Διεύθυνσης -
  13. Πόλη -
  14. Κράτος - περιορισμός σε 2 χαρακτήρες -
  15. Επαρχία -
  16. Ταχ.Κωδ. -
  17. Χώρα -
  18. Φύλο -
  19. Ημερ. Γέννησης -
  20. Εναλ. Αριθμός Τηλ. -
  21. Διεύθυνση Ηλεκτρ.Ταχυδρομείου -
  22. Φράση Ασφαλείας -
  23. Σχόλια -
+ID Shift - Αυτή είναι η σύντομη ονομασία της Vicidial Shift Ορισμός. Αυτό πρέπει να είναι ένα μοναδικό αναγνωριστικό. Μην χρησιμοποιείτε τυχόν διαστήματα ή σημεία στίξης για αυτόν τον τομέα. max 20 χαρακτήρες, τουλάχιστον 2 χαρακτήρες. -
ΣΗΜΕΙΩΣΕΙΣ: Η λειτουργία φορτωτών μολύβδου Excel επιτρέπεταιαπό μια σειρά χειρογράφων perl και πρέπει να έχει κατάλληλαδιαμορφωμένη/ένα αρχείο κ.λπ.../astguiclient.conf σε ισχύ στονκεντρικό υπολογιστή δικτύου. Επίσης, οι ενότητες ζευγών perlπρέπει να φορτωθούν για το για να εργαστούν επίσης - ολε-Storage_Lite και υπολογισμός με λογιστικό φύλλο(spreadsheet)- ParseExcel. Μπορείτε να ελέγξετε για τα λάθηχρόνου εκτέλεσης σε αυτοί με την εξέταση το αρχείο apache σαςerror_log. Επίσης, για τους ελέγχους διπλασιασμού ενάντια στουςκαταλόγους gampaign, ο κατάλογος που έχει τα νέα προβαδίσματαπου πηγαίνουν σε το πρέπει να δημιουργηθεί στο σύστημα προτού νααρχίσετε να φορτώνετε τους μολύβδους. +
+
+Shift Όνομα - Αυτό είναι ένα πιο περιγραφικό όνομα του Shift Ορισμός. Αυτή είναι μια σύντομη περίληψη του Shift ορισμό. το πολύ 50 χαρακτήρες, τουλάχιστον 2 χαρακτήρες. + +
+
+Start Time Shift - Αυτή είναι η στιγμή που αρχίζει η εκστρατεία στροφή. Πρέπει να είναι μόνο αριθμοί, 9.30 π.μ. και 0930 θα είναι 5:00 μμ θα είναι 1.700. + +
+
+Shift Μήκος - Αυτό είναι το χρόνο σε ώρες και τα λεπτά που διαρκεί η εκστρατεία στροφή. 8 ώρα θα είναι 08:00 και 7 ώρες και 30 λεπτά θα είναι 07:30. + +
+
+Shift Καθημερινά - Στην ενότητα αυτή θα πρέπει να επιλέξετε τις μέρες την εβδομάδα ότι αυτή η στροφή είναι ενεργή. + + + + 0) + { + ?> + +



+ + ΛΕΙΤΟΥΡΓΙΑ ΕΙΣΑΓΩΓΗΣ ΛΙΣΤΑΣ

+
+
+ Ο βασικός βασισμένος στο WEB φορτωτής μολύβδου VICIDIALσχεδιάζεται απλά για να πάρει ένα αρχείο μολύβδου - μέχρι8MB στο μέγεθος - που είναι είτε ετικέττα είτε σωλήνας πουοριοθετείται και τον φορτώνει στον πίνακα vicidial_list. Οφορτωτής μολύβδου επιτρέπει τον τομέα επιλέγοντας και TXT -σαφές κείμενο, CSV - κόμμα χώρισε τις τιμές και XLS -σχήματα αρχείων Excel. Ο φορτωτής μολύβδου δεν κάνει τηνεπικύρωση στοιχείων, αλλά επιτρέπει σε σας για να ελέγξει για τααντίγραφα σε το, μέσα στην εκστρατεία ή μέσα το σε ολόκληροσύστημα. Επίσης, σιγουρευτείτε ότι έχετε δημιουργήσει τονκατάλογο ότι αυτοί οι μόλυβδοι πρόκειται να κάτω έτσι ώστεμπορείτε να τους χρησιμοποιήσετε. Εδώ είναι ένας κατάλογος τωντομέων στην κατάλληλη διαταγή τους για τα αρχεία μολύβδου: +
    +
  1. Κωδικός Οδηγού Προμηθευτού +
  2. Πηγαίος Κώδικας - εσωτερική χρήση μόνο από διαχειριστές και DBAs +
  3. ID λίστας - ο αριθμός λίστας που οι οδηγοί θα παρουσιαστούν κάτω από +
  4. Κωδικός τηλεφώνου - το πρόθεμα του τηλεφωνικού αριθμού (1 για ΗΠΑ, 01144 για Βρετανία κλπ) +
  5. Ο αριθμός τηλεφώνου - πρέπει να είναι τουλάχιστον 8 ψηφία +
  6. Τίτλος - ο τίτλος του πελάτη (κος. κα. κλπ) +
  7. Ονομα +
  8. Μεσαίο Αρχικό +
  9. Επίθετο +
  10. 1 Γραμμή Διεύθυνσης +
  11. 2 Γραμμή Διεύθυνσης +
  12. 3 Γραμμή Διεύθυνσης +
  13. Πόλη +
  14. Κράτος - περιορισμός σε 2 χαρακτήρες +
  15. Επαρχία +
  16. Ταχ.Κωδ. +
  17. Χώρα +
  18. Φύλο +
  19. Ημερ. Γέννησης +
  20. Εναλ. Αριθμός Τηλ. +
  21. Διεύθυνση Ηλεκτρ.Ταχυδρομείου +
  22. Φράση Ασφαλείας +
  23. Σχόλια +
+ +
ΣΗΜΕΙΩΣΕΙΣ: Η λειτουργία φορτωτών μολύβδου Excel επιτρέπεταιαπό μια σειρά χειρογράφων perl και πρέπει να έχει κατάλληλαδιαμορφωμένη/ένα αρχείο κ.λπ.../astguiclient.conf σε ισχύ στονκεντρικό υπολογιστή δικτύου. Επίσης, οι ενότητες ζευγών perlπρέπει να φορτωθούν για το για να εργαστούν επίσης - ολε-Storage_Lite και υπολογισμός με λογιστικό φύλλο(spreadsheet)- ParseExcel. Μπορείτε να ελέγξετε για τα λάθηχρόνου εκτέλεσης σε αυτοί με την εξέταση το αρχείο apache σαςerror_log. Επίσης, για τους ελέγχους διπλασιασμού ενάντια στουςκαταλόγους gampaign, ο κατάλογος που έχει τα νέα προβαδίσματαπου πηγαίνουν σε το πρέπει να δημιουργηθεί στο σύστημα προτού νααρχίσετε να φορτώνετε τους μολύβδους. -



- +



+ @@ -3183,6 +4496,58 @@ echo "
DBY Πόρτα - Η MySQL TCP πόρτα που ο χρήστης χρησιμοποιεί όταν συνδέεται. Η προκαθορισμένη είναι 3306. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. +
+ +
+Γνωστός ID - Η ID του ψευδώνυμο που χρησιμοποιείται για να επιτρέψει συνδέσεις τηλεφώνου φορτίο ισορροπημένη. δεν κενά ή άλλους ειδικούς χαρακτήρες επιτρέπονται. Πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες. + +
+
+
+Ψευδώνυμο - Το όνομα που χρησιμοποιείται για την περιγραφή ενός τηλέφωνα άλλως, πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες. + +
+
+
+Τηλέφωνα logins List - Η comma separated κατάλογο τηλέφωνο συνδέσεις χρησιμοποιούνται όταν ένας πράκτορας συνδέεται στο τηλέφωνο χρησιμοποιώντας φορτίο ισορροπημένη συνδέσεις. Το γραφείο θα βρει εφαρμογή η ενεργός διακομιστής με τις λιγότερες παράγοντες συνδεθεί σε αυτήν και μια κλήση από το διακομιστή στον πράκτορα κατά login. + +
+
+
+Τηλέφωνα Email - Η διεύθυνση ηλεκτρονικού ταχυδρομείου που σχετίζονται με αυτό το τηλέφωνο εισόδου. Αυτό χρησιμοποιείται για τηλεφωνητή ρυθμίσεις. + +
+
+
+ID Template - Αυτό είναι το πρότυπο αρχείο conf ID εισόδου ότι αυτό το τηλέφωνο θα χρησιμοποιήσει για την Asterisk ρυθμίσεις. Προεπιλεγμένο είναι - ΚΑΝΕΝΑ --. + +
+
+
+Conf Override Settings - If populated, and the Πρότυπο 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. + +
+
+
+Ομάδα Γνωστός ID - Η ID της ομάδας άλλως χρησιμοποιείται από τους αντιπροσώπους που ορίζονται για να καλέσετε τις κλήσεις από το VICIDIAL πράκτορα διεπαφής με διαφορετικές ταυτότητες καλούντος. δεν κενά ή άλλους ειδικούς χαρακτήρες επιτρέπονται. Πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες. + +
+
+
+Ομάδα ψευδώνυμο - Το όνομα που χρησιμοποιείται για να περιγράψει μια ομάδα άλλως, πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες. + +
+
+
+Αριθμός Ταυτότητας καλούντος - Η καλούντος αριθμό ταυτότητας που χρησιμοποιούνται σε αυτή την ομάδα Γνωστός. Πρέπει να είναι μόνο ψηφία. + +
+
+
+Όνομα καλούντος ID - Το όνομα του καλούντος ID που μπορούν να αποσταλούν με αυτή την ομάδα Γνωστός. Από όσο γνωρίζουμε αυτό θα λειτουργήσει μόνο στον Καναδά και στις PRI κυκλωμάτων χρησιμοποιώντας IAX βρόχο κορμού μέσω Asterisk. + + +



@@ -3206,6 +4571,21 @@ echo "
Ενεργός - Ορίζει κατά πόσον ο διακομιστής Asterisk είναι ενεργός ή μη ενεργός. +
+ +
+System Load - Τα δύο αυτά στατιστικά στοιχεία δείχνουν την loadavg ενός συστήματος φορές 100 και το ποσοστό χρήσης της CPU του διακομιστή και ενημερώνεται ανά λεπτό. Η loadavg θα πρέπει να είναι κατά μέσο όρο κάτω των 100 πολλαπλασιάζεται με τον αριθμό των πυρήνων της CPU σας σύστημα, για τη βέλτιστη απόδοση. Η χρήση της CPU ποσοστό θα πρέπει να παραμείνει κάτω από 50 για τη βέλτιστη απόδοση. + +
+
+
+Live Channels - Αυτό το πεδίο δείχνει τον τρέχοντα αριθμό των σταθμών Asterisk που ζουν με το σύστημα τώρα. Είναι σημαντικό να σημειωθεί ότι ο αριθμός των καναλιών Asterisk είναι συνήθως πολύ υψηλότερη από τον πραγματικό αριθμό των κλήσεων σε ένα σύστημα. Το πεδίο αυτό ενημερώνεται μία φορά ανά λεπτό. + +
+
+
+Disk Usage - Το πεδίο αυτό θα δείξει το δίσκο χρήσης για κάθε διαμέρισμα σε αυτόν το διακομιστή. Το πεδίο αυτό ενημερώνεται μία φορά ανά λεπτό. +

@@ -3216,6 +4596,11 @@ echo "
Μέγιστος Αριθμός Trunk του VICIDIAL - Αυτό το πεδίο θα προσδιορίσει τον μέγιστο αριθμό γραμμών, τις οποίες θα χρησιμοποιήσει η διεργασία αυτόατης κλήσης. Εάν θέλετε να αφιερώσετε δύο PRI σε ένα διακομιστή τότε θα πρέπει να το ορίσετε σε 46. Το προκαθορισμένο είναι 96. +
+ +
+Max ζητεί ανά Δεύτερη - Αυτή η ρύθμιση καθορίζει το μέγιστο αριθμό των κλήσεων που μπορούν να διατεθούν από το εξερχόμενο αυτόματη κλήση δέσμης ενεργειών σε αυτόν το διακομιστή ανά δευτερόλεπτο. Πρέπει να είναι από 1 έως 100. Η προεπιλογή είναι 20. +

@@ -3296,6 +4681,111 @@ echo "
Διακύμανση εκτός ορίων - Καθορίζει τον αριθμό των τηλ.κυκλ.συνδ. που δεν επιτρέπετε στο σύστημα να χειριστεί για Διακύμανση Τηλεφωνικής Κλήσης. +
+ +
+Καταγραφή Σύνδεσμος - Η ρύθμιση αυτή σας επιτρέπει να παρακάμπτουν την προεπιλογή της οθόνης του συνδέσμου εγγραφή στο admin ιστοσελίδες. Προεπιλεγμένο είναι SERVER_IP. + +
+
+
+Αναπληρωματικό Καταγραφή IP Διακομιστή - Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε ένα διακομιστή IP ή άλλο μηχάνημα το όνομα που μπορεί να χρησιμοποιηθεί στη θέση του server_ip στις συνδέσεις με ηχογραφήσεις εντός του admin ιστοσελίδες. Προεπιλεγμένο είναι άδειο. + +
+
+
+Asterisk Ενεργό Server - Αν Asterisk δεν εκτελείται σε αυτόν το διακομιστή ή αν VICIDIAL δεν θα πρέπει να χρησιμοποιούν αυτό το διακομιστή ή αν είναι μόνο με τη χρήση αυτού του διακομιστή για άλλα σενάρια, όπως η χοάνη φόρτωσης script που θέλετε να ρυθμίσετε αυτή να Ν. Προεπιλ είναι Y. + +
+
+
+Δημιουργήστε conf αρχεία - Αν θα θέλατε το σύστημα auto-δημιουργούν αστερίσκο conf αρχεία με βάση τις ενδείξεις τηλεφώνων, την εξισορρόπηση φορτίου εγγραφές και εγκατάσταση εντός VICIDIAL τότε που αυτό να είναι Προεπιλ Y. Y. + +
+
+
+Αναδημιουργία conf αρχεία - Αν θέλετε να αναγκάσετε μια ανακατασκευή του Asterisk conf αρχεία ή αν κάποιο από τα τηλέφωνα ή μεταφορέα εγγραφές έχουν αλλάξει, τότε αυτό θα πρέπει να ρυθμιστεί σε Υ. Μετά την conf αρχεία που έχουν δημιουργηθεί και έχει Asterisk φορτώθηκε στη συνέχεια, αυτό θα αλλάξει σε Ν. Προεπιλεγμένο είναι Y. + + + + + +



+ +vicidial_conf_templates ΠΙΝΑΚΑΣ

+
+
+ID Template - Το πεδίο αυτό πρέπει να είναι τουλάχιστον 2 χαρακτήρες και δεν υπερβαίνει τους 15 χαρακτήρες σε μήκος, δεν χώρους. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για τον προσδιορισμό της conf πρότυπο σε ολόκληρο το σύστημα. + +
+
+
+Όνομα - Αυτό είναι το όνομα του αρχείου conf πρότυπο εισόδου. + +
+
+
+Περιεχόμενα Template - Το πεδίο αυτό είναι όπου μπορείτε να εισάγετε τις ειδικές ρυθμίσεις στο να χρησιμοποιηθούν από όλα τα τηλέφωνα και-ή αερομεταφορέων που έχουν ρυθμιστεί να χρησιμοποιούν αυτό το πρότυπο conf. Τα πεδία που δεν θα πρέπει να περιλαμβάνονται στη θέση αυτή είναι: μυστικό, accountcode, υπόψη, username και το γραμματοκιβώτιο. + + + + + +



+ +vicidial_server_carriers ΠΙΝΑΚΑΣ

+
+
+ID Carrier - Το πεδίο αυτό πρέπει να είναι τουλάχιστον 2 χαρακτήρες και δεν υπερβαίνει τους 15 χαρακτήρες σε μήκος, δεν χώρους. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για τον προσδιορισμό του αερομεταφορέα για τη συγκεκριμένη θέση σε όλο το σύστημα. + +
+
+
+Όνομα Carrier - Αυτό είναι το όνομα του μεταφορέα εισόδου. + +
+
+
+Εγγραφή String - Το πεδίο αυτό είναι όπου μπορείτε να εισαγάγετε στον ακριβή συμβολοσειρά που απαιτούνται στο SIP IAX ή αρχείο διαμόρφωσης για να εγγραφείτε στο φορέα παροχής υπηρεσιών. Προαιρετικό αλλά συνιστάται ιδιαίτερα αν ο φορέας σας επιτρέπει την καταχώριση. + +
+
+
+ID Template - Αυτό το προαιρετικό πεδίο σας επιτρέπει να επιλέξετε ένα πρότυπο conf αρχείο για τον εν λόγω αερομεταφορέα εισόδου. + +
+
+
+Λογαριασμός Θέση - Το πεδίο αυτό χρησιμοποιείται αν δεν έχετε επιλέξει να χρησιμοποιήσετε ένα πρότυπο, και είναι όπου μπορείτε να εισαγάγετε στον ειδικό λογαριασμό ρυθμίσεις που πρέπει να χρησιμοποιείται για τον εν λόγω αερομεταφορέα. Αν πρόκειται να λαμβάνουν σε εισερχόμενα κλήσεις από τον εν λόγω αερομεταφορέα κορμού μπορεί να θέλετε να ρυθμίσετε το πλαίσιο = trunkinbound σε αυτό τον τομέα, ώστε να μπορείτε να χρησιμοποιήσετε τη διαδικασία χειρισμού DID εντός VICIDIAL. + +
+
+
+Πρωτόκολλο - Αυτό το πεδίο σας επιτρέπει να ορίσετε το πρωτόκολλο να χρησιμοποιήσετε για την είσοδο του μεταφορέα. Επί του παρόντος μόνο SIP IAX και υποστηρίζονται. + +
+
+
+Globals String - Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε μια global μεταβλητή που θα χρησιμοποιηθεί για τον μεταφορέα στο dialplan. + +
+
+
+Dialplan Είσοδος - Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε ένα σύνολο dialplan καταχωρήσεις να χρησιμοποιήσετε για τον εν λόγω αερομεταφορέα. + +
+
+
+IP Διακομιστή - Αυτό είναι το διακομιστή ότι αυτό το συγκεκριμένο μεταφορέα εγγραφή είναι συνδεδεμένες με. + +
+
+
+Ενεργή - Αυτό καθορίζει εάν ο μεταφορέας θα συμπεριληφθούν στα auto-conf αρχεία που δημιουργούνται ή δεν. + + + +



@@ -3312,13 +4802,19 @@ echo "



- -VICIDIAL_SERVER_TRUNKS ΠΙΝΑΚΑΣ

- -
-Οι Τηλ.Κυκλ.Συνδ. του εξυπηρετητή σας επιτρέπουν να περιορίσετε τις εξερχόμενες γραμμές που χρησιμοποιούνται στον εξυπηρετητή ανά εκστρατεία. Χωρίς αυτές τις εγγραφές, επιτρέπετε στην εκστρατεία να έχει όσες γραμμές μπορεί να έχει, μέχρι τον μέγιστο καθορισμένο αριθμό Τηλ.Κυκλ.Συνδ.. + 0) + { + ?> +



+ VICIDIAL_SERVER_Μπαούλα ΠΙΝΑΚΑΣ

+
+
+ Οι Τηλ.Κυκλ.Συνδ. του εξυπηρετητή σας επιτρέπουν να περιορίσετε τις εξερχόμενες γραμμές που χρησιμοποιούνται στον εξυπηρετητή ανά εκστρατεία. Χωρίς αυτές τις εγγραφές, επιτρέπετε στην εκστρατεία να έχει όσες γραμμές μπορεί να έχει, μέχρι τον μέγιστο καθορισμένο αριθμό Τηλ.Κυκλ.Συνδ.. + @@ -3335,6 +4831,99 @@ echo "
Webroot writable - αυτή η ρύθμιση επιτρέπει σε σας για νακαθορίσει εάν temp τα αρχεία και τα αρχεία επικύρωσης πρέπεινα τοποθετηθούν στο webroot στον κεντρικό υπολογιστή δικτύουσας. Η προεπιλογή είναι 1. +
+ +
+VICIDIAL ο πράκτορας θέτει εκτός λειτουργίας την επίδειξη - αυτός ο τομέας χρησιμοποιείται για να επιλέξει πότε για ναπαρουσιάσει σε έναν πράκτορα πότε η σύνοδός τους έχει τεθείεκτός λειτουργίας από το σύστημα, μια δράση διευθυντών ή απόένα εξωτερικό μέτρο. Η ρύθμιση NOT_ACTIVE θα θέσει εκτόςλειτουργίας το μήνυμα στην οθόνη πρακτόρων. Η ρύθμισηLIVE_ΧΕΙΡΙΣΤΗΣθα επιδείξει μόνο το εκτός λειτουργίας μήνυμα όταναφαιρεθεί το αρχείο πρακτόρων vicidial_auto_calls, όπως κατάτη διάρκεια μιας αποσύνδεσης δύναμης ή της αποσύνδεσης έκτακτηςανάγκης. + +
+
+
+Επιτρέψτε τα μηνύματα SIPSAK - εάν θέστε 1, αυτό θα επιτρέψειτον τηλεφωνικό πίνακα θέτοντας για να εργαστεί κατάλληλα, οκεντρικός υπολογιστής θα στείλει τα μηνύματα στο τηλέφωνοΓΟΥΛΙΏΝ στην επίδειξη στην τηλεφωνική LCD επίδειξη ότανσυνδέεται με VICIDIAL. Αυτό το χαρακτηριστικό γνώρισμαλειτουργεί μόνο με τα τηλέφωνα ΓΟΥΛΙΩΝ και απαιτεί sipsak τηνεφαρμογή για να εγκατασταθεί στον κεντρικό υπολογιστή δικτύου. Ηπροεπιλογή είναι 0. + +
+
+
+Agent API Ενεργό - Αν οριστεί σε 1, αυτό θα επιτρέψει τη διασύνδεση API γραφείο να λειτουργεί. Η προεπιλογή είναι 0. + +
+
+
+Σπίτι URL Admin - αυτό είναι η διεύθυνση URL ήιστοχώρων ότι θα πάτε εάν χτυπήσετε στην ΕΓΧΏΡΙΑ σύνδεση στηνκορυφή της σελίδας admin.php. + +
+
+
+Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων - αυτή ηεπιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στοwebserver κάθε φορά που μεταφέρεται μια κλήση σε ένανπράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες. + +
+
+
+Ώρα ρολόι Τέλος της ημέρας - Αυτή η ρύθμιση καθορίζει, όταν όλοι οι χρήστες θα πρέπει να συνδεθεί αυτόματα από το σύστημα timeclock. Μόνο εκτελείται μία φορά την ημέρα. πρέπει να είναι μόνο 4 ψηφία ψηφίο 2 ώρες και 2 λεπτά ψηφίο στο 24ωρο διάστημα. Η προεπιλογή είναι 0000. + +
+
+
+ΤελευταίαΏρα ρολόι Auto Αποσύνδεση - Αυτό το πεδίο εμφανίζει την ημερομηνία της τελευταίας αυτόματη αποσύνδεση. + +
+
+
+Agent Screen Επικεφαλίδας Ημερομηνία Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή της ημερομηνίας που εμφανίζεται στο πάνω μέρος της οθόνης VICIDIAL πράκτορα. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι MS_DASH_24HR
+MS_DASH_24HR 2008-06-24 23:59:59 - Προκαθορισμένος ημερομηνία με τη μορφή έτος μήνας ημέρα ακολουθούμενη από 24 ώρες χρόνο
+US_SLASH_24HR 06/24/2008 23:59:59 - ΗΠΑ με τη μορφή ημερομηνίας ημέρα του μήνα χρόνου ακολουθούμενη από 24 ώρες χρόνο
+EU_SLASH_24HR 24/06/2008 23:59:59 - Ευρωπαϊκή ημέρα με μορφή Ημέρα Μήνας Έτος ακολουθούμενη από 24 ώρες χρόνο
+AL_TEXT_24HR JUN 24 23:59:59 - Κείμενο με συντετμημένη μορφή ημερομηνίας ημέρα του μήνα ακολουθούμενη από 24 ώρες χρόνο
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Προκαθορισμένος ημερομηνία με τη μορφή έτος μήνας ημέρα ακολουθούμενη από 12 ώρες χρόνο
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - ΗΠΑ με τη μορφή ημερομηνίας ημέρα του μήνα χρόνου ακολουθούμενη από 12 ώρες χρόνο
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Ευρωπαϊκή ημέρα με μορφή Ημέρα Μήνας Έτος ακολουθούμενη από 12 ώρες χρόνο
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Κείμενο με συντετμημένη μορφή ημερομηνίας ημέρα του μήνα ακολουθούμενη από 12 ώρες χρόνο
+ +
+
+
+Agent Screen Πελατών Ημερομηνία Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή των πελατών ζώνη ώρας ημερομηνία που εμφανίζεται στο πάνω μέρος της πληροφόρησης πελατών τμήμα του πράκτορα VICIDIAL οθόνη. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι AL_TEXT_AMPM
+MS_DASH_24HR 2008-06-24 23:59:59 - Προκαθορισμένος ημερομηνία με τη μορφή έτος μήνας ημέρα ακολουθούμενη από 24 ώρες χρόνο
+US_SLASH_24HR 06/24/2008 23:59:59 - ΗΠΑ με τη μορφή ημερομηνίας ημέρα του μήνα χρόνου ακολουθούμενη από 24 ώρες χρόνο
+EU_SLASH_24HR 24/06/2008 23:59:59 - Ευρωπαϊκή ημέρα με μορφή Ημέρα Μήνας Έτος ακολουθούμενη από 24 ώρες χρόνο
+AL_TEXT_24HR JUN 24 23:59:59 - Κείμενο με συντετμημένη μορφή ημερομηνίας ημέρα του μήνα ακολουθούμενη από 24 ώρες χρόνο
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Προκαθορισμένος ημερομηνία με τη μορφή έτος μήνας ημέρα ακολουθούμενη από 12 ώρες χρόνο
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - ΗΠΑ με τη μορφή ημερομηνίας ημέρα του μήνα χρόνου ακολουθούμενη από 12 ώρες χρόνο
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Ευρωπαϊκή ημέρα με μορφή Ημέρα Μήνας Έτος ακολουθούμενη από 12 ώρες χρόνο
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Κείμενο με συντετμημένη μορφή ημερομηνίας ημέρα του μήνα ακολουθούμενη από 12 ώρες χρόνο
+ +
+
+
+Agent Screen Πελατών τηλέφωνο Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή του πελάτη τον αριθμό τηλεφώνου που εμφανίζεται στην κατάσταση τμήμα του πράκτορα VICIDIAL οθόνη. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι US_PARN
+US_DASH 000-000-0000 - USA παύλα διαχωρίζονται αριθμό τηλεφώνου
+US_PARN (000)000-0000 - USA παύλα αριθμός διαχωρίζονται με τον κωδικό περιοχής σε παρένθεση
+MS_NODS 0000000000 - Δεν μορφοποίησης
+UK_DASH 00 0000-0000 - UK παύλα διαχωρίζονται αριθμό τηλεφώνου με το διάστημα μετά την πόλη κωδικός
+AU_SPAC 000 000 000 - Australia χώρος χωρίζεται αριθμό τηλεφώνου
+IT_DASH 0000-000-000 - Italy παύλα διαχωρίζονται αριθμό τηλεφώνου
+FR_SPAC 00 00 00 00 00 - France χώρος χωρίζεται αριθμό τηλεφώνου
+ +
+
+
+Agent interface API Access Ενεργό - This option allows you to enable or disable the agent interface API. Default is 0. + +
+
+
+QC Χαρακτηριστικά Ενεργό - Αυτή η επιλογή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε τη QC ή Ποιοτικός Έλεγχος χαρακτηριστικά. Η προεπιλογή είναι 0 για το ανενεργό. + +
+
+
+Εξερχόμενο Auto-Dial Ενεργό - Αυτή η επιλογή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε τον εξερχόμενο αυτόματης κλήσης εντός VICIDIAL, θέτοντας σε αυτόν τον τομέα θα 0 αφαίρεση των καταλόγων και ΦΙΛΤΡΑ πολλά τμήματα και τομείς από το Εκστρατεία Τροποποίηση οθόνες. Εγχειρίδιο εισόδου κλήσης θα εξακολουθεί να είναι εντός των επιτρεπομένων από τον αντιπρόσωπο της οθόνης, αλλά δεν κατάλογο κλήσης θα είναι δυνατή. Η προεπιλογή είναι 1 για ενεργή. + +
+
+
+Max ΣΥΜΠΛΗΡΩΣΤΕ ζητεί ανά Δεύτερη - Αυτή η ρύθμιση καθορίζει το μέγιστο αριθμό των κλήσεων που μπορούν να διατεθούν από το auto-ΣΥΜΠΛΗΡΩΣΤΕ εξερχό auto-κλήση δέσμης ενεργειών για όλους τους διακομιστές, ανά δευτερόλεπτο. Πρέπει να είναι από 1 έως 200. Η προεπιλογή είναι 40. +

@@ -3376,27 +4965,34 @@ echo "
QueueMetrics EnterQueue Prepend - αυτός ο τομέαςχρησιμοποιείται για να επιτρέψει ένας από τους τομείς στοιχείωνvicidial_list μπροστά από τον τηλεφωνικό αριθμό του πελάτη γιατις προσαρμοσμένες εκθέσεις QueueMetrics. Η προεπιλογή δενείναι ΚΑΜΙΑ για να μην εποικήσει τίποτα.
- +
-VICIDIAL ο πράκτορας θέτει εκτός λειτουργίας την επίδειξη - αυτός ο τομέας χρησιμοποιείται για να επιλέξει πότε για ναπαρουσιάσει σε έναν πράκτορα πότε η σύνοδός τους έχει τεθείεκτός λειτουργίας από το σύστημα, μια δράση διευθυντών ή απόένα εξωτερικό μέτρο. Η ρύθμιση NOT_ACTIVE θα θέσει εκτόςλειτουργίας το μήνυμα στην οθόνη πρακτόρων. Η ρύθμισηLIVE_ΧΕΙΡΙΣΤΗΣθα επιδείξει μόνο το εκτός λειτουργίας μήνυμα όταναφαιρεθεί το αρχείο πρακτόρων vicidial_auto_calls, όπως κατάτη διάρκεια μιας αποσύνδεσης δύναμης ή της αποσύνδεσης έκτακτηςανάγκης. +Ενεργοποίηση Vtiger Ένταξη - Η ρύθμιση αυτή σας δίνει τη δυνατότητα να επιτρέψει την ένταξη Vtiger με VICIDIAL. Σήμερα Vtiger συνδέσμους προς admin και αναζήτησης του χρήστη, καθώς και την αντιγραφή είναι τα μόνα διαθέσιμα στοιχεία ολοκλήρωσης. Η προεπιλογή είναι 0.
-
+
-Επιτρέψτε τα μηνύματα SIPSAK - εάν θέστε 1, αυτό θα επιτρέψειτον τηλεφωνικό πίνακα θέτοντας για να εργαστεί κατάλληλα, οκεντρικός υπολογιστής θα στείλει τα μηνύματα στο τηλέφωνοΓΟΥΛΙΏΝ στην επίδειξη στην τηλεφωνική LCD επίδειξη ότανσυνδέεται με VICIDIAL. Αυτό το χαρακτηριστικό γνώρισμαλειτουργεί μόνο με τα τηλέφωνα ΓΟΥΛΙΩΝ και απαιτεί sipsak τηνεφαρμογή για να εγκατασταθεί στον κεντρικό υπολογιστή δικτύου. Ηπροεπιλογή είναι 0. +Vtiger ΣΠ IP Διακομιστή - Αυτή είναι η διεύθυνση IP της βάσης δεδομένων για την εγκατάσταση Vtiger.
-
+
-Σπίτι URL Admin - αυτό είναι η διεύθυνση URL ήιστοχώρων ότι θα πάτε εάν χτυπήσετε στην ΕΓΧΏΡΙΑ σύνδεση στηνκορυφή της σελίδας admin.php. +Vtiger Database Name - Αυτό είναι το όνομα της βάσης δεδομένων για την βάση δεδομένων σας Vtiger.
-
+
-Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων - αυτή ηεπιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στοwebserver κάθε φορά που μεταφέρεται μια κλήση σε ένανπράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες. - +Σύνδεση Vtiger Database - Αυτό είναι το όνομα χρήστη που χρησιμοποιείται για να συνδεθείτε στο λογαριασμό σας Vtiger βάση δεδομένων. +
+
+
+Vtiger Database Password - Αυτό είναι το κωδικό πρόσβασης που χρησιμοποιείται για να συνδεθείτε στο λογαριασμό σας Vtiger βάση δεδομένων. +
+
+
+Vtiger URL - Αυτό είναι το URL ή διεύθυνση web site που χρησιμοποιείται για να σας Vtiger εγκατάσταση.



@@ -3412,9 +5008,23 @@ echo "\n";echo "\n"; -$stmt="SELECT admin_home_url from system_settings;"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; - -?> -
-
VICIDIAL_STATUS_CATEGORIES ΠΙΝΑΚΑΣ


-Μέσω της χρήσης των κατηγοριών θέσης συστημάτων, μπορείτε νασυγκεντρώσετε τις θέσεις για να επιτρέψετε τη στατιστική ανάλυσησε μια ομάδα θέσεων. Η ταυτότητα κατηγορίας πρέπει να είναι2-20 χαρακτήρες στο μήκος χωρίς τα διαστήματα, το όνομαπρέπει να είναι 2-50 χαρακτήρες στο μήκος, η περιγραφή είναιπροαιρετική και η επίδειξη TimeonVDAD καθορίζει εάν εκείνη ηθέση θα είναι ενός θέσης από μέχρι 4 θέσεις που μπορούν ναυπολογιστούν και να επιδειχθούν στο χρόνο στη σε πραγματικό χρόνοέκθεση VDAD. +Μέσω της χρήσης των κατηγοριών θέσης συστημάτων, μπορείτε νασυγκεντρώσετε τις θέσεις για να επιτρέψετε τη στατιστική ανάλυσησε μια ομάδα θέσεων. Η ταυτότητα κατηγορίας πρέπει να είναι2-20 χαρακτήρες στο μήκος χωρίς τα διαστήματα, το όνομαπρέπει να είναι 2-50 χαρακτήρες στο μήκος, η περιγραφή είναιπροαιρετική και η επίδειξη TimeonVDAD καθορίζει εάν εκείνη ηθέση θα είναι ενός θέσης από μέχρι 4 θέσεις που μπορούν ναυπολογιστούν και να επιδειχθούν στο χρόνο στη σε πραγματικό χρόνοέκθεση VDAD. Η Πώληση Κατηγορία και Dead επικεφαλής της κατηγορίας είναι και οι δύο που χρησιμοποιούνται από το σύστημα όταν Κατάλογος Πρόταση αναλύοντας κατάλογο στατιστικών. + 0) + { + ?> +



+ + QC VICIDIAL κωδικοί

+
+
+ Ο Ποιοτικός Έλεγχος-QC σύστημα εντός VICIDIAL έχει τους δικούς της κωδικοί χωριστά από εκείνα που, κατά την κλήση των λειτουργιών χειρισμού VICIDIAL. QC statuse κωδικοί πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες και δεν περιέχουν ειδικούς χαρακτήρες όπως ένα χώρο ή παχέος εντέρου. Ο κωδικός QC περιγραφή πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες. + +







@@ -3513,7 +5123,7 @@ if ($ADD==73) ###################### if ($ADD==7111111) -{ + { ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; @@ -3553,459 +5163,115 @@ if ($ADD==7111111) $RGSIPexten = 'SIP/gs102'; $RGsession_id = '8600051'; -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; + $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = $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); + 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); + } + + $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("\n","
",$script_text); + + + echo ""; + + echo "Προεπισκόπιση Βοηθού: $script_id
\n"; + echo "
\n"; + echo "
$script_name
\n"; + echo "$script_text\n"; + echo "
\n"; + + echo "\n"; + + exit; } -$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("\n","
",$script_text); - -echo ""; - -echo "Προεπισκόπιση Βοηθού: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') - {$users_hh="bgcolor =\"$users_color\""; $users_fc="$users_font"; $users_bold="$header_selected_bold";} - else {$users_hh=''; $users_fc='WHITE'; $users_bold="$header_nonselected_bold";} -if ($hh=='campaigns') - {$campaigns_hh="bgcolor=\"$campaigns_color\""; $campaigns_fc="$campaigns_font"; $campaigns_bold="$header_selected_bold";} - else {$campaigns_hh=''; $campaigns_fc='WHITE'; $campaigns_bold="$header_nonselected_bold";} -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 ($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 "
English Ελληνικά
BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> - - - - - - - - - - - - - - - 1) { - ?> -> - 1) - { - -# if ($sh=='basic') {$basic_sh="bgcolor=\"$subcamp_color\""; $basic_fc="$subcamp_font";} -# else {$basic_sh=''; $basic_fc='BLACK';} -# if ($sh=='detail') {$detail_sh="bgcolor=\"$subcamp_color\""; $detail_fc="$subcamp_font";} -# else {$detail_sh=''; $detail_fc='BLACK';} -# if ($sh=='dialstat') {$dialstat_sh="bgcolor=\"$subcamp_color\""; $dialstat_fc="$subcamp_font";} -# else {$dialstat_sh=''; $dialstat_fc='BLACK';} - - 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';} - - ?> -> - - - - - - - - - 1) { - ?> - > - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # hard teal - else {$times_sh=''; $times_fc='BLACK';} - if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink - else {$phones_sh=''; $phones_fc='BLACK';} - if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink - else {$server_sh=''; $server_fc='BLACK';} - if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink - else {$conference_sh=''; $conference_fc='BLACK';} - if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink - else {$settings_sh=''; $settings_fc='BLACK';} - if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink - else {$status_sh=''; $status_fc='BLACK';} - - ?> -> - - - - - - - - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - \n"; - echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε.\n"; - } - -} -if (strlen($reports_hh) > 1) { - ?> -> - - - - -
  ΔΙΑΧΕΙΡΙΣΗ - ΣΠΙΤΙ | Αποσύνδεση  
> SIZE=> Χρήστες > SIZE=> Εκστρατείες > SIZE=> Κατάλογοι > SIZE=> Χειρόγραφα > SIZE=> Φίλτρα > SIZE=> $$$-ΟΜΑΔΕΣ > SIZE=> Ομάδες χρηστών > SIZE=> Μακρινοί πράκτορες > SIZE=> Admin > SIZE=> Εκθέσεις
>   > Παρουσιάστε χρήστες     |     > Προσθέστε έναν νέο χρήστη     |     > Χρήστης αντιγράφων     |     > Αναζήτηση ενός χρήστη
COLSPAN=2> SIZE=>Κεντρικός αγωγός εκστρατειών COLSPAN=1> SIZE=> Statuses COLSPAN=1> SIZE=> HotKeys COLSPAN=2> SIZE=>Μόλυβδος ανακύκλωσης COLSPAN=1> SIZE=>Αυτόματος-ALT πίνακας COLSPAN=1> SIZE=>Κώδικες μικρής διακοπής COLSPAN=2> SIZE=>Μίγμα καταλόγων
>   > Παρουσιάστε εκστρατείες     |     > Προσθέστε μια νέα εκστρατεία     |     > Εκστρατεία αντιγράφων     |     > Σε πραγματικό χρόνο περίληψη εκστρατειών
>   > Παρουσιάστε καταλόγους     |     > Προσθέστε έναν νέο κατάλογο     |     > Αναζήτηση ενός μολύβδου     |     > Προσθέστε τον αριθμό σε DNC     |     > Νέοι μόλυβδοι φορτίων
>   > Παρουσιάστε χειρόγραφα     |     > Προσθέστε ένα νέο χειρόγραφο
>   > Παρουσιάστε φίλτρα     |     > Προσθέστε ένα νέο φίλτρο
>   > Παρουσιάστε-ΟΜΑΔΕΣ     |     > Προσθέστε μια νέα-ΟΜΑΔΑ     |     > $$$-ΟΜΑΔΑ αντιγράφων
>   > Παρουσιάστε ομάδες χρηστών     |     > Προσθέστε μια νέα ομάδα χρηστών     |     > Ωριαία έκθεση ομάδας
>   > Παρουσιάστε μακρινούς πράκτορες     |     > Προσθέστε τους νέους μακρινούς πράκτορες
COLSPAN=2> SIZE=> Χρόνοι κλήσης COLSPAN=2> SIZE=> Τηλέφωνα COLSPAN=2> SIZE=> Διασκέψεις COLSPAN=1> SIZE=> Κεντρικοί υπολογιστές COLSPAN=1> SIZE=> Τοποθετήσεις συστημάτων COLSPAN=2> SIZE=>Θέσεις συστημάτων
>   > Παρουσιάστε χρόνους κλήσης     |     > Προσθέστε έναν νέο χρόνο κλήσης     |     > Παρουσιάστε χρόνους κρατικής κλήσης     |     > Προσθέστε έναν νέο χρόνο κρατικής κλήσης  
>   > Παρουσιάστε τηλέφωνα   |   > Προσθέστε ένα νέο τηλέφωνο
> Παρουσιάστε διασκέψεις   |   > Προσθέστε μια νέα διάσκεψη   |   > Παρουσιάστε διασκέψεις VICIDIAL   |   > Προσθέστε μια νέα διάσκεψη VICIDIAL
> Παρουσιάστε κεντρικούς υπολογιστές   |   > Προσθέστε έναν νέο κεντρικό υπολογιστή
> Τοποθετήσεις συστημάτων
>Θέσεις συστημάτων   |   >Κατηγορίες θέσης
>  
- 1) { ###################### if ($ADD=="1") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; - - echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ
\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE
Ομάδα Χρήστη: \n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
\n"; + echo ""; + + echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE
Ομάδα Χρήστη:
Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
\n"; } - echo "$Ugroups_list"; - echo "\n"; - echo "
Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
\n"; - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### -# ADD=1 display the COPY USER FORM SCREEN +# ADD=1A display the COPY USER FORM SCREEN ###################### if ($ADD=="1A") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_users==1) + { + echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
ΧΡΗΣΤΗΣ ΑΝΤΙΓΡΑΦΩΝ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ΧΡΗΣΤΗΣ ΑΝΤΙΓΡΑΦΩΝ\n"; + echo "\n"; + echo "\n"; + echo "
Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} - echo "\n"; + echo "\n"; + echo "
Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
Source User:
Source Χρήστης: $NWB#vicidial_users-user$NWE
\n"; } - echo "$Uusers_list"; - echo "$NWB#vicidial_users-user$NWE
\n"; - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4124,41 +5394,49 @@ if ($ADD=="1A") ###################### if ($ADD==11) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + 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"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Εκστρατείας: $NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Περιγραφή εκστρατείας: $NWB#vicidial_campaigns-campaign_description$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: $NWB#vicidial_campaigns-park_ext$NWE
Ονομα Αρχείου Στάθμευσης: $NWB#vicidial_campaigns-park_file_name$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Χρόνος Τοπικής Κλήσης: $NWB#vicidial_campaigns-local_call_time$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Βοηθός: $NWB#vicidial_campaigns-campaign_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
\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"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Εκστρατείας: $NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Περιγραφή εκστρατείας: $NWB#vicidial_campaigns-campaign_description$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: $NWB#vicidial_campaigns-park_ext$NWE
Ονομα Αρχείου Στάθμευσης: $NWB#vicidial_campaigns-park_file_name$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Χρόνος Τοπικής Κλήσης: $NWB#vicidial_campaigns-local_call_time$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Βοηθός: $NWB#vicidial_campaigns-campaign_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4166,19 +5444,19 @@ if ($ADD==11) ###################### if ($ADD==12) -{ - if ($LOGmodify_campaigns==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_campaigns==1) + { + echo "\n"; - - echo "\n"; - echo "
\n"; + echo ""; - echo "
ΑΝΤΙΓΡΑΨΤΕ μια ΕΚΣΤΡΑΤΕΙΑ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
ΑΝΤΙΓΡΑΨΤΕ μια ΕΚΣΤΡΑΤΕΙΑ\n"; + echo "\n"; + echo "
ID Εκστρατείας: $NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID Εκστρατείας: $NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Εκστρατεία πηγής:
Εκστρατεία πηγής:$NWB#vicidial_campaigns-campaign_id$NWE
ΣΗΜΕΙΩΣΗ: Η αντιγραφή μιας εκστρατείας θα αντιγράψετε όλες τις ρυθμίσεις από τον πλοίαρχο καμπάνια που θα επιλέξετε, αλλά δεν θα αντιγράψετε μια καμπάνια ειδικά DNC λίστα αν υπήρχε ένα master με την επιλεγμένη καμπάνια.
\n"; } - echo "$campaigns_list"; - echo "$NWB#vicidial_campaigns-campaign_id$NWE
\n"; - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4210,19 +5490,19 @@ if ($ADD==12) ###################### if ($ADD==111) -{ - if ($LOGmodify_lists==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; - echo "
ADD A NEW LIST\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Λίστας: (μόνο αριθμοί)$NWB#vicidial_lists-list_id$NWE
Ονομα Λίστας: $NWB#vicidial_lists-list_name$NWE
Περιγραφή καταλόγων: $NWB#vicidial_lists-list_description$NWE
Εκστρατεία: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Λίστας: (μόνο αριθμοί)$NWB#vicidial_lists-list_id$NWE
Ονομα Λίστας: $NWB#vicidial_lists-list_name$NWE
Περιγραφή καταλόγων: $NWB#vicidial_lists-list_description$NWE
Εκστρατεία: $NWB#vicidial_lists-campaign_id$NWE
Ενεργή:$NWB#vicidial_lists-active$NWE
\n"; } - echo "$campaigns_list"; - echo "\n"; - echo "$NWB#vicidial_lists-campaign_id$NWE
Ενεργή:$NWB#vicidial_lists-active$NWE
\n"; - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4255,79 +5536,128 @@ if ($ADD==111) ###################### if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + echo "
\n"; + echo ""; + + $campaigns_list = "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id"; $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ - αυτός ο τηλεφωνικός αριθμός είναι ήδη δενκαλεί τον κατάλογο: $phone_number

\n";} - else + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } - echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); + 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 "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ - αυτός ο τηλεφωνικός αριθμός είναι ήδη δενκαλεί τον κατάλογο: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ: $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='ΛΙΣΤΕΣ', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ΠΡΟΣΘΕΣΤΕ ΤΟΝ ΑΡΙΘΜΟ ΣΕ 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] > 0) + {echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ - αυτός ο τηλεφωνικός αριθμός είναι ήδη δενκαλεί τον κατάλογο: $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 "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ: $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='ΛΙΣΤΕΣ', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; } } + + echo "
ADD αριθμούς στην DNC ΚΑΤΑΛΟΓΟΣ\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Τηλέφωνα:

(έναν αριθμό τηλεφώνου σε κάθε γραμμή μόνο)
$NWB#vicidial_list-dnc$NWE
\n"; } -echo "
ΠΡΟΣΘΕΣΤΕ έναν ΑΡΙΘΜΟ στον ΚΑΤΑΛΟΓΟ DNC\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Τηλεφωνικός αριθμός: (μόνο αριθμοί)$NWB#vicidial_list-dnc$NWE
\n"; - -} - ###################### # ADD=1111 display the ADD NEW INBOUND GROUP SCREEN ###################### if ($ADD==1111) -{ + { if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; + { + 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"; - echo "
ID Ομάδας: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
Βοηθός: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } + echo "
ΠΡΟΣΘΗΚΗ ΕΙΣΕΡΧΟΜΕΝΗΣ ΟΜΑΔΑΣ\n"; + echo "\n"; + echo "
\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 Ομάδας: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
Βοηθός: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4335,19 +5665,19 @@ if ($ADD==1111) ###################### if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_ingroups==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
ΕΙΣΕΡΧΟΜΕΝΗ ΟΜΑΔΑ ΑΝΤΙΓΡΑΦΩΝ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
ΕΙΣΕΡΧΟΜΕΝΗ ΟΜΑΔΑ ΑΝΤΙΓΡΑΦΩΝ\n"; + echo "\n"; + echo "
ID Ομάδας: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$groups_list"; + echo "$NWB#vicidial_inbound_groups-group_id$NWE\n"; - echo "\n"; - echo "
ID Ομάδας: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Source ID Ομάδας:
Source ID Ομάδας: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } + echo "
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
ADD A NEW DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
DID Επέκταση: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Περιγραφή:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=1411 display the COPY DID SCREEN +###################### + +if ($ADD==1411) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
ΑΝΤΙΤΥΠΟ DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
DID Επέκταση: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Περιγραφή:$NWB#vicidial_inbound_dids-did_description$NWE
DID Πηγή:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4379,38 +5782,38 @@ if ($ADD==1211) ###################### if ($ADD==11111) -{ + { if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; + { + 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 "
ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
Εισερχόμενες Ομάδες: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\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 Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
Εισερχόμενες Ομάδες: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4418,26 +5821,26 @@ if ($ADD==11111) ###################### if ($ADD==111111) -{ + { if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΗΚΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } + echo "
ΠΡΟΣΘΗΚΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4445,72 +5848,72 @@ if ($ADD==111111) ###################### if ($ADD==1111111) -{ + { if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ταυτότητα χειρογράφων:: (όχι κενά ή στίξη)$NWB#vicidial_scripts-script_id$NWE
Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
Ενεργή:$NWB#vicidial_scripts-active$NWE
Κείμενο χειρόγραφου: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Ταυτότητα χειρογράφων:: (όχι κενά ή στίξη)$NWB#vicidial_scripts-script_id$NWE
Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
Ενεργή:$NWB#vicidial_scripts-active$NWE
Κείμενο χειρόγραφου: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4518,28 +5921,28 @@ if ($ADD==1111111) ###################### if ($ADD==11111111) -{ + { if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Φίλτρου: (όχι κενά ή στίξη)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } + echo "
ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Φίλτρου: (όχι κενά ή στίξη)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4547,29 +5950,29 @@ if ($ADD==11111111) ###################### if ($ADD==111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; + echo "\n"; + echo "
ID Χρόνου Κλήσης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Χρόνου Κλήσης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; - } + echo "
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4577,30 +5980,70 @@ if ($ADD==111111111) ###################### if ($ADD==1111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; + echo "\n"; + echo "
ID Χρόνου Κλήσης Κατάστασης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (όχι κενά ή στίξη)$NWB#vicidial_call_times-state_call_time_state$NWE
Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Χρόνου Κλήσης Κατάστασης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (όχι κενά ή στίξη)$NWB#vicidial_call_times-state_call_time_state$NWE
Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; - } + echo "
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
Shift ID: (όχι κενά ή στίξη)$NWB#vicidial_shifts-shift_id$NWE
Shift Όνομα: (σύντομη περιγραφή της μετατόπισης)$NWB#vicidial_shifts-shift_name$NWE
Shift Ώρα έναρξης:\n"; + echo "   Shift End Time:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Μήκος: $NWB#vicidial_shifts-shift_length$NWE
Shift Καθημερινά:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Κυριακή
\n"; + echo "Δευτέρα
\n"; + echo "Τρίτη
\n"; + echo "Τετάρτη
\n"; + echo "Πέμπτη
\n"; + echo "Παρασκευή
\n"; + echo "Σάββατο
\n"; + echo "
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4608,47 +6051,111 @@ if ($ADD==1111111111) ###################### if ($ADD==11111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + 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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Περιεχόμενο Φωνητικού Ταχυδρομείου: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
IP Διακομιστή: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Τηλεφωνητής Box: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
IP Διακομιστή: $NWB#phones-server_ip$NWE
Σύνδεση:$NWB#phones-login$NWE
Κωδικός:$NWB#phones-pass$NWE
Κατάσταση:$NWB#phones-status$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#phones-server_ip$NWE
Σύνδεση:$NWB#phones-login$NWE
Κωδικός:$NWB#phones-pass$NWE
Κατάσταση:$NWB#phones-status$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=12111111111 display the ADD NEW PHONE ALIAS SCREEN +###################### + +if ($ADD==12111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
ΠΡΟΣΘΗΚΗ ΤΗΛΕΦΩΝΟΥ ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Γνωστός ID:$NWB#phones-alias_id$NWE
Ψευδώνυμο: $NWB#phones-alias_name$NWE
Τηλέφωνο logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN +###################### + +if ($ADD==13111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
ADD μια νέα ομάδα ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Ομάδα Γνωστός ID: $NWB#phones-group_alias_id$NWE
Ομάδα ψευδώνυμο: $NWB#phones-group_alias_name$NWE
CallerID Αριθμός: $NWB#phones-caller_id_number$NWE
CallerID Όνομα: $NWB#phones-caller_id_name$NWE
Ενεργή:
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4656,29 +6163,127 @@ if ($ADD==11111111111) ###################### if ($ADD==111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΗΚΗ ΔΙΑΚΟΜΙΣΤΗ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
\n"; - } + echo "
ΠΡΟΣΘΗΚΗ ΔΙΑΚΟΜΙΣΤΗ\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
Προσθήκη νέου ΠΙΣΤ TEMPLATE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Αναγνωριστικό: $NWB#vicidial_conf_templates-template_id$NWE
Όνομα: $NWB#vicidial_conf_templates-template_name$NWE
Template Περιεχόμενα: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==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 "
Θαλαμίσκος ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Φέρον Όνομα: $NWB#vicidial_server_carriers-carrier_name$NWE
Εγγραφή String: $NWB#vicidial_server_carriers-registration_string$NWE
Αναγνωριστικό: $NWB#vicidial_server_carriers-template_id$NWE
Λογαριασμός Είσοδος: $NWB#vicidial_server_carriers-account_entry$NWE
Πρωτόκολλο: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Είσοδος: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Διακομιστή: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4686,30 +6291,30 @@ if ($ADD==111111111111) ###################### if ($ADD==1111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ΠΡΟΣΘΗΚΗ ΣΥΝΔΙΑΛΕΞΗΣ\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
IP Διακομιστή: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
IP Διακομιστή: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} ###################### @@ -4717,30 +6322,30 @@ if ($ADD==1111111111111) ###################### if ($ADD==11111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW VICIDIAL CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
IP Διακομιστή: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
IP Διακομιστή: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} @@ -4756,7 +6361,7 @@ if ($ADD==11111111111111) ###################### if ($ADD=="2") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4765,38 +6370,265 @@ if ($ADD=="2") {echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένας χρήστης με αυτό τον αριθμό\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if (ereg('AUTOGENERA',$user)) + { + $user = 'AUTOGENERA'; + } + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το id χρήστη πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
το πλήρες όνομα και κωδικός πρέπει να είναι τουλάχιστον 2 χαρακτήρες\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 "
ΧΡΗΣΤΗΣ ΠΡΟΣΤΕΘΗΚΕ: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='ΧΡΗΣΤΕΣ', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); + $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 = 'Ενεργό'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=3; + } ###################### # ADD=2A adds the copied new user to the system ###################### if ($ADD=="2A") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4805,15 +6637,53 @@ if ($ADD=="2A") {echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένας χρήστης με αυτό τον αριθμό\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) { echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το id χρήστη πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
το πλήρες όνομα και κωδικός πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "\n"; } else { - $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) 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 from vicidial_users where user=\"$source_user_id\";"; + 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) 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 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\";"; @@ -4822,30 +6692,216 @@ if ($ADD=="2A") $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='ΧΡΗΣΤΕΣ', event_type='COPY', record_id='$user', event_code='ADMIN ΧΡΗΣΤΗΣ ΑΝΤΙΓΡΑΦΩΝ', 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 = 'Ενεργό'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A COPIED USER |$PHP_AUTH_USER|$ip|$user|$source_user_id|$stmt|\n"); - fclose($fp); - } } } -exit; -} + exit; + } ###################### # ADD=21 adds the new campaign to the system ###################### if ($ADD==21) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4874,31 +6930,28 @@ if ($ADD==21) $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) 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); - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $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='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } } } -$ADD=31; -} + $ADD=31; + } ###################### # ADD=20 adds copied new campaign to the system ###################### if ($ADD==20) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4917,7 +6970,7 @@ if ($ADD==20) { echo "
CAMPAIGN 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,safe_harbor_message,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) 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,safe_harbor_message,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $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) 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 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');"; @@ -4935,27 +6988,24 @@ if ($ADD==20) $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); - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY TO NEW CAMPAIGN|$PHP_AUTH_USER|$ip|$campaign_id|$source_campaign_id|$stmt|$stmtA|\n"); - fclose($fp); - } - + ### 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='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=31; -} + $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';"; $rslt=mysql_query($stmt, $link); @@ -4984,19 +7034,19 @@ if ($ADD==22) $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ STATUS', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$SUB=22; -$ADD=31; -} + $SUB=22; + $ADD=31; + } ###################### @@ -5004,7 +7054,7 @@ $ADD=31; ###################### if ($ADD==23) -{ + { $HKstatus_data = explode('-----',$HKstatus); $status = $HKstatus_data[0]; $status_name = $HKstatus_data[1]; @@ -5030,18 +7080,18 @@ if ($ADD==23) $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ HOT KEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ HOTKEY', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=23; -$ADD=31; -} + $SUB=23; + $ADD=31; + } ###################### @@ -5049,7 +7099,7 @@ $ADD=31; ###################### if ($ADD==25) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; @@ -5059,11 +7109,11 @@ if ($ADD==25) {echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ - υπάρχει ήδη έναςμόλυβδος-ανακύκλωσης για αυτήν την εκστρατεία με αυτήν την θέση\n";} else { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ - παρακαλώ επιστρέψτεκαι εξετάστε τα στοιχεία που εισαγάγατε\n"; echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; + echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα και λιγότερο από 43.200 δευτερολέπτων ή 12 ωρών\n"; echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; } else @@ -5073,18 +7123,18 @@ if ($ADD==25) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=25; -$ADD=31; -} + $SUB=25; + $ADD=31; + } ###################### @@ -5092,7 +7142,7 @@ $ADD=31; ###################### 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 %\";"; @@ -5120,18 +7170,18 @@ if ($ADD==26) $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A AUTO-ALT-DIAL STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ ALT DIAL', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$auto_alt_dial_statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=26; -$ADD=31; -} + $SUB=26; + $ADD=31; + } ###################### @@ -5139,7 +7189,7 @@ $ADD=31; ###################### 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); @@ -5152,7 +7202,7 @@ if ($ADD==27) { echo "
ΚΩΔΙΚΑΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΠΡΑΚΤΟΡΩΝ ΠΡΟΣΤΙΘΕΜΕΝΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; echo "
pause code must be between 1 and 6 characters in length\n"; - echo "
pause code name must be between 2 and 30 characters in length\n"; + echo "
pause κωδικό όνομα πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες\n"; } else { @@ -5161,18 +7211,18 @@ if ($ADD==27) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW ΧΕΙΡΙΣΤΗΣPAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Κώδικας μικρής διακοπής: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=27; -$ADD=31; -} + $SUB=27; + $ADD=31; + } ###################### @@ -5180,7 +7230,7 @@ $ADD=31; ###################### if ($ADD==28) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; @@ -5208,18 +7258,18 @@ if ($ADD==28) $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ DIAL STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -#$SUB=28; -$ADD=31; -} + #$SUB=28; + $ADD=31; + } ###################### @@ -5227,7 +7277,7 @@ $ADD=31; ###################### if ($ADD==211) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); @@ -5250,17 +7300,17 @@ if ($ADD==211) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ΛΙΣΤΕΣ', 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=311; + } @@ -5269,7 +7319,7 @@ $ADD=311; ###################### if ($ADD==2111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5296,20 +7346,23 @@ if ($ADD==2111) $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) 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 "
ΟΜΑΔΑ ΠΡΟΣΤΕΘΗΚΕ: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 Εισερχόμενα GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=3111; -} + $ADD=3111; + } ###################### @@ -5317,7 +7370,7 @@ $ADD=3111; ###################### if ($ADD==2011) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5334,22 +7387,118 @@ if ($ADD==2011) } 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_message,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) 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_message,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
ΟΜΑΔΑ ΠΡΟΣΤΕΘΗΚΕ: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 ΕΙΣΕΡΧΟΜΕΝΗ ΟΜΑΔΑ ΑΝΤΙΓΡΑΦΩΝ', 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 "
Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ - υπάρχει ήδη μια DID στο σύστημα με αυτό το ID\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 "
Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ - υπάρχει ήδη μια DID στο σύστημα με την παράταση αυτή\n";} + else + { + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPIED TO NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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=3111; -} + $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 "
Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ - υπάρχει ήδη μια DID στο σύστημα με την παράταση αυτή\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 "
Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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) 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 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 ΑΝΤΙΤΥΠΟ DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3311; + } ###################### @@ -5357,7 +7506,7 @@ $ADD=3111; ###################### 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); @@ -5378,24 +7527,24 @@ if ($ADD==21111) echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΠΡΟΣΤΕΘΗΚΑΝ: $user_start\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } + ### 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=10000; + } ###################### # ADD=211111 adds new user group to the system ###################### if ($ADD==211111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); @@ -5416,24 +7565,100 @@ if ($ADD==211111) echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΠΡΟΣΤΕΘΗΚΕ: $user_group\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 ΠΡΟΣΘΗΚΗ ΟΜΑΔΑΣ ΧΡΗΣΤΗ', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=100000; + } ###################### # ADD=2111111 adds new script to the system ###################### if ($ADD==2111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); @@ -5454,17 +7679,17 @@ if ($ADD==2111111) echo "
Ο ΒΟΗΘΟΣ ΠΡΟΣΤΕΘΗΚΕ: $script_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ΒΟΗΘΟΙ', event_type='ADD', record_id='$script_id', event_code='ADMIN ΠΡΟΣΘΕΣΕ ΒΟΗΘΟ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=1000000; -} + $ADD=1000000; + } ###################### @@ -5472,7 +7697,7 @@ $ADD=1000000; ###################### if ($ADD==21111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); @@ -5493,17 +7718,17 @@ if ($ADD==21111111) echo "
ΤΟ ΦΙΛΤΡΟ ΠΡΟΣΤΕΘΗΚΕ: $lead_filter_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ΦΙΛΤΡΑ', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=10000000; -} + $ADD=10000000; + } ###################### @@ -5511,7 +7736,7 @@ $ADD=10000000; ###################### if ($ADD==211111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); @@ -5532,17 +7757,17 @@ if ($ADD==211111111) echo "
ΠΡΟΣΘΗΚΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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=311111111; + } ###################### @@ -5550,7 +7775,7 @@ $ADD=311111111; ###################### 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); @@ -5571,17 +7796,66 @@ if ($ADD==2111111111) echo "
ΠΡΟΣΘΗΚΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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=3111111111; + } + + +###################### +# ADD=231111111 adds new shift definition to the system +###################### + +if ($ADD==231111111) + { + 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 "
SHIFT ΟΡΙΣΜΟΣ δεν προστίθενται - υπάρχει ήδη μια μετατόπιση προς την παρούσα θέση 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 "
SHIFT ΟΡΙΣΜΟΣ δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
ID Shift και το όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
Shift ώρα έναρξης πρέπει να είναι 4 ψηφία στο μήκος και να είναι μια έγκυρη ώρα\n"; + echo "
Shift Μήκος 5 χαρακτήρες πρέπει να είναι σε μήκος και να είναι 24 ώρες ή λιγότερο\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); + + echo "
SHIFT ΠΡΟΣΤΙΘΕΜΕΝΗ:$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; + } ###################### @@ -5589,8 +7863,7 @@ $ADD=3111111111; ###################### if ($ADD==21111111111) -{ -echo "
\n"; + { echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5599,18 +7872,127 @@ echo "
\n"; {echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένα τηλέφωνο με αυτή την εσωτ.σύνδεση/διακομιστή\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 "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\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 - υπάρχει ήδη ένα τηλέφωνο στο σύστημα με αυτή τη σύνδεση\n";} + else { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΠΡΟΣΤΕΘΗΚΕ\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');"; + $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 - υπάρχει ήδη ένα τηλέφωνο άλλως στο σύστημα με αυτή τη σύνδεση\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 "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} + else + { + echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΠΡΟΣΤΕΘΗΚΕ\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); + + ### 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=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 "
PHONE ALIAS δεν προστίθενται - υπάρχει ήδη ένα τηλέφωνο Γνωστός στο σύστημα με αυτό το 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 "
PHONE ALIAS δεν προστίθενται - υπάρχει ήδη μια Τηλέφωνο Σύνδεση στο σύστημα με αυτό το ID\n";} + else + { + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
PHONE ALIAS δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
PHONE ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ\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 PHONE ALIAS', 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 δεν προστίθενται - υπάρχει ήδη ένα τηλέφωνο Γνωστός στο σύστημα με αυτό το ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) + {echo "
ΟΜΑΔΑ ALIAS δεν προστίθενται - δεν μπορείτε να χρησιμοποιήσετε τις δεσμευμένες λέξεις της ομάδας ψευδώνυμα\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
ΟΜΑΔΑ ALIAS δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
ΟΜΑΔΑ ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ\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; + } ###################### @@ -5618,8 +8000,7 @@ $ADD=31111111111; ###################### if ($ADD==211111111111) -{ -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 * 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 "
\n"; + { echo ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); @@ -5636,10 +8017,18 @@ echo "\n";} echo "\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 -| @@ -10088,7 +14786,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "\n"; echo "ADD   \n"; echo "ΑΦΑΙΡΕΣΤΕ\n"; @@ -10149,7 +14847,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "$mixlists_list"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -10608,7 +15306,6 @@ if ($ADD==311) $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); @@ -10621,7 +15318,7 @@ if ($ADD==311) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
\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); + + ### 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=311111111111; + } ###################### @@ -5647,7 +8036,7 @@ $ADD=311111111111; ###################### if ($ADD==221111111111) -{ + { echo ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5686,18 +8075,90 @@ if ($ADD==221111111111) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW VICIDIAL TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 ΔΙΑΚΟΜΙΣΤΗΣ TRUNK', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=311111111111; -} + $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 δεν προστίθενται - υπάρχει ήδη ένα πρότυπο σε αυτό το σύστημα, με αυτό το ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
ΠΙΣΤ TEMPLATE δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
ΠΙΣΤ TEMPLATE ΠΡΟΣΤΙΘΕΜΕΝΗ\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 "
ΘΑΛΑΜΙΣΚΟ δεν προστίθενται - υπάρχει ήδη ένα μεταφορέα στο σύστημα με αυτό το ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
ΘΑΛΑΜΙΣΚΟ δεν προστίθενται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $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='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; + } ###################### @@ -5705,8 +8166,7 @@ $ADD=311111111111; ###################### if ($ADD==2111111111111) -{ -echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "ΑΦΑΙΡΕΣΤΕ\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; - } - } + {echo "\n";} + echo "$NWB#vicidial_campaigns-list_order_mix$NWE\n"; - echo "\n"; - echo "$statuses_list"; - echo "   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; } - echo " $NWB#vicidial_campaigns-adaptive_intensity$NWE\n"; - echo "\n"; echo "\n"; @@ -9840,71 +14479,129 @@ if ($ADD==34) echo "
\n"; + { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5725,8 +8185,8 @@ echo ""; echo ""; echo ""; - echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + } echo "\n"; echo "\n"; + if ($SSoutbound_autodial_active < 1) + { + echo ""; + } echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=3111111111111; -} + $ADD=3111111111111; + } ###################### @@ -5734,8 +8194,7 @@ $ADD=3111111111111; ###################### if ($ADD==21111111111111) -{ -echo "\n"; echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "ΑΦΑΙΡΕΣΤΕ\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; - } - } + {echo "\n";} + echo "$NWB#vicidial_campaigns-list_order_mix$NWE\n"; - echo "\n"; - echo "$statuses_list"; - echo "   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; + $n=100; + while ($n>=1) + { + echo "\n"; + $n--; + } + echo "% $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $n=40; + while ($n>=-40) + { + $dtl = 'Balanced'; + if ($n<0) {$dtl = 'Less Intense';} + if ($n>0) {$dtl = 'More Intense';} + if ($n == $adaptive_intensity) + {echo "\n";} + else + {echo "\n";} + $n--; + } + echo " $NWB#vicidial_campaigns-adaptive_intensity$NWE\n"; - echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; } - echo " $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE\n"; - - echo "\n"; - - - echo "\n"; echo "\n"; @@ -9159,8 +13488,10 @@ if ($ADD==31) echo "\n"; echo "$NWB#vicidial_campaigns-local_call_time$NWE\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"; @@ -9188,8 +13521,12 @@ if ($ADD==31) echo "\n"; - echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -9198,34 +13535,109 @@ if ($ADD==31) echo "\n"; - echo "\n"; - + if ($SSoutbound_autodial_active > 0) + { + 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"; 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"; + + 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"; + } + else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + if ($campaign_allow_inbound == 'Y') { echo "
\n"; + { echo ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5754,8 +8213,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) { @@ -8729,9 +12866,18 @@ if ($ADD==3) 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"; + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } } if ($LOGuser_level > 8) { @@ -8763,6 +12917,8 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8770,6 +12926,8 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8777,16 +12935,26 @@ if ($ADD==3) 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"; echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=31111111111111; -} + $ADD=31111111111111; + } ###################### @@ -5763,8 +8222,7 @@ $ADD=31111111111111; ###################### if ($ADD==221111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status';"; $rslt=mysql_query($stmt, $link); @@ -5793,18 +8251,18 @@ if ($ADD==221111111111111) $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SYSTEMSTATUSES', event_type='ADD', record_id='$status', 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=321111111111111; + } ###################### @@ -5812,8 +8270,7 @@ $ADD=321111111111111; ###################### if ($ADD==231111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_query($stmt, $link); @@ -5830,7 +8287,7 @@ if ($ADD==231111111111111) } else { - echo "
STATUS CATEGORY ADDED: $vsc_id - $vsc_name\n"; + echo "
STATUS ΚΑΤΗΓΟΡΙΑ 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); @@ -5841,20 +8298,61 @@ if ($ADD==231111111111111) echo "
ΛΑΘΟΣ: Υπάρχουν ήδη 4 κατηγορίες θέσης καθορισμένες την επίδειξηTimeOnVDAD\n"; } - $stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display');"; + $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATUS CATEGORY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 ΚΑΤΗΓΟΡΙΑ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=331111111111111; -} + $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 "
QC Κατάσταση ΚΩΔΙΚΟΣ δεν προστίθενται- υπάρχει ήδη μια qc κωδικό στο σύστημα με αυτό το όνομα: $row[0]\n";} + else + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
QC Κατάσταση ΚΩΔΙΚΟΣ δεν προστίθενται- Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
κωδικός πρέπει να είναι μεταξύ 1 και 8 χαρακτήρες\n"; + echo "
κωδικό όνομα πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες\n"; + } + else + { + echo "
QC Κατάσταση ΠΡΟΣΤΙΘΕΝΤΑΙ ΚΩΔΙΚΟΣ:$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='QCSTATUSES', 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; + } @@ -5883,20 +8381,211 @@ if ($ADD=="4A") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - 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' where user='$user';"; + $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' 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='ΧΡΗΣΤΕΣ', 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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ############################################################### + ##### 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Ενεργό'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5925,18 +8614,211 @@ if ($ADD=="4B") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - 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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='ΧΡΗΣΤΕΣ', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Ενεργό'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5968,16 +8850,203 @@ if ($ADD==4) { echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='ΧΡΗΣΤΕΣ', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Ενεργό'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5989,90 +9058,164 @@ $ADD=3; # go to user modification below } ###################### -# ADD=41 submit campaign modifications to the system +# ADD=41 submit campaign modifications to the system - DETAIL ###################### if ($ADD==41) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; - echo "
|$campaign_name|$active|\n"; - } - else - { - echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; + echo ""; - if ($dial_method == 'MANUAL') + if ($SSoutbound_autodial_active < 1) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + $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 = '8300'; + $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'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
ΔΡΑΣΤΙΚΗΣ ΚΑΤΑΛΟΓΟΙ ΜΕΤΑΒΑΛΛΟΜΕΝΩΝ"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE ΛΙΣΤΕΣ', 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 ($dial_level_override > 0) + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; + echo "
|$campaign_name|$active|\n"; } - else + else { - if ($dial_method == 'RATIO') + echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; + + if ($dial_method == 'MANUAL') { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_level_override > 0) { - $auto_dial_level = "1.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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; + echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - 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',safe_harbor_message='$safe_harbor_message',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' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; - echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; - } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } $ADD=31; # go to campaign modification form below } @@ -6104,14 +9247,13 @@ if ($ADD==42) $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmtA, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } if (ereg('modify',$stage)) { @@ -6120,13 +9262,13 @@ if ($ADD==42) $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -6163,13 +9305,13 @@ if ($ADD==43) $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6188,76 +9330,139 @@ $ADD=31; # go to campaign modification form below if ($ADD==44) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; - } - else - { - echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; + echo ""; - if ($dial_method == 'RATIO') + if ($SSoutbound_autodial_active < 1) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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 = '8300'; + $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 "
ΔΡΑΣΤΙΚΗΣ ΚΑΤΑΛΟΓΟΙ ΜΕΤΑΒΑΛΛΟΜΕΝΩΝ"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE ΛΙΣΤΕΣ', 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 ($dial_method == 'MANUAL') + + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; + echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; } - else + else { - $adlSQL = ""; - if ($auto_dial_level < 1) + echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; + + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_hopper == 'Y') + { + echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; + echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } } } - 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); - - if ($reset_hopper == 'Y') - { - echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; - echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; - } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } $ADD=34; # go to campaign modification form below } @@ -6271,11 +9476,11 @@ if ($ADD==45) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; + echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα και λιγότερο από 43.200 δευτερολέπτων ή 12 ωρών\n"; echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; } else @@ -6285,13 +9490,13 @@ if ($ADD==45) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6317,7 +9522,7 @@ if ($ADD==47) { echo "
ΚΩΔΙΚΑΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΠΡΑΚΤΟΡΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; echo "
pause_code must be between 1 and 6 characters in length\n"; - echo "
pause_code name must be between 2 and 30 characters in length\n"; + echo "
pause_κωδικό όνομα πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες\n"; } else { @@ -6326,13 +9531,13 @@ if ($ADD==47) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY ΧΕΙΡΙΣΤΗΣPAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6345,6 +9550,103 @@ $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 "
QC SETTINGS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 "
QC SETTINGS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
ΕΡΕΥΝΑ SETTINGS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + } + else + { + echo "
ΕΡΕΥΝΑ SETTINGS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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' 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='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +$SUB='20A'; +$ADD=31; # go to campaign modification form below +} + + ###################### # ADD=49 modify campaign list mix in the system ###################### @@ -6375,22 +9677,22 @@ if ($ADD==49) if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) ) { - echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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"; + echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟ: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6418,13 +9720,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟ: $campaign_id - $vcl_id - $list_id\n"; } @@ -6491,13 +9793,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΟ: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; } @@ -6529,13 +9831,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ LIST MIX', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΠΡΟΣΤΙΘΕΜΕΝΟ:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6557,13 +9859,13 @@ if ($ADD==49) $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6587,13 +9889,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='Κατάλογος Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
ΜΙΓΜΑ ΚΑΤΑΛΟΓΩΝ ΠΟΥ ΕΝΕΡΓΟΠΟΙΕΙΤΑΙ: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6631,33 +9933,33 @@ if ($ADD==411) $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate' 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='ΛΙΣΤΕΣ', 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 "
ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΛΙΣΤΑΣ\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } + ### 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='ΛΙΣΤΕΣ', 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 "
ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description' where list_id='$list_id'|\n"); - fclose($fp); + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); } } } @@ -6687,18 +9989,36 @@ if ($ADD==4111) } 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 "
ΟΜΑΔΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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_message='$drop_message',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' where group_id='$group_id';"; + $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' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6711,6 +10031,47 @@ $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 "
Δέν ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
did_extension must be at least 1 character in length\n"; + } + else + { + echo "
DID ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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' 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 "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +$ADD=3311; # go to did modification form below +} + + + ###################### # ADD=41111 modify remote agents info in the system ###################### @@ -6733,13 +10094,13 @@ if ($ADD==41111) echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ENTRY |$PHP_AUTH_USER|$ip|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'|\n"); - fclose($fp); - } + ### 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 @@ -6769,17 +10130,106 @@ if ($ADD==411111) } else { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value' where user_group='$OLDuser_group';"; + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $GROUP_shifts .= "$group_shifts[$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' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 ΟΜΑΔΑ ΧΡΗΣΤΩΝ', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 + ###################################### } } } @@ -6815,13 +10265,13 @@ if ($ADD==4111111) echo "
Ο ΒΟΗΘΟΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ΒΟΗΘΟΙ', 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 @@ -6855,13 +10305,13 @@ if ($ADD==41111111) echo "
ΤΟ ΦΙΛΤΡΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ΦΙΛΤΡΑ', 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 @@ -6911,13 +10361,13 @@ if ($ADD==411111111) echo "
ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6967,13 +10417,13 @@ if ($ADD==4111111111) echo "
ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6985,6 +10435,57 @@ $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 - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
ID Shift και το όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
Shift ώρα έναρξης πρέπει να είναι 4 ψηφία στο μήκος και να είναι μια έγκυρη ώρα\n"; + echo "
Shift Μήκος 5 χαρακτήρες πρέπει να είναι σε μήκος και να είναι 24 ώρες ή λιγότερο\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 "
SHIFT ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ\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 "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +$ADD=331111111; # go to shift modification form below +} + + ###################### # ADD=41111111111 modify phone record in the system ###################### @@ -7008,7 +10509,18 @@ if ($ADD==41111111111) { echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $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' 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 ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ', event_sql=\"$SQL_log\", event_notes='IP Διακομιστή: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7022,6 +10534,86 @@ $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 "
PHONE ALIAS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
PHONE ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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 ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
ΟΜΑΔΑ ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $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 MODIFY GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +$ADD=33111111111; # go to group alias modification form below +} + + ###################### # ADD=411111111111 modify server record in the system ###################### @@ -7052,7 +10644,18 @@ if ($ADD==411111111111) { echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $server_ip\n"; - $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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_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); + + ### 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 ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7106,13 +10709,13 @@ if ($ADD==421111111111) $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SERVERΜπαούλα', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ TRUNK', event_sql=\"$SQL_log\", event_notes='Εκστρατεία: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -7125,6 +10728,86 @@ $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 ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $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); + + ### 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 MODIFY ΠΙΣΤ TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
ΔΕΝ ΘΑΛΑΜΙΣΚΟ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n";} + else + { + echo "
ΘΑΛΑΜΙΣΚΟ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ: $carrier_id\n"; + + $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' 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); + + ### 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 MODIFY ΘΑΛΑΜΙΣΚΟ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +$ADD=341111111111; # go to carrier modification form below +} + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -7206,31 +10889,31 @@ $ADD=31111111111111; # go to vicidial conference modification form below ###################### if ($ADD==411111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo ""; - - echo "
VICIDIAL ΤΟΠΟΘΕΤΗΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΕΣ\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';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM SETTINGS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo ""; + + echo "
VICIDIAL ΤΟΠΟΘΕΤΗΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΕΣ\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';"; + $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 "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD=311111111111111; # go to vicidial system settings form below } -$ADD=311111111111111; # go to vicidial system settings form below -} ###################### @@ -7238,70 +10921,70 @@ $ADD=311111111111111; # go to vicidial system settings form below ###################### 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 ""; + + if (ereg('delete',$stage)) { - echo "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η θέση συστημάτων δεν μπορεί να είναι μια διατηρημένη θέση:B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; - echo "
η θέση συστημάτων πρέπει να είναι χαρακτήρες τουλάχιστον 1 στομήκος\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); + echo "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η θέση συστημάτων δεν μπορεί να είναι μια διατηρημένη θέση:B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
η θέση συστημάτων πρέπει να είναι χαρακτήρες τουλάχιστον 1 στομήκος\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='SYSTEMSTATUSES', 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 "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η θέση συστημάτων πρέπει να είναι χαρακτήρες τουλάχιστον 1 στομήκος\n"; + echo "
το όνομα θέσης συστημάτων πρέπει να είναι χαρακτήρεςτουλάχιστον 1 στο μήκος\n"; + } + else + { + echo "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='SYSTEMSTATUSES', 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); } } } - if (ereg('modify',$stage)) - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η θέση συστημάτων πρέπει να είναι χαρακτήρες τουλάχιστον 1 στομήκος\n"; - echo "
το όνομα θέσης συστημάτων πρέπει να είναι χαρακτήρεςτουλάχιστον 1 στο μήκος\n"; - } - else - { - echo "
ΘΕΣΗ ΣΥΣΤΗΜΑΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $status\n"; - - $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD=321111111111111; # go to system settings modification form below } -$ADD=321111111111111; # go to system settings modification form below -} ###################### @@ -7309,57 +10992,125 @@ $ADD=321111111111111; # go to system settings modification form below ###################### if ($ADD==431111111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + { + echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η κατηγορία θέσης δεν μπορεί να είναι μια διατηρημένη κατηγορία:UNDEFINED\n"; + echo "
η κατηγορία θέσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες στομήκος\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $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 ΚΑΤΗΓΟΡΙΑ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $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 "
ΛΑΘΟΣ: Υπάρχουν ήδη 4 κατηγορίες θέσης καθορισμένες την επίδειξη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 ΚΑΤΗΓΟΡΙΑ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + if (ereg('delete',$stage)) { - echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η κατηγορία θέσης δεν μπορεί να είναι μια διατηρημένη κατηγορία:UNDEFINED\n"; - echo "
η κατηγορία θέσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες στομήκος\n"; - } - else - { - if (ereg('delete',$stage)) + if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) { - echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $vsc_id\n"; - - $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + echo "
QC Κατάσταση ΚΩΔΙΚΟΣ δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
η qc κωδικός πρέπει να είναι τουλάχιστον 1 χαρακτήρες στο μήκος\n"; } - if (ereg('modify',$stage)) + else { - echo "
ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ ΤΡΟΠΟΠΟΙΗΜΕΝΗ: $vsc_id\n"; + echo "
QC Κατάσταση ΔΙΕΓΡΑΜΜΕΝΩΝ ΚΩΔΙΚΟΣ:$code\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 "
ΛΑΘΟΣ: Υπάρχουν ήδη 4 κατηγορίες θέσης καθορισμένες την επίδειξηTimeOnVDAD\n"; - } - - $stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display' where vsc_id='$vsc_id';"; + $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 "
QC Κατάσταση ΚΩΔΙΚΟΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ- Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η qc κωδικός πρέπει να είναι τουλάχιστον 1 χαρακτήρες στο μήκος\n"; + echo "
qc το κωδικό όνομα πρέπει να είναι τουλάχιστον 1 χαρακτήρες στο μήκος\n"; + } + else + { + echo "
QC Κατάσταση ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ ΚΩΔΙΚΟΣ:$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); } } } @@ -7368,7 +11119,7 @@ if ($ADD==431111111111111) echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; exit; } -$ADD=331111111111111; # go to system settings modification form below +$ADD=341111111111111; # go to qc status code modification form below } @@ -7392,7 +11143,7 @@ if ($ADD==5) if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) { echo "
ΧΡΗΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Χρήστης be at least 2 characters in length\n"; } else { @@ -7519,6 +11270,28 @@ if ($ADD==5111) $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 "
ΔΕΝ ΚΑΤΑΡΓΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + echo "
DID DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ: $group_id\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετεDID $did_id


\n"; + } + +$ADD='3311'; # go to did modification below +} + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -7552,7 +11325,7 @@ if ($ADD==511111) if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) { echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
Χρήστης_group be at least 2 characters in length\n"; } else { @@ -7623,7 +11396,7 @@ if ($ADD==511111111) else { echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετεcall time $call_time_id


\n"; } $ADD='311111111'; # go to call time modification below @@ -7645,12 +11418,33 @@ if ($ADD==5111111111) else { echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετεstate 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 "
SHIFT δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + echo "
SHIFT DELETION CONFIRMATION:$shift_id\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετε στροφή $shift_id


\n"; + } + +$ADD='331111111'; # go to call time modification below +} ###################### # ADD=51111111111 confirmation before deletion of phone record @@ -7675,6 +11469,50 @@ $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 "
PHONE ALIAS δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
PHONE ALIAS DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ: $alias_id\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετε τηλέφωνο άλλως $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 δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Ομάδα Γνωστός ID must be at least 2 characters in length\n"; + } + else + { + echo "
ΟΜΑΔΑ ALIAS DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ: $group_alias_id\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετε ομάδα άλλως $group_alias_id


\n"; + } +$ADD='33111111111'; # go to group alias modification below +} + + ###################### # ADD=511111111111 confirmation before deletion of server record ###################### @@ -7698,6 +11536,50 @@ $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 δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Πρότυπο ID να είναι τουλάχιστον 2 χαρακτήρες\n"; + } + else + { + echo "
ΠΙΣΤ TEMPLATE DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ: $template_id - $template_name\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετε το πρότυπο 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 "
ΘΑΛΑΜΙΣΚΟ δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Θαλαμίσκος ID να είναι τουλάχιστον 2 χαρακτήρες\n"; + } + else + { + echo "
ΘΑΛΑΜΙΣΚΟ DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ: $carrier_id - $carrier_name\n"; + echo "

Κάντε κλικ εδώ για να διαγράψετε μεταφορέα $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier modification below +} + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -7757,15 +11639,15 @@ $ADD='31111111111111'; # go to vicidial conference modification below ###################### if ($ADD==6) -{ + { echo ""; - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) + if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) { echo "
ΧΡΗΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Χρήστης be at least 2 characters in length\n"; } - else + else { $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; $rslt=mysql_query($stmtA, $link); @@ -7776,37 +11658,38 @@ if ($ADD==6) $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|$user|$stmtA|$stmt|\n"); - fclose($fp); - } + ### 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='ΧΡΗΣΤΕΣ', 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 "
ΔΙΑΓΡΑΦΗ ΧΡΗΣΤΗ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user\n"; echo "

\n"; } -$ADD='0'; # go to user list -} + $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) ) + if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) { echo "
ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; echo "
Εκστρατεία_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -7845,58 +11728,60 @@ if ($ADD==61) $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
ΔΙΑΓΡΑΦΗ ΕΚΣΤΡΑΤΕΙΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $campaign_id\n"; echo "

\n"; } -$ADD='10'; # go to campaigns list -} + $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 "
ΧΕΙΡΙΣΤΕΣ ΠΟΥ ΔΕΝ ΕΙΝΑΙ ΑΠΟΣΥΝΔΕΜΕΝΟΙ ΑΠΟ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!ΧΕΙΡΙΣΤΗΣLOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
ΧΕΙΡΙΣΤΕΣ ΠΟΥ ΔΕΝ ΕΙΝΑΙ ΑΠΟΣΥΝΔΕΜΕΝΟΙ ΑΠΟ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Εκστρατεία_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_live_agents 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='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ΑΠΟΣΥΝΔΕΣΗ ΧΕΙΡΙΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $campaign_id\n"; + echo "

\n"; } - echo "
ΑΠΟΣΥΝΔΕΣΗ ΧΕΙΡΙΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD='31'; # go to campaign modification below } -$ADD='31'; # go to campaign modification below -} ###################### @@ -7904,45 +11789,46 @@ $ADD='31'; # go to campaign modification below ###################### if ($ADD==63) -{ + { if ($LOGmodify_campaigns==1) - { - if (eregi('IN',$stage)) - {$group_id=$campaign_id;} - echo ""; - - if (strlen($campaign_id) < 2) { - echo "
VDAC ΔΕΝ ΚΑΘΑΡΙΣΤΗΚΕ ΓΙΑ ΤΗΝ ΕΚΣΤΡΑΤΕΊΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_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); + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|EMERGENCY VDAC CLEAR|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
VDAC ΔΕΝ ΚΑΘΑΡΙΣΤΗΚΕ ΓΙΑ ΤΗΝ ΕΚΣΤΡΑΤΕΊΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Εκστρατεία_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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ΤΕΛΕΥΤΑΙΑ ΕΓΓΡΑΦΗ VDAC ΠΟΥ ΚΑΘΑΡΙΖΕΤΑΙ ΓΙΑ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ: $campaign_id\n"; + echo "

\n"; } - echo "
ΤΕΛΕΥΤΑΙΑ ΕΓΓΡΑΦΗ VDAC ΠΟΥ ΚΑΘΑΡΙΖΕΤΑΙ ΓΙΑ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} } -# go to campaign modification below -if (eregi('IN',$stage)) - {$ADD='3111';} -else - {$ADD='31';} -} ###################### @@ -7950,42 +11836,42 @@ else ###################### if ($ADD==65) -{ - if ($LOGmodify_campaigns==1) { - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + if ($LOGmodify_campaigns==1) { - echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΟΔΗΓΟΣ ΑΝΑΚΥΚΛΩΣΗΣ ΕΚΣΤΡΑΤΕΙΑΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; - echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; - } - else - { - echo "
ΔΙΑΓΡΑΦΗΚΕ Ο ΟΔΗΓΟΣ ΑΝΑΚΥΚΛΩΣΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $campaign_id - $status - $attempt_delay\n"; + echo ""; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΟΔΗΓΟΣ ΑΝΑΚΥΚΛΩΣΗΣ ΕΚΣΤΡΑΤΕΙΑΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; + echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; + echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; + } + else + { + echo "
ΔΙΑΓΡΑΦΗΚΕ Ο ΟΔΗΓΟΣ ΑΝΑΚΥΚΛΩΣΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $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='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below } -$SUB=25; -$ADD=31; # go to campaign modification form below -} ###################### @@ -7993,92 +11879,92 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - αυτή η αυτόματη θέση πινάκων ALT δεν είναι σε αυτήν τηνεκστρατεία\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - αυτή η αυτόματη θέση πινάκων ALT δεν είναι σε αυτήν τηνεκστρατεία\n";} + else { - echo "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - } - else - { - echo "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AUTALTDIALSTTUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; + } + else + { + echo "
ΑΥΤΟΜΑΤΗ ΘΈΣΗ ΠΙΝΑΚΩΝ ALT ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $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='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $SUB=26; + $ADD=31; # go to campaign modification form below } -$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) ) + if ($LOGmodify_campaigns==1) { - echo "
ΚΩΔΙΚΑΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΕΚΣΤΡΑΤΕΙΑΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code\n"; + echo ""; - $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE ΧΕΙΡΙΣΤΗΣPAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ΚΩΔΙΚΑΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΕΚΣΤΡΑΤΕΙΑΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below } -$SUB=27; -$ADD=31; # go to campaign modification form below -} ###################### @@ -8086,67 +11972,67 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ - αυτή η θέση πινάκων δεν επιλέγεται για αυτήν την εκστρατεία\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ - αυτή η θέση πινάκων δεν επιλέγεται για αυτήν την εκστρατεία\n";} + else { - echo "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - } - else - { - echo "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DIAL STATUS REMOVED |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; + } + else + { + echo "
ΘΕΣΗ ΠΙΝΑΚΩΝ ΕΚΣΤΡΑΤΕΙΑΣ ΑΦΑΙΡΟΥΜΕΝΗ: $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='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Κατάσταση:$status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + #$SUB=28; + $ADD=31; # go to campaign modification form below } -#$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) ) + if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) { - echo "
ΛΙΣΤΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
List_id be at least 2 characters in length\n"; + echo "
ΛΙΣΤΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
List_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; $rslt=mysql_query($stmt, $link); @@ -8159,37 +12045,38 @@ if ($ADD==611) $stmt="DELETE from vicidial_list where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } + ### 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='ΛΙΣΤΕΣ', 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 "
ΔΙΑΓΡΑΦΗ ΛΙΣΤΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $list_id\n"; echo "

\n"; } -$ADD='100'; # go to lists list -} + $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) ) + if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) { - echo "
ΕΙΣ-ΟΜΑΔΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Group_id be at least 2 characters in length\n"; + echo "
ΕΙΣ-ΟΜΑΔΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Group_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8197,115 +12084,155 @@ if ($ADD==6111) $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } + $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 "
ΔΙΑΓΡΑΦΗ ΕΙΣ-ΟΜΑΔΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $group_id\n"; echo "

\n"; } -$ADD='1000'; # go to in-group list -} + $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 "
ΔΕΝ ΚΑΤΑΡΓΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 "
DID DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $did_id\n"; + echo "

\n"; + } + + $ADD='1300'; # go to did 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) ) + if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΣ ΧΕΙΡΙΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; + echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΣ ΧΕΙΡΙΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } + ### 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 "
ΔΙΑΓΡΑΦΗ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $remote_agent_id\n"; echo "

\n"; } -$ADD='10000'; # go to remote agents list -} + $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) ) + if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) { - echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Χρήστης_group be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } + ### 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 ΟΜΑΔΑ ΧΡΗΣΤΩΝ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
ΔΙΑΓΡΑΦΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user_group\n"; echo "

\n"; } -$ADD='100000'; # go to user group list -} + $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) ) + if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) { - echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΒΟΗΘΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Script_id be at least 2 characters in length\n"; + echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΒΟΗΘΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Script_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } + ### 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='ΒΟΗΘΟΙ', 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 "
ΔΙΑΓΡΑΦΗ ΒΟΗΘΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $script_id\n"; echo "

\n"; } -$ADD='1000000'; # go to script list -} + $ADD='1000000'; # go to script list + } ###################### @@ -8313,32 +12240,33 @@ $ADD='1000000'; # go to script list ###################### if ($ADD==61111111) -{ + { echo ""; - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) + if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) { - echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
To ID φίλτρου πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
To ID φίλτρου πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; } - else + else { $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } + ### 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='ΦΙΛΤΡΑ', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE ΦΙΛΤΡΑ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
Η ΔΙΑΓΡΑΦΗ ΤΟΥ ΦΙΛΤΡΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $lead_filter_id\n"; echo "

\n"; } -$ADD='10000000'; # go to filter list -} + $ADD='10000000'; # go to filter list + } ###################### @@ -8346,32 +12274,33 @@ $ADD='10000000'; # go to filter list ###################### if ($ADD==611111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; } - else + else { $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } + ### 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 "
ΟΛΟΚΛΗΡΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; echo "

\n"; } -$ADD='100000000'; # go to call times list -} + $ADD='100000000'; # go to call times list + } ###################### @@ -8379,18 +12308,18 @@ $ADD='100000000'; # go to call times list ###################### if ($ADD==6111111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; + echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; } - else + else { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8398,36 +12327,72 @@ if ($ADD==6111111111) $sct_list=''; $o=0; - while ($sct_to_print > $o) { + 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) { + 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 "Απομάκρυνση Κανόνα Κατάστασης: $sct_ids[$o]
\n"; $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); } + + ### 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 "
ΟΛΟΚΛΗΡΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; echo "

\n"; } -$ADD='1000000000'; # go to call times list -} + $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 "
SHIFT δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 "
SHIFT DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $shift_id\n"; + echo "

\n"; + } + + $ADD='130000000'; # go to shifts list + } ###################### @@ -8435,32 +12400,99 @@ $ADD='1000000000'; # go to call times list ###################### if ($ADD==61111111111) -{ + { echo ""; - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; + echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP Διακομιστή be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
Η ΔΙΑΓΡΑΦΗ ΤΟΥ ΤΗΛΕΦΩΝΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $extension - $server_ip\n"; echo "

\n"; } -$ADD='10000000000'; # go to phone list -} + $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 "
PHONE ALIAS δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\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 DELETE PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
PHONE ALIAS DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $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 δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Ομάδα Γνωστός ID 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 Διαγραφή ομάδας ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ΟΜΑΔΑ ALIAS DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $group_alias_id\n"; + echo "

\n"; + } + $ADD='13000000000'; # go to group alias list + } ###################### @@ -8468,32 +12500,33 @@ $ADD='10000000000'; # go to phone list ###################### if ($ADD==611111111111) -{ + { echo ""; - if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
ΔΙΑΚΟΜΙΣΤΗΣ NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
ID Διακομιστή be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; + echo "
ΔΙΑΚΟΜΙΣΤΗΣ NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
ID Διακομιστή be at least 2 characters in length\n"; + echo "
IP Διακομιστή be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING SERVER!!|$PHP_AUTH_USER|$ip|server_id='$server_id'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
ΔΙΑΚΟΜΙΣΤΗΣ DELETION COMPLETED: $server_id - $server_ip\n"; echo "

\n"; } -$ADD='100000000000'; # go to server list -} + $ADD='100000000000'; # go to server list + } ###################### @@ -8501,40 +12534,123 @@ $ADD='100000000000'; # go to server list ###################### if ($ADD==621111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + { + echo "
Η ΕΓΓΡΑΦΗ ΤΟΥ ΚΟΡΜΟΥ ΣΤΟΝ ΕΞΥΠΗΡΕΤΗΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
η εκστρατεία πρέπει να είναι μεταξύ 3 και 8 χαρακτήρων στο μήκος\n"; + echo "
η server_ip καθυστέρηση πρέπει να είναι τουλάχιστον 7 χαρακτήρες\n"; + } + else + { + echo "
Η ΕΓΓΡΑΦΗ ΤΟΥ ΚΟΡΜΟΥ ΣΤΟΝ ΕΞΥΠΗΡΕΤΗΤΗ ΔΙΑΓΡΑΦΗΚΕ: $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='SERVERΜπαούλα', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE ΔΙΑΚΟΜΙΣΤΗΣ TRUNK', event_sql=\"$SQL_log\", event_notes='Εκστρατεία: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=631111111111 delete conf template record +###################### + +if ($ADD==631111111111) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { - echo "
Η ΕΓΓΡΑΦΗ ΤΟΥ ΚΟΡΜΟΥ ΣΤΟΝ ΕΞΥΠΗΡΕΤΗΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η εκστρατεία πρέπει να είναι μεταξύ 3 και 8 χαρακτήρων στο μήκος\n"; - echo "
η server_ip καθυστέρηση πρέπει να είναι τουλάχιστον 7 χαρακτήρες\n"; + echo "
ΠΙΣΤ TEMPLATE δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Πρότυπο ID να είναι τουλάχιστον 2 χαρακτήρες\n"; } - else + else { - echo "
Η ΕΓΓΡΑΦΗ ΤΟΥ ΚΟΡΜΟΥ ΣΤΟΝ ΕΞΥΠΗΡΕΤΗΤΗ ΔΙΑΓΡΑΦΗΚΕ: $campaign_id - $server_ip\n"; - - $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE ΔΙΑΚΟΜΙΣΤΗΣ TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $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 DELETE ΠΙΣΤ TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ΠΙΣΤ TEMPLATE DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $server_id - $server_ip\n"; + echo "

\n"; } + $ADD='130000000000'; # go to conf template list } - else + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
ΘΑΛΑΜΙΣΚΟ δεν διαγράφονται - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Θαλαμίσκος ID να είναι τουλάχιστον 2 χαρακτήρες\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 DELETE ΘΑΛΑΜΙΣΚΟ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
ΘΑΛΑΜΙΣΚΟ DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier list } -$ADD=311111111111; # go to server modification form below -} ###################### @@ -8542,32 +12658,33 @@ $ADD=311111111111; # go to server modification form below ###################### if ($ADD==6111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
CONFERENCE NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; + echo "
CONFERENCE NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Διακομιστή be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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='1000000000000'; # go to conference list + } ###################### @@ -8575,32 +12692,33 @@ $ADD='1000000000000'; # go to conference list ###################### if ($ADD==61111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
VICIDIAL CONFERENCE NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; + echo "
VICIDIAL CONFERENCE NOT DELETED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Διακομιστή be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 -} + $ADD='10000000000000'; # go to vicidial conference list + } @@ -8670,6 +12788,24 @@ if ($ADD==3) $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]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -8718,6 +12854,7 @@ if ($ADD==3) echo "$NWB#vicidial_users-user_group$NWE
Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
Ενεργή:$NWB#vicidial_users-active$NWE
Εγχειρίδιο κλήσεων Χειριστή: $NWB#vicidial_users-agentcall_manual$NWE
Καταγραφή: $NWB#vicidial_users-vicidial_recording$NWE
Μεταφορές: $NWB#vicidial_users-vicidial_transfers$NWE
Η πιό στενή προεπιλογή συνδύασε: $NWB#vicidial_users-closer_default_blended$NWE
Η πιό στενή προεπιλογή συνδύασε: $NWB#vicidial_users-closer_default_blended$NWE
VICIDIAL συμπληρωματική προμήθεια καταγραφής: $NWB#vicidial_users-vicidial_recording_override$NWE
Ο πράκτορας αλλάζει τη συμπληρωματική προμήθεια στοιχείωνπελατών: $NWB#vicidial_users-alter_custdata_override$NWE
Agent Alter Πελατών Παράκαμψη Τηλέφωνο:$NWB#vicidial_users-alter_custphone_override$NWE
Agent Shift Επιβολή Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alert Enabled: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Τάξεις εκστρατείας:$NWB#vicidial_users-campaign_ranks$NWE
\n"; echo "\n"; echo "$RANKcampaigns_list"; @@ -8742,6 +12888,14 @@ if ($ADD==3) echo "$RANKgroups_list"; echo "
\n"; echo "
QC Enabled:$NWB#vicidial_users-qc_enabled$NWE
QC χρήστη Επίπεδο:$NWB#vicidial_users-qc_user_level$NWE
QC Pass:$NWB#vicidial_users-qc_pass$NWE
QC Τελείωμα:$NWB#vicidial_users-qc_finish$NWE
Αναλήψεις QC:$NWB#vicidial_users-qc_commit$NWE
Διάγραψε τις Λίστες: $NWB#vicidial_users-delete_lists$NWE
Εισαγωγή Οδηγών: $NWB#vicidial_users-load_leads$NWE
Τροποποίηση Οδηγών: $NWB#vicidial_users-modify_leads$NWE
Κατεβάστε Λίστες: $NWB#vicidial_users-modify_leads$NWE
Εξαγωγή Εκθέσεις: $NWB#vicidial_users-export_reports$NWE
Τροποποιήστε τις εκστρατείες: $NWB#vicidial_users-modify_sections$NWE
Λεπτομέρειες εκστρατείας: $NWB#vicidial_users-campaign_detail$NWE
Τροποποιήστε τις-ΟΜΑΔΕΣ: $NWB#vicidial_users-modify_sections$NWE
Διάγραψε τις Εισ-ΟΜΑΔΕΣ: $NWB#vicidial_users-delete_ingroups$NWE
Τροποποιήστε DIDs:$NWB#vicidial_users-modify_sections$NWE
Διαγραφή DIDs:$NWB#vicidial_users-delete_ingroups$NWE
Τροποποιήστε τους μακρινούς πράκτορες: $NWB#vicidial_users-modify_sections$NWE
Διάγραψε τους Απομακρυσμένους Χειριστές: $NWB#vicidial_users-delete_remote_agents$NWE
Τροποποιήστε τα χειρόγραφα: $NWB#vicidial_users-modify_sections$NWE
Διάγραψε τον Βοηθόs: $NWB#vicidial_users-delete_scripts$NWE
Τροποποιήστε τα φίλτρα: $NWB#vicidial_users-modify_sections$NWE
Διαγραφή Φίλτρουs: $NWB#vicidial_users-delete_filters$NWE
Τροποποιήστε τα φίλτρα: $NWB#vicidial_users-modify_sections$NWE
Διαγραφή Φίλτρουs: $NWB#vicidial_users-delete_filters$NWE
Πρόσβαση AGC Admin: $NWB#vicidial_users-ast_admin_access$NWE
Το AGC διαγράφει τα τηλέφωνα: $NWB#vicidial_users-ast_delete_phones$NWE
Τροποποίηση Χρόνου Κλήσηςs: $NWB#vicidial_users-modify_call_times$NWE
Διαγραφή Χρόνου Κλήσηςs: $NWB#vicidial_users-delete_call_times$NWE
Τροποποιήστε τους κεντρικούς υπολογιστές: $NWB#vicidial_users-modify_sections$NWE
Agent API Πρόσβαση:$NWB#vicidial_users-vdc_agent_api_access$NWE
ΠροσθήκηΏρα ρολόι Εγγραφή Εγγραφή: $NWB#vicidial_users-add_timeclock_log$NWE
ΤροποποιήστεΏρα ρολόι Εγγραφή Εγγραφή: $NWB#vicidial_users-modify_timeclock_log$NWE
ΔιαγραφήΏρα ρολόι Εγγραφή Εγγραφή: $NWB#vicidial_users-delete_timeclock_log$NWE
Manager Shift Επιβολή Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; if ($LOGdelete_users > 0) @@ -8796,7 +12964,12 @@ if ($ADD==3) echo "

Επιλέξτε εδώ για την σελίδα με τους χρόνους χρήσης\n"; echo "

Επιλέξτε εδώ για τη κατάσταση του χρήστη\n"; echo "

Πατήστε εδώ για στατιστικά χρήστη\n"; + echo "

Κάντε κλικ εδώ για το χρήστη πολλαπλών ημέρες καθεστώς λεπτομερώς την έκθεση\n"; echo "

Επιλέξτε εδώ για τις Επανακλήσεις του χρήστη που κρατήθηκαν\n"; + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το αρχείο
\n"; + } } } else @@ -8811,7 +12984,7 @@ if ($ADD==3) # ADD=31 modify campaign info in the system - Detail view ###################### -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed +if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Βασική if not allowed if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) ) {$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list @@ -8831,6 +13004,12 @@ if ($ADD==31) $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 * from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -8841,6 +13020,7 @@ if ($ADD==31) $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]; @@ -8867,7 +13047,7 @@ if ($ADD==31) $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; + $drop_action = $row[37]; $safe_harbor_exten = $row[38]; $display_dialable_count = $row[39]; $wrapup_seconds = $row[40]; @@ -8898,6 +13078,43 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -8930,21 +13147,61 @@ if ($ADD==31) } } + $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 * 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 .= "$rowx[0] - $rowx[1]\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 pulldown list menu + + ##### 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); @@ -9005,18 +13298,35 @@ if ($ADD==31) 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 ""; + echo ""; + echo ""; 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]: Basic Detail StatusesΒασική Λεπτομέρειες ΚαθεστώτωνHotKeysLead RecyclingAuto Alt DialPause CodesList MixLead RecyclingAlt Auto DialΚατάλογος MixΈρευναΠαύση ΚώδικεςQC Real-Time
\n"; @@ -9034,123 +13344,142 @@ if ($ADD==31) echo "
ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Περιγραφή εκστρατείας: $NWB#vicidial_campaigns-campaign_description$NWE
Εκστρατεία Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Εκστρατεία Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Εκστρατεία Αλλαγή Ημερομηνία: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Εκστρατεία Σύνδεση Ημερομηνία: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Web Μορφή Target: $NWB#vicidial_campaigns-web_form_target$NWE
Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Επιτρέψτε πλησίον και συνδύασε:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Επιτρέψτε πλησίον και συνδύασε:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Θέση πινάκων$o: \n"; - - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Θέση πινάκων$o: \n"; + + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Κατάσταση:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Κατάλογος Mix:
Add A Dial Κατάσταση:
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Μέθοδος Κλήσης +: $NWB#vicidial_campaigns-dial_method$NWE
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ΠΡΟΣΑΡΜΟΣΤΕ ΤΗ ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Μέθοδος Κλήσης -: $NWB#vicidial_campaigns-dial_method$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ΠΡΟΣΑΡΜΟΣΤΕ ΤΗ ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ
Διαθέσιμα μόνο ετικέτες + echo "
Διαθέσιμα μόνο ετικέτες : $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Ποσοστό Ορίου Εγκατ.Κλήσεων + echo "
Ποσοστό Ορίου Εγκατ.Κλήσεων : % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Μέγιστο Επίπεδο Προσαρμογής Κλήσεων + echo "
Μέγιστο Επίπεδο Προσαρμογής Κλήσεων : number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Τελευταίος Χρόνος Διακομιστή + echo "
Τελευταίος Χρόνος Διακομιστή : 4 μόνο αριθμοί $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Ενταση Τροποποίησης Προσαρμογής + echo "
Ενταση Τροποποίησης Προσαρμογής : $NWB#vicidial_campaigns-adaptive_intensity$NWE
Επίπεδο Κλήσεων Μεταβολής Στόχου + echo "
Επίπεδο Κλήσεων Μεταβολής Στόχου : $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Ταυτόχρονες μεταφορές: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Κοτσίδας Προτεραιότητα: $NWB#vicidial_campaigns-queue_priority$NWE
Αυτόματος σχηματισμός ALT-ARJCMOY: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Ταυτόχρονες μεταφορές: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Αυτόματος σχηματισμός ALT-ARJCMOY: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Κλήση εκτός χρόνου: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Κλήση εκτός χρόνου: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Πρόθεμα Κλήσης: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Παράλειψη Κωδικού Τηλεφώνου @@ -9168,8 +13499,10 @@ if ($ADD==31) echo "
CallerID Εκστρατείας: $NWB#vicidial_campaigns-campaign_cid$NWE
Εκστρατείας VDAD εσωτ.σύνδεση: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Εκστρατείας VDAD εσωτ.σύνδεση: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Επέκταση εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Ηχογράφηση εκστρατείας: $NWB#vicidial_campaigns-campaign_recording$NWE
Μήνυμα Αυτόματου Τηλεφωνητή: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD στέλνει στο VM: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
AMD στέλνει στο VM: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
CPD AMD δράσης: $NWB#vicidial_campaigns-cpd_amd_action$NWE
DTMF Μεταφοράς-Συνδ 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Κλήση Εναλ Αριθμού: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Κλήση Εναλ Αριθμού: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Προγραμματισμένες Επανακλήσεις: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_campaigns-drop_call_seconds$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop δράσης:$NWB#vicidial_campaigns-drop_action$NWE
Χρήση μηνύματος Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Εσωτ.Σύνδεση Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Εσωτ.Σύνδεση Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop Μεταφορά Ομάδα:$NWB#vicidial_campaigns-drop_inbound_group$NWE
Δευτερ Τυλίγματος: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Μήνυμα Τυλίγματος: $NWB#vicidial_campaigns-wrapup_message$NWE
Εσωτερικός κατάλογος DNC χρήσης: $NWB#vicidial_campaigns-use_internal_dnc$NWE
AgentΚώδικες μικρής διακοπήςΕνεργή:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Χρησιμοποίησε Καμπάνια DNC Κατάλογος: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentΚώδικες μικρής διακοπήςΕνεργή:$NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Εκστρατεία Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Θέστε εκτός λειτουργίας αλλάζει τα στοιχεία πελατών: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
Απενεργοποίηση Alter Πελατών Τηλέφωνο:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Επιτρέψτε τους κανένας-χοάνη-μολύβδους Logins: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Επιτρέψτε τους κανένας-χοάνη-μολύβδους Logins: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Εμφάνιση Agent Queue Count:$NWB#vicidial_campaigns-display_queue_count$NWE
Χειρωνακτικός κατάλογος ταυτότητα πινάκων:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Εγχειρίδιο Dial Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Agent Screen Clipboard Αντιγραφή: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agent Screen Εκτεταμένη Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Way Call Πρόθεμα Κλήσης: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Ομάδα Γνωστός Επιτρέπεται: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Προεπιλεγμένη ομάδα Γνωστός: $NWB#vicidial_campaigns-default_group_alias$NWE
Αναζήτηση Vtiger Κατηγορία: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Δημιουργία Vtiger Call Record: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Δημιουργία Vtiger Μόλυβδος Εγγραφή: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Vtiger Screen Είσοδος: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
Εισερχόμενες ομάδες:
"; @@ -9250,33 +13662,88 @@ if ($ADD==31) echo "
\n"; echo "
\n"; - echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $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=''; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΕΝΕΡΓΟ
\n"; - } - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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=0; - while ($lists_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣΤΡΟΠΟΠΟΙΗΣΗ
$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]ΤΡΟΠΟΠΟΙΗΣΗ

\n"; - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; echo "
\n"; $filterSQL = $filtersql_list[$lead_filter_id]; @@ -9301,25 +13768,26 @@ if ($ADD==31) echo " - ΕΜΦΑΝΙΣΗ

"; } - - - - - $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]"; + $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 "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

\n"; echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

\n"; - echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

\n"; - echo "Click here to see a VDAD report for this campaign

\n"; - echo "
\n"; + echo "Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια

\n"; } + echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

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

Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την εκστρατεία
\n"; + } + echo "\n"; + } - + ##### CAMPAIGN CUSTOM STATUSES ##### if ($SUB==22) { @@ -9388,7 +13856,7 @@ if ($ADD==31) echo "Κατάσταση:   \n"; echo "Περιγραφή:   \n"; echo "Επιλέξιμο:   \n"; - echo "Human Answer:   \n"; + echo "Ανθρώπινα Απάντηση:   \n"; echo "Κατηγορία:\n"; echo "\n"; - echo "\n"; + ### 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 * 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); - $o++; + $stmt="SELECT * 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 "

ΑΝΑΚΥΚΛΩΣΗ ΟΔΗΓΟΥ ΜΕΣΑ ΣΕ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $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"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + $o++; } echo "
ΚΑΤΑΣΤΑΣΗΚΑΘΥΣΤΕΡΗΣΗ ΠΡΟΣΠΑΘΕΙΑΣΜΕΓΙΣΤΟ ΠΡΟΣΠΑΘΕΙΑΣLEADS ΣΕ ΟΡΙΑΚΗΕΝΕΡΓΟ ΔΙΑΓΡΑΦΗ
$rowx[2]
\n"; - echo "\n"; + echo "
  $RECYCLE_status[$o]\n"; + echo "\n"; echo "\n"; echo "$recycle_limit   ΔΙΑΓΡΑΦΗ
ΔΙΑΓΡΑΦΗ
\n"; @@ -9494,9 +14012,11 @@ if ($ADD==31) echo "
\n"; echo "
\n"; + echo "
\n"; + echo "* Μόλυβδος μετράει λαμβάνονται από καταλόγους που δραστηριοποιούνται στην εκστρατεία μόνο.\n"; } - + ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### if ($SUB==26) { echo "

ΑΥΤΟΜΑΤΟΣ ΣΧΗΜΑΤΙΣΜΌΣ ΑΡΙΘΜΟΎ ALT ΓΙΑ ΑΥΤΉΝ ΤΗΝ ΕΚΣΤΡΑΤΕΊΑ:   $NWB#vicidial_auto_alt_dial_statuses$NWE
\n"; @@ -9533,7 +14053,7 @@ if ($ADD==31) echo "
\n"; } - + ##### CAMPAIGN ΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ##### if ($SUB==27) { echo "

ΚΩΔΙΚΕΣ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ ΠΡΑΚΤΟΡΩΝ ΓΙΑ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_pause_codes$NWE
\n"; @@ -9576,6 +14096,114 @@ if ($ADD==31) echo "
\n"; } + ##### CAMPAIGN 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 "

QC SETTINGS για αυτή την καμπάνια:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +# echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + echo "QC Enabled: $NWB#vicidial_campaigns-qc_enabled$NWE
QC καθεστώτα:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
QC WebForm:$NWB#vicidial_campaigns-qc_web_form_address$NWE
QC Script: $NWB#vicidial_campaigns-qc_script$NWE
QC Shift: $NWB#vicidial_campaigns-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
QC Δείτε Καταγραφή: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; + echo "

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

ΕΡΕΥΝΑ SETTINGS για αυτήν την καμπάνια:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "
Έρευνα Πρώτο αρχείο ήχου: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Έρευνα DTMF Digits: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Έρευνα δεν ενδιαφέρεται Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Έρευνα Opt-σε αρχείο ήχου: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Έρευνα δεν ενδιαφέρεται αρχείο ήχου: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Έρευνα Μέθοδος: $NWB#vicidial_campaigns-survey_method$NWE
Έρευνα της μη αντίδρασης δράσης: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Έρευνα δεν ενδιαφέρεται Κατάσταση: $NWB#vicidial_campaigns-survey_ni_status$NWE
Έρευνα Απάντηση Digit Χάρτης: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Έρευνα Έρευνα Xfer Παράταση: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Έρευνα Καμπάνια Καταγραφή Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; + echo "

\n"; + } + if ($SUB < 1) { @@ -9663,12 +14291,13 @@ if ($ADD==34) $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])) @@ -9685,6 +14314,7 @@ if ($ADD==34) { $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])) @@ -9740,9 +14370,16 @@ if ($ADD==34) echo "
$row[0]: Βασική Επισκόπηση Αναλυτική Επισκόπηση List Mix Κατάλογος Mix Πραγματικού Χρόνου Οθόνη  
\n"; if ($SUB < 1) @@ -9756,82 +14393,84 @@ if ($ADD==34) echo "
ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Περιγραφή εκστρατείας: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Εκστρατεία Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Εκστρατεία Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Εκστρατεία Αλλαγή Ημερομηνία: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Εκστρατεία Σύνδεση Ημερομηνία: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Ιστο-σελίδα: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Ομάδα μεταφοράς προεπιλογής:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Επιτρέψτε πλησίον και συνδύασε:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Επιτρέψτε πλησίον και συνδύασε:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Θέση πινάκων$o: \n"; - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Θέση πινάκων$o: \n"; + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Κατάσταση:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Κατάλογος Mix:
Add A Dial Κατάσταση:
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Μέθοδος Κλήσης +: $NWB#vicidial_campaigns-dial_method$NWE
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Μέθοδος Κλήσης -: $NWB#vicidial_campaigns-dial_method$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Ενταση Τροποποίησης Προσαρμογής + echo "
Ενταση Τροποποίησης Προσαρμογής : $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Κατά την έναρξη κλήσης: $get_call_launch
\n"; echo "
\n"; - echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΕΝΕΡΓΟ
\n"; - - } - - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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); - $camp_lists=''; + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); + 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++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣΤΡΟΠΟΠΟΙΗΣΗ
$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]ΤΡΟΠΟΠΟΙΗΣΗ

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} else - {$bgcolor='bgcolor="#9BB9FB"';} + {$fSQL = '';} - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

\n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

\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,$fSQL); - echo " - ΑΠΟΚΡΥΨΗ

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - ΕΜΦΑΝΙΣΗ

"; - } + if ($display_dialable_count == 'Y') + { + ### call function to calculate and print dialable leads + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$fSQL); + echo " - ΑΠΟΚΡΥΨΗ

"; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - ΕΜΦΑΝΙΣΗ

"; + } - $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]"; + $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 "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

\n"; - echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

\n"; + echo "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

\n"; + echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

\n"; + echo "Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια

\n"; + } echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

\n"; - echo "Click here to see a VDAD report for this campaign

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

Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την εκστρατεία
\n"; + } + echo "
\n"; echo "
\n"; @@ -9962,6 +14659,7 @@ if ( ($ADD==34) or ($ADD==31) ) { if ($LOGmodify_campaigns==1) { + ##### CAMPAIGN LIST MIX SETTINGS ##### if ($SUB==29) { ##### get list_id listings for dynamic pulldown @@ -10028,7 +14726,7 @@ if ( ($ADD==34) or ($ADD==31) ) {echo "$rowx[5]
Method:\n"; echo "
ID ΛΙΣΤΑΣPRIORITY% MIXSTATUSES
ID ΛΙΣΤΑΣΠΡΟΤΕΡΑΙΟΤΗΤΑΣ% MIXSTATUSES
Dial Κατάσταση:  
Ενεργή:$NWB#vicidial_lists-active$NWE
ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΟΔΗΓΟΥ ΓΙΑ ΤΗΝ ΛΙΣΤΑ: $NWB#vicidial_lists-reset_list$NWE
Ημερομηνία αλλαγής καταλόγων: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
Κατάλογος Last Call Ημερομηνία: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; @@ -10887,12 +15584,17 @@ if ($ADD==311) echo "
\n"; - echo "

Click here to see all CallBack Holds in this list

\n"; + echo "

Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος στον κατάλογο αυτό

\n"; + echo "

Κάντε κλικ εδώ για να κατεβάσετε τον κατάλογο αυτό

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

ΔΙΑΓΡΑΨΕ ΑΥΤΗ ΤΗΝ ΛΙΣΤΑ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την λίστα
\n"; + } } else { @@ -10920,7 +15622,7 @@ if ($ADD==3111) $group_name = $row[1]; $group_color = $row[2]; $active = $row[3]; - $web_form_address = $row[4]; + $web_form_address = stripslashes($row[4]); $voicemail_ext = $row[5]; $next_agent_call = $row[6]; $fronter_display = $row[7]; @@ -10931,7 +15633,7 @@ if ($ADD==3111) $xferconf_b_dtmf = $row[12]; $xferconf_b_number = $row[13]; $drop_call_seconds = $row[14]; - $drop_message = $row[15]; + $drop_action = $row[15]; $drop_exten = $row[16]; $call_time_id = $row[17]; $after_hours_action = $row[18]; @@ -10945,30 +15647,113 @@ if ($ADD==3111) $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]; + ##### get in-groups listings for dynamic pulldown - $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); $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 "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΟΜΑΔΩΝ: $row[0]
\n"; @@ -10977,10 +15762,26 @@ if ($ADD==3111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -11034,12 +15865,158 @@ if ($ADD==3111) echo "$Xgroups_menu"; echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\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 "
ID Ομάδας: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Κοτσίδας Προτεραιότητα: $NWB#vicidial_inbound_groups-queue_priority$NWE
Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script:
Αριθμός Μεταφοράς-Συνδ 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop δράσης:$NWB#vicidial_inbound_groups-drop_action$NWE
Χρήση μηνύματος Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_message$NWE
Εσωτ. Σύνδεση Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_exten$NWE
Εσωτ. Σύνδεση Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_exten$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop Μεταφορά Ομάδα:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Χρόνος κλήσης:$NWB#vicidial_inbound_groups-call_time_id$NWE
Μετά από τη δράση ωρών:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Μετά από τη δράση ωρών:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Μετά από το όνομα αρχείου μηνυμάτων ωρών:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Μετά από το όνομα αρχείου μηνυμάτων ωρών:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Μετά από την παράταση ωρών:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Μετά από την παράταση ωρών:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Μετά από το φωνητικό ταχυδρομείο ωρών:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Μετά από το φωνητικό ταχυδρομείο ωρών:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Μετά από ώρες Μεταφορά Ομάδα:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Ευπρόσδεκτο όνομα αρχείου μηνυμάτων:$NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Παίξτε Καλωσόρισμα:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Μουσική στο πλαίσιο λαβής:$NWB#vicidial_inbound_groups-moh_context$NWE
Στο γρήγορο όνομα αρχείου λαβής:$NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Στο γρήγορο διάστημα λαβής:$NWB#vicidial_inbound_groups-prompt_interval$NWE
Παίξτε στο Line Τόπος:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Παίξτε Κρατήστε Εκτιμώμενη Ώρα:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Κρατήστε την επιλογή Ώρα:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Κρατήστε την επιλογή Δευτερόλεπτα Ώρα:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Κρατήστε Ώρα Επιλογή Παράταση:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Κρατήστε Ώρα Επιλογή Τηλεφωνητής:$NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Κρατήστε Ώρα Επιλογή Callback αρχείου:$NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Κρατήστε Ώρα Επιλογή Callback Κατάλογος ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Αγρυπνη επέκταση πρακτόρων:$NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Αγρυπνη καθυστέρηση πρακτόρων:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Προεπιλεγμένη ομάδα Γνωστός: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Κρατήστε Ανάκληση Μεταφορά σε ομάδα:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
Δεν Υστέρηση Call Διαδρομή:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
-Στην ομάδα Καταγραφή Override:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
-Στην ομάδα Καταγραφή αρχείου:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Στατιστικά Ποσοστό ζητεί απάντηση εντός δευτερολέπτων X 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Στατιστικά Ποσοστό ζητεί απάντηση εντός δευτερολέπτων X 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
\n"; + + if ($SSqc_features_active > 0) + { + echo "
 
Inbound Ομάδα QC Ρυθμίσεις:
QC Enabled: $NWB#vicidial_inbound_groups-qc_enabled$NWE
QC καθεστώτα:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC WebForm:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#vicidial_inbound_groups-qc_script$NWE
QC Shift: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
QC Δείτε Καταγραφή: $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 "
ΧΕΙΡΙΣΤΗΣRANKS FOR THIS INBOUND GROUP:
\n"; + echo "
ΧΕΙΡΙΣΤΗΣRANKS FOR THIS Εισερχόμενα GROUP:
\n"; echo "\n"; echo "\n"; @@ -11064,7 +16041,7 @@ if ($ADD==3111) echo "
USER     RANK     CALLS TODAY

\n"; - echo "Click here to see a report for this inbound group

\n"; + echo "Κάντε κλικ εδώ για να δείτε μια έκθεση για αυτό το εισερχόμενο ομάδα

\n"; echo "
\n"; @@ -11073,6 +16050,163 @@ if ($ADD==3111) echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΕΙΣ-ΟΜΑΔΑ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages In-Group
\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +} + + + +###################### +# ADD=3311 modify did info in the system +###################### + +if ($ADD==3311) +{ + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from vicidial_inbound_dids where did_id='$did_id';"; + $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]; + + + $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 "
MODIFY A DID RECORD:$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 "
DID Επέκταση:$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Περιγραφή:$NWB#vicidial_inbound_dids-did_description$NWE
Ενεργή:$NWB#vicidial_inbound_dids-did_active$NWE
DID Οδός:$NWB#vicidial_inbound_dids-did_route$NWE
Παράταση:$NWB#vicidial_inbound_dids-extension$NWE
Παράταση Πλαίσιο:$NWB#vicidial_inbound_dids-exten_context$NWE
Τηλεφωνητής Box:$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Παράταση Τηλέφωνο:$NWB#vicidial_inbound_dids-phone$NWE
IP Διακομιστή: $NWB#vicidial_inbound_dids-server_ip$NWE
Χρήστης Agent:$NWB#vicidial_inbound_dids-user$NWE
Χρήστης Unavailable δράσης:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Ρυθμίσεις χρήστη Οδός-Στην ομάδα:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-ID Ομάδας: $NWB#vicidial_inbound_dids-group_id$NWE
Στην Ομάδα-Call Χειροκίνητος Τρόπος:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Στην Ομάδα-Agent Search Μέθοδος:$NWB#vicidial_inbound_dids-agent_search_method$NWE
Στην ομάδα Κατάλογος-ID:$NWB#vicidial_inbound_dids-list_id$NWE
Στην ομάδα της εκστρατείας-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
Στην Ομάδα-τηλέφωνο Κωδικός:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; + echo "

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

Διαγραφή αυτής της DID\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages DID
\n"; + } } else { @@ -11133,6 +16267,10 @@ if ($ADD==31111) { echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΧΕΙΡΙΣΤΗ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το απομακρυσμένο πράκτορα\n"; + } } else { @@ -11156,8 +16294,12 @@ if ($ADD==311111) $stmt="SELECT * 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]; + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + echo ""; echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ
\n"; @@ -11166,9 +16308,51 @@ if ($ADD==311111) 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 "
Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
Επιτρεπόμενες Εκστρατείες: \n"; - echo "$campaigns_list"; - echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE
ΔύναμηΏρα ρολόι Σύνδεση: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Shift εκτέλεση: $NWB#vicidial_user_groups-shift_enforcement$NWE
Επιτρεπόμενες Εκστρατείες:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Ομάδα Βάρδιες:
$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 "
 
QC Επιτρέπονται Καμπάνιες:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
QC Επιτρέπονται Εισερχόμενες Ομάδες:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
\n"; @@ -11176,14 +16360,14 @@ if ($ADD==311111) ### list of users in this user group $active_confs = 0; - $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; + $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 "
ΧΡΗΣΤΕΣ ΜΕΣΑ ΣΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ : $users_to_print
\n"; echo "\n"; - echo "\n"; + echo "\n"; $o=0; while ($users_to_print > $o) @@ -11200,6 +16384,7 @@ if ($ADD==311111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } @@ -11207,12 +16392,17 @@ if ($ADD==311111) - echo "

Click here to see all CallBack Holds in this user group

\n"; + echo "

Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος σε αυτή την ομάδα χρηστών

\n"; + echo "

Κάντε κλικ εδώ για να δείτε την κατάστασηΏρα ρολόι ομάδα για αυτόν τον χρήστη

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

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages ομάδα χρηστών\n"; + } } else { @@ -11300,6 +16490,10 @@ if ($ADD==3111111) { echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΒΟΗΘΟ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το σενάριο\n"; + } } else { @@ -11366,6 +16560,10 @@ if ($ADD==31111111) { echo "

ΔΙΑΓΡΑΦΗ ΤΟΥ ΦΙΛΤΡΟΥ\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages για αυτό το φίλτρο\n"; + } } else { @@ -11469,7 +16667,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11541,7 +16739,7 @@ echo "
USERFULL NAMELEVEL
USERΟΝΟΜΑΤΕΠΩΝΥΜΟΕΠΙΠΕΔΟΕΝΕΡΓΟ
$rowx[0]$rowx[1]$rowx[2]$rowx[3]
Προκαθορσμένη Εκκίν echo "
Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τετάρτη Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
\n"; } echo "
\n"; -echo "INBOUND GROUPS USING THIS CALL TIME:
\n"; +echo "Εισερχόμενα 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';"; @@ -11561,6 +16759,10 @@ if ($LOGdelete_call_times > 0) { echo "

ΔΙΑΓΡΑΦΗ ΟΡΙΣΜΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; } +if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages φορά σε αυτή την έκκληση\n"; + } } else { @@ -11618,7 +16820,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11655,6 +16857,120 @@ echo "Δεν έχετε το δικαίωμα για να δείτε την σε } + +###################### +# ADD=331111111 modify shift definition info in the system +###################### + +if ($ADD==331111111) +{ + +if ($LOGmodify_call_times==1) +{ +echo "
Προκαθορσμένη Εκκίν echo "
Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τετάρτη Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFY της στροφής\n"; +echo "\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Shift ID:$shift_id
Shift Όνομα: (σύντομη περιγραφή της μετατόπισης)$NWB#vicidial_shifts-shift_name$NWE
Shift Ώρα έναρξης:\n"; +echo "   Shift End Time:\n"; +echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Μήκος: $NWB#vicidial_shifts-shift_length$NWE
Shift Καθημερινά:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; +echo "Κυριακή
\n"; +echo "Δευτέρα
\n"; +echo "Τρίτη
\n"; +echo "Τετάρτη
\n"; +echo "Πέμπτη
\n"; +echo "Παρασκευή
\n"; +echo "Σάββατο
\n"; +echo "
\n"; + +echo "


\n"; +echo "ΟΜΑΔΕΣ ΧΡΗΣΤΩΝ ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ SHIFT:
\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 "

Διαγραφή αυτής της SHIFT ΟΡΙΣΜΟΣ\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages την εξέλιξη αυτή
\n"; + } +} +else +{ +echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε."; +} + +} + + ###################### # ADD=31111111111 modify phone record in the system ###################### @@ -11677,7 +16993,7 @@ if ($ADD==31111111111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11692,6 +17008,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11746,6 +17063,25 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Περιεχόμενο Φωνητικού Ταχυδρομείου: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Τηλεφωνητής Box: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
DBY Χρήστης: (ΔευτερεύονDB Login)$NWB#phones-DBY_user$NWE
DBY Κωδικός: (ΔευτερεύονDB Secret)$NWB#phones-DBY_pass$NWE
DBY Πόρτα: (ΔευτερεύονDB Port)$NWB#phones-DBY_port$NWE
Πρότυπο ID: $NWB#phones-template_id$NWE
Επιβ Override: $NWB#phones-conf_override$NWE
\n"; @@ -11764,6 +17100,122 @@ if ($ADD==31111111111) } +###################### +# ADD=32111111111 modify phone alias record in the system +###################### + +if ($ADD==32111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
MODIFY τηλεφώνου ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Γνωστός ID:$row[0] $NWB#phones-alias_id$NWE
Ψευδώνυμο: $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 "
Στο πλαίσιο του παρόντος PHONES ΤΗΛΕΦΩΝΑ 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 "
LOGINΤΗΛ.ΣΥΝΔΕΣΗSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

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

ΔΙΑΓΡΑΨΕ ΑΥΤΟ ΤΟ ΤΗΛΕΦΩΝΟ ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages να άλλως αυτό το τηλέφωνο
\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 "
MODIFY Α ΟΜΙΛΟΣ ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Ομάδα Γνωστός ID: $row[0] $NWB#phones-group_alias_id$NWE
Ομάδα ψευδώνυμο: $NWB#phones-group_alias_name$NWE
CallerID Αριθμός: $NWB#phones-caller_id_number$NWE
CallerID Όνομα: $NWB#phones-caller_id_name$NWE
Ενεργή:
\n"; + + + if ($LOGast_delete_phones > 0) + { + echo "

Διαγράψετε αυτή την ομάδα ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages άλλως σε αυτή την ομάδα
\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +} + + ###################### # ADD=311111111111 modify server record in the system ###################### @@ -11775,42 +17227,89 @@ if ($ADD==311111111111) echo "
\n"; echo ""; - $stmt="SELECT * from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 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_ip = $row[2]; + $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]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΔΙΑΚΟΜΙΣΤΗ: $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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; +: \n"; echo "\n"; +: \n"; echo "\n"; +: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
Μέγιστος Αριθμός Trunk: $NWB#servers-max_vicidial_trunks$NWE
Διακύμανση Τηλεφωνικής Κλήσης: $NWB#servers-vicidial_balance_active$NWE
Διακύμανση εκτός ορίων: $NWB#servers-balance_trunks_offlimits$NWE
Λήπτης Telnet: $NWB#servers-telnet_host$NWE
Πόρτα Telnet: $NWB#servers-telnet_port$NWE
Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#servers-ASTmgrSECRET$NWE
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
System Load: $sysload - $cpu%   $NWB#servers-sysload$NWE
Live Channels: $channels_total   $NWB#servers-channels_total$NWE
Disk Usage: $disk_usage   $NWB#servers-disk_usage$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
Μέγιστος Αριθμός Trunk: $NWB#servers-max_vicidial_trunks$NWE
Max ζητεί ανά Δεύτερη: $NWB#servers-outbound_calls_per_second$NWE
Διακύμανση Τηλεφωνικής Κλήσης: $NWB#servers-vicidial_balance_active$NWE
Διακύμανση εκτός ορίων: $NWB#servers-balance_trunks_offlimits$NWE
Λήπτης Telnet: $NWB#servers-telnet_host$NWE
Πόρτα Telnet: $NWB#servers-telnet_port$NWE
Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#servers-ASTmgrSECRET$NWE
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
Επίδοση Συστήματος -: $NWB#servers-sys_perf_log$NWE
$NWB#servers-sys_perf_log$NWE
Γεγονότα Διακομιστή -: $NWB#servers-vd_server_logs$NWE
$NWB#servers-vd_server_logs$NWE
Εξοδος AGI -: $NWB#servers-agi_output$NWE
$NWB#servers-agi_output$NWE
Καταγραφή Σύνδεσμος: $NWB#servers-recording_web_link$NWE
Alternate Recording IP Διακομιστή: $NWB#servers-alt_server_ip$NWE
Asterisk Ενεργό Server: $NWB#servers-active_asterisk_server$NWE
Δημιουργήστε conf αρχεία: $NWB#servers-generate_vicidial_conf$NWE
Αναδημιουργία conf αρχεία: $NWB#servers-rebuild_conf_files$NWE
\n"; @@ -11848,7 +17347,7 @@ if ($ADD==311111111111) echo "
ΠΡΟΣΘΗΚΗ ΕΓΓΡΑΦΗΣ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΣΡΜΟΥ
\n"; echo "\n"; echo "\n"; - echo "TRUNKS:
\n"; + echo "Μπαούλα:
\n"; echo "ΕΚΣΤΡΑΤΕΙΑ:
\n"; @@ -11858,23 +17357,56 @@ if ($ADD==311111111111) echo "

\n"; + ### list of carriers on this server + echo "
\n"; + echo "
ΜΕΤΑΦΟΡΕΙΣ WITHIN THIS SERVER:
\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 IDΟΝΟΜΑREGISTRATIONΕΝΕΡΓΟ
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + ### list of phones on this server echo "
\n"; echo "
ΤΗΛΕΦΩΝΑ ΣΤΟΝ ΔΙΑΚΟΜΙΣΤΗ:
\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=''; + $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++; + $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++;} @@ -11895,17 +17427,18 @@ if ($ADD==311111111111) 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=''; + $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++; + $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"';} @@ -11924,17 +17457,18 @@ if ($ADD==311111111111) echo "
CONFERENCEΤΗΛ.ΣΥΝΔΕΣΗ
\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=''; + $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++; + $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"';} @@ -11950,6 +17484,7 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Αυτός ο διακομιστής έχει $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "Αυτός ο διακομιστής έχει $active_phones ενεργά τηλέφωνα και $inactive_phones μη ενεργά τηλέφωνα

\n"; echo "Αυτός ο διακομιστής έχει $active_confs active conferences

\n"; echo "Αυτός ο διακομιστής έχει $active_vdconfs active vicidial conferences

\n"; @@ -11958,6 +17493,218 @@ if ($ADD==311111111111) { echo "

DELETE THIS SERVER\n"; } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages σε αυτόν τον διακομιστή\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +} + + +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
VD CONFERENCEΤΗΛ.ΣΥΝΔΕΣΗ
\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 "
MODIFY Α ΠΙΣΤ TEMPLATE RECORD: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Αναγνωριστικό: $template_id
Όνομα: $NWB#vicidial_conf_templates-template_name$NWE
Template Περιεχόμενα: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
PHONES ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ ΠΙΣΤ TEMPLATE:
\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 "
ΤΗΛ.ΣΥΝΔΕΣΗΟΝΟΜΑSERVERΕΝΕΡΓΟ
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
Που χρησιμοποιούν ΠΑΡΟΝΤΑ ΠΙΣΤ TEMPLATE:
\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 "
CARRIERΟΝΟΜΑSERVERΕΝΕΡΓΟ
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

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

Διαγραφή αυτής της ΠΙΣΤ TEMPLATE\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages conf σε αυτό το πρότυπο
\n"; + } + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\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 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]; + + echo "
MODIFY Α ΘΑΛΑΜΙΣΚΟ RECORD: $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 "
Θαλαμίσκος ID: $carrier_id
Φέρον Όνομα: $NWB#vicidial_server_carriers-carrier_name$NWE
Εγγραφή String: $NWB#vicidial_server_carriers-registration_string$NWE
Πρότυπο ID: $NWB#vicidial_server_carriers-template_id$NWE
Λογαριασμός Είσοδος: $NWB#vicidial_server_carriers-account_entry$NWE
Πρωτόκολλο: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Είσοδος: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Διακομιστή: $NWB#vicidial_server_carriers-server_ip$NWE
Ενεργή:$NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

Διαγραφή αυτής της CARRIER\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages για τον εν λόγω αερομεταφορέα
\n"; + } } else { @@ -12002,7 +17749,7 @@ if ($ADD==3111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS CONFERENCE\n"; + echo "

Διαγραφή αυτής της ΣΥΝΕΔΡΙΟ\n"; } } else @@ -12048,7 +17795,7 @@ if ($ADD==31111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS VICIDIAL CONFERENCE\n"; + echo "

Διαγραφή αυτής της VICIDIAL ΣΥΝΕΔΡΙΟ\n"; } } else @@ -12071,7 +17818,7 @@ if ($ADD==311111111111111) 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 from system_settings;"; + $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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -12090,32 +17837,34 @@ if ($ADD==311111111111111) $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]; echo "
ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ 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 "
Έκδοση: $version
Install Date: $install_date
DB Schema Έκδοση: $db_schema_version
Auto Χρήστης-add Value: $auto_user_add_value
Εγκαταστήστε Ημερομηνία: $install_date
Μη-λατινικά χρήσης: $NWB#settings-use_non_latin$NWE
Webroot writable: $NWB#settings-webroot_writable$NWE
Επιτρέψτε την αναγραφή QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics κεντρικός υπολογιστής IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics όνομα DB: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics σύνδεση DB: $NWB#settings-queuemetrics_login$NWE
QueueMetrics κωδικός πρόσβασης DB: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics καταγράψτε την ταυτότητα: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend:$NWB#settings-queuemetrics_eq_prepend$NWE
VICIDIAL ο πράκτορας θέτει εκτός λειτουργίας την επίδειξη:
Επιτρέψτε τα μηνύματα SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
Σπίτι URL Admin:$NWB#settings-admin_home_url$NWE
Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων: $NWB#settings-enable_agc_xfer_log$NWE
Ώρα ρολόι Τέλος της ημέρας:$NWB#settings-timeclock_end_of_day$NWE
ΤελευταίαΏρα ρολόι Αυτόματη Αποσύνδεση: $timeclock_last_reset_date
QC Τελευταία Τραβήξτε Ώρα: $qc_last_pull_time
Agent Screen Επικεφαλίδας Μορφή Ημερομηνίας: $NWB#settings-vdc_header_date_format$NWE
Agent Screen Πελατών Μορφή Ημερομηνίας: $NWB#settings-vdc_customer_date_format$NWE
Agent Screen Πελατών τηλέφωνο Μορφοποίηση: $NWB#settings-vdc_header_phone_format$NWE
Agent API Ενεργό:$NWB#settings-vdc_agent_api_active$NWE
QC Χαρακτηριστικά Ενεργή:$NWB#settings-qc_features_active$NWE
Εξερχόμενο Auto-Dial Ενεργή:$NWB#settings-outbound_autodial_active$NWE
Max ΣΥΜΠΛΗΡΩΣΤΕ ζητεί ανά Δεύτερη: $NWB#settings-outbound_calls_per_second$NWE
Επιτρέψτε την αναγραφή QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics κεντρικός υπολογιστής IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics όνομα DB: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics σύνδεση DB: $NWB#settings-queuemetrics_login$NWE
QueueMetrics κωδικός πρόσβασης DB: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics καταγράψτε την ταυτότητα: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend:$NWB#settings-queuemetrics_eq_prepend$NWE
Ενεργοποίηση Vtiger Ένταξη: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Κάντε κλικ εδώ για να Συγχρονίστε χρήστες με Vtiger\n"; + echo "
Vtiger ΣΠ IP Διακομιστή: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Σύνδεση:$NWB#settings-vtiger_login$NWE
Vtiger DB Κωδικός:$NWB#settings-vtiger_pass$NWE
Vtiger URL: $NWB#settings-vtiger_url$NWE
\n"; echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Κάντε κλικ εδώ για να δείτε Admin chages για τις ρυθμίσεις του συστήματος
\n"; + } + } else { @@ -12158,7 +17979,7 @@ if ($ADD==321111111111111) echo "
\n"; echo "VICIDIAL ΘΕΣΕΙΣ ΜΕΣΑ ΣΕ ΑΥΤΟ ΤΟ ΣΥΣΤΗΜΑ:  $NWB#vicidial_statuses$NWE
\n"; echo "\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"; @@ -12226,7 +18047,7 @@ if ($ADD==321111111111111) echo "Κατάσταση:   \n"; echo "Περιγραφή:
\n"; echo "Επιλέξιμο:   \n"; - echo "Human Answer:   \n"; + echo "Ανθρώπινα Απάντηση:   \n"; echo "Κατηγορία:\n"; echo "
ΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗSELECT-
ABLE
HUMAN
ANSWER
CATEGORYMODIFY/DELETE
ΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗSELECT-
ABLE
ΑΝΘΡΩΠΙΝΗ
ΑΠΑΝΤΗΣΗ
ΚΑΤΗΓΟΡΙΑMODIFY/DELETE
\n"; - echo "\n"; + echo "\n"; $stmt="SELECT * from vicidial_status_categories order by vsc_id;"; $rslt=mysql_query($stmt, $link); @@ -12271,12 +18092,12 @@ if ($ADD==331111111111111) 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]; - + $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; @@ -12315,12 +18136,13 @@ if ($ADD==331111111111111) echo "\n"; echo "$Avsc_id[$p]\n"; echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -12332,8 +18154,10 @@ if ($ADD==331111111111111) echo "
ΠΡΟΣΘΕΣΤΕ ΤΗ ΝΕΑ ΚΑΤΗΓΟΡΙΑ ΘΕΣΗΣ
\n"; echo "\n"; echo "Category ID:   \n"; - echo "Name:   \n"; - echo "TimeOnVDAD Display:  
\n"; + echo "Name:  
\n"; + echo "TimeOnVDAD Εμφάνιση:   \n"; + echo "Πώληση Κατηγορία:   \n"; + echo "Νεκρά Μόλυβδος Κατηγορία:  
\n"; echo "Περιγραφή:   \n"; echo "
\n"; @@ -12351,6 +18175,84 @@ if ($ADD==331111111111111) +###################### +# ADD=341111111111111 modify vicidial QC status code +###################### + +if ($ADD==341111111111111) +{ + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) + { + echo "
CATEGORYΟΝΟΜΑTOVDADSTATUSES IN THIS CATEGORY
ΚΑΤΗΓΟΡΙΑΟΝΟΜΑΚαθεστώτων σε αυτήν την κατηγορία
\n"; echo "$CATstatuses"; echo "
Περιγραφή:
        \n"; + echo "
TO VDAD Εμφάνιση:     Πώληση Κατηγορία:     Νεκρά Μόλυβδος Κατηγορία:  
Περιγραφή:
        \n"; echo "   ΔΙΑΓΡΑΦΗ
 
\n"; + echo ""; + + echo "
\n"; + echo "QC 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 CODEΠΕΡΙΓΡΑΦΗMODIFY/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 "ΔΙΑΓΡΑΦΗ\n"; + } + else + { + echo "ΔΙΑΓΡΑΦΗ\n"; + } + echo "
\n"; + + echo "
Προσθήκη νέου QC Κατάσταση ΚΩΔΙΚΟΣ
\n"; + echo "\n"; + echo "Κατάσταση:   \n"; + echo "Περιγραφή:
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } +} + + + + + ###################### # ADD=550 search form @@ -12445,13 +18347,13 @@ if ($ADD==8) { $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status='LIVE' and callback_time < '$past_month_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one month have been made INACTIVE\n"; + echo "
Χρήστης($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='LIVE' and callback_time < '$past_week_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one week have been made INACTIVE\n"; + echo "
Χρήστης($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
"; @@ -12553,7 +18455,7 @@ if ($ADD==8111) $CBquerySQLwhere = "and user_group='$user_group'"; -echo "
USER GROUP CALLBACK HOLD LISTINGS: $list_id\n"; +echo "
ΟΜΑΔΑ ΧΡΗΣΤΩΝ CALLBACK HOLD LISTINGS: $list_id\n"; $oldADD = "ADD=8111&user_group=$user_group"; $ADD='82'; } @@ -12570,7 +18472,7 @@ $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,'; $LEVELlink='stage=LEVELUP';} +if (eregi("ENDATEDOWN",$stage)) {$SQLorder='order by entry_time desc,'; $ΕΠΙΠΕΔΟlink='stage=ΕΠΙΠΕΔΟUP';} $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') $CBquerySQLwhere $SQLorder recipient,status desc,callback_time"; $rslt=mysql_query($stmt, $link); @@ -12626,103 +18528,165 @@ echo "$CBinactiveLINK"; # ADD=0 display all active users ###################### if ($ADD==0) -{ -echo "
\n"; -echo ""; + { + echo "
\n"; + echo ""; + echo "
ΛΙΣΤΕΣ ΧΡΗΣΤΗ: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   Εμφάνιση μόνο των ενεργών χρηστών\n"; + } + else + { + $SQLstatus = "where active='Y'"; + echo "   δείτε όλους τους χρήστες\n"; + } -$USERlink='stage=USERIDDOWN'; -$NAMElink='stage=NAMEDOWN'; -$LEVELlink='stage=LEVELDOWN'; -$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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} -if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} -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 * from vicidial_users $SQLorder"; + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $ΕΠΙΠΕΔΟlink='stage=ΕΠΙΠΕΔΟDOWN'; + $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("ΕΠΙΠΕΔΟUP",$stage)) {$SQLorder='order by user_level asc'; $ΕΠΙΠΕΔΟlink='stage=ΕΠΙΠΕΔΟDOWN';} + if (eregi("ΕΠΙΠΕΔΟDOWN",$stage)) {$SQLorder='order by user_level desc'; $ΕΠΙΠΕΔΟlink='stage=ΕΠΙΠΕΔΟUP';} + 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 $SQLstatus $SQLorder"; $rslt=mysql_query($stmt, $link); $people_to_print = mysql_num_rows($rslt); -echo "
ΛΙΣΤΕΣ ΧΡΗΣΤΗ:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
USER IDFULL NAMELEVELGROUPLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
ID ΧΡΗΣΤΗΟΝΟΜΑΤΕΠΩΝΥΜΟΕΠΙΠΕΔΟGROUPΕΝΕΡΓΟΣΥΝΔΕΣΜΟΙ
$row[1]$row[3]$row[4]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ | ΚΑΤΑΣΤΑΣΗ | TIME
$row[0]$row[1]$row[2]$row[3]$row[4]
ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ | ΚΑΤΑΣΤΑΣΗ | TIME
\n"; -} + echo "
\n"; + } ###################### # ADD=10 display all campaigns ###################### if ($ADD==10) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $campaigns_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΚΣΤΡΑΤΕΙΕΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΚΣΤΡΑΤΕΙΕΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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 ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo "\n"; $o++; - } + } -echo "
CAMPAIGN ID
ΟΝΟΜΑ
ACTIVE   ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ   ΕΠΙΠΕΔΟ   ΜΟΛΥΒΔΟΥ ORDER   ΤΗΛΕΦΩΝΕΙΣΤΕ καθεστώτων   ΤΡΟΠΟΠΟΙΗΣΗ
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=100 display all lists ###################### if ($ADD==100) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lists order by list_id"; + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $lists_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΛΙΣΤΕΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΕΣ ΛΙΣΤΕΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + $lists_printed = ''; $o=0; - while ($people_to_print > $o) { + while ($lists_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12730,14 +18694,40 @@ echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΠΕΡΙΓΡΑΦΗLEADS COUNTΕΝΕΡΓΟΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣCAMPAIGNΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; 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 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 "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]   $row[2] $row[3] $row[4] $row[5] $row[6]ΤΡΟΠΟΠΟΙΗΣΗ
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } @@ -12745,19 +18735,29 @@ echo "
\n"; # ADD=1000 display all inbound groups ###################### if ($ADD==1000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $ingroups_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($ingroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12765,34 +18765,88 @@ echo "
IN-GROUPΟΝΟΜΑΠΡΟΤΕΡΑΙΟΤΗΤΑΣΕΝΕΡΓΟTIMECOLORΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2] $row[3] $row[5]   $row[4]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; } -echo "
\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 "
ΕΝΤΑΓΜΕΝΕΣ ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ:\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 "
#DIDΠΕΡΙΓΡΑΦΗΕΝΕΡΓΟROUTEΤΡΟΠΟΠΟΙΗΣΗ
$row[0] $row[1] $row[2] $row[3] $row[4]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; + } ###################### # ADD=10000 display all remote agents ###################### if ($ADD==10000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $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); - $people_to_print = mysql_num_rows($rslt); + $remoteagents_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($remoteagents_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12804,31 +18858,37 @@ echo "
USERLINESΔΙΑΚΟΜΙΣΤΗΣ   CONF-EXTEN   STATUS   CAMPAIGN   ΤΡΟΠΟΠΟΙΗΣΗ
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[4] $row[5] $row[6]ΤΡΟΠΟΠΟΙΗΣΗ
ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=100000 display all user groups ###################### if ($ADD==100000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $usergroups_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΟΜΑΔΕΣ ΧΡΗΣΤΗ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΕΣ ΟΜΑΔΕΣ ΧΡΗΣΤΗ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($usergroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12836,31 +18896,38 @@ echo "
ΟΜΑΔΑ ΧΡΗΣΤΩΝΌνομα ΟμάδαςΙΣΧΥΟΝΤΑ TIMECLOCK   ΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000 display all scripts ###################### if ($ADD==1000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $scripts_to_print = mysql_num_rows($rslt); -echo "
ΛΙΣΤΕΣ ΒΟΗΘΩΝ:\n"; -echo "
\n"; + echo "
ΛΙΣΤΕΣ ΒΟΗΘΩΝ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($scripts_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12868,32 +18935,37 @@ echo "
SCRIPT IDSCRIPT ΟΝΟΜΑACTIVE   ΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000 display all filters ###################### if ($ADD==10000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; + $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 "
ΛΙΣΤΕΣ ΟΔΗΓΟΥ ΦΙΛΤΡΟΥ:\n"; -echo "
\n"; + echo "
ΛΙΣΤΕΣ ΟΔΗΓΟΥ ΦΙΛΤΡΟΥ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($filters_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12901,32 +18973,38 @@ echo "
FILTER IDFILTER NAMEΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=100000000 display all call times ###################### if ($ADD==100000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_call_times order by call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $calltimes_to_print = mysql_num_rows($rslt); -echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ:\n"; -echo "
\n"; + echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($calltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12934,33 +19012,41 @@ echo "
CALLTIME IDCALLTIME ΟΝΟΜΑDEFAULT STARTDEFAULT STOPΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000000 display all state call times ###################### if ($ADD==1000000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $statecalltimes_to_print = mysql_num_rows($rslt); + + echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; -echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ:\n"; -echo "
CALLTIME IDCALLTIME STATECALLTIME ΟΝΟΜΑDEFAULT STARTDEFAULT STOPΤΡΟΠΟΠΟΙΗΣΗ
\n"; $o=0; - while ($filters_to_print > $o) { + while ($statecalltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12971,147 +19057,383 @@ echo "
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; + } + + echo "
$row[2] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
ΤΡΟΠΟΠΟΙΗΣΗ
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000 display all shifts +###################### +if ($ADD==130000000) + { + 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 "
SHIFT Καταχωρίσεις:\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 "
SHIFT IDSHIFT ΟΝΟΜΑSHIFT STARTSHIFT ΜΗΚΟΣΚαθημερινάΤΡΟΠΟΠΟΙΗΣΗ
$row[0] $row[1] $row[2] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
\n"; + } ###################### # ADD=10000000000 display all phones ###################### if ($ADD==10000000000) -{ -echo "
\n"; -echo ""; + { + 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 * from phones $SQLorder"; + $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 "
ΕΝΤΑΓΜΕΝΑ ΤΗΛΕΦΩΝΑ:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
ΕΝΤΑΓΜΕΝΑ ΤΗΛΕΦΩΝΑ:\n"; + echo "
EXTENPROTOSERVERDIAL PLANΚΑΤΑΣΤΑΣΗΟΝΟΜΑVMAILLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo " + + + + + + + + "; + echo "\n"; $o++; + } + + echo "
EXTENPROTOSERVERDIAL PLANΚΑΤΑΣΤΑΣΗΟΝΟΜΑVMAILΣΥΝΔΕΣΜΟΙ
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
\n"; } -echo "
\n"; -} +###################### +# ADD=12000000000 display all phones alias +###################### +if ($ADD==12000000000) + { + 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 "
PHONE ALIAS Καταχωρίσεις:\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 "
ALIAS IDΨευδώνυμοΤΗΛ. ΚΑΤΑΛΟΓΟΣ συνδέσειςΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1]$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
\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 "
ΟΜΑΔΑ ALIAS Καταχωρίσεις:\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 "
ΟΜΑΔΑ ALIAS IDΟΜΑΔΑ ψευδώνυμοΑΡΙΘΜΟΣ CIDCID ΟΝΟΜΑΕΝΕΡΓΟΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1]$row[2]$row[3]$row[4]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; + } ###################### # ADD=100000000000 display all servers ###################### if ($ADD==100000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from servers order by server_id"; + $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); - $phones_to_print = mysql_num_rows($rslt); + $servers_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΟΙ ΔΙΑΚΟΜΙΣΤΕΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΟΙ ΔΙΑΚΟΜΙΣΤΕΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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 "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; + } + + echo "
ΔΙΑΚΟΜΙΣΤΗΣ IDΟΝΟΜΑΔΙΑΚΟΜΙΣΤΗΣ IPΕΝΕΡΓΟASTERISKΜπαούλαGMTΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1] $row[2] $row[4] $row[3]  ΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + 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 "
ΠΙΣΤ TEMPLATE Καταχωρίσεις:\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ΌνομαΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1]ΤΡΟΠΟΠΟΙΗΣΗ
\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 "
ΘΑΛΑΜΙΣΚΟ Καταχωρίσεις:\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Φέρον ΌνομαIP ΔιακομιστήProtocolΕγγραφήΕνεργόΤΡΟΠΟΠΟΙΗΣΗ
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; + } ###################### # ADD=1000000000000 display all conferences ###################### if ($ADD==1000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $conferences_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΣΥΝΔΙΑΛΕΞΕΙΣ:\n"; -echo "
\n"; + echo "
ΕΝΤΑΓΜΕΝΕΣ ΣΥΝΔΙΑΛΕΞΕΙΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
CONFERENCEΔΙΑΚΟΜΙΣΤΗΣ IPΤΗΛ.ΣΥΝΔΕΣΗΤΡΟΠΟΠΟΙΗΣΗ
$row[0] $row[1] $row[2]$row[4]  ΤΡΟΠΟΠΟΙΗΣΗ
$row[1]$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000000000 display all vicidial conferences ###################### if ($ADD==10000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $vicidialconf_to_print = mysql_num_rows($rslt); -echo "
ΕΝΤΑΓΜΕΝΕΣ ΣΥΝΔΙΑΛΕΞΕΙΣ:\n"; -echo "
\n"; + echo "
VICIDIAL ΕΝΤΑΓΜΕΝΕΣ ΣΥΝΔΙΑΛΕΞΕΙΣ:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + while ($vicidialconf_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -13119,120 +19441,466 @@ echo "
CONFERENCEΔΙΑΚΟΜΙΣΤΗΣ IPΤΗΛ.ΣΥΝΔΕΣΗΤΡΟΠΟΠΟΙΗΣΗ
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2]$row[4]  ΤΡΟΠΟΠΟΙΗΣΗ
$row[2]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; + } + + + + + +###################### +# ADD=700000000000000 view all activity in the admin log +###################### + +if ($ADD==700000000000000) + { + echo "\n";echo "\n"; +$stmt="SELECT admin_home_url from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; + +?> +
+ + +
\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 "
ADMIN CHANGE LOG: (Τελευταία 10.000 εγγραφές)\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('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 "NEXT\n"; + echo "
\n"; + } + + +###################### +# ADD=710000000000000 view all activity in the admin log made by one user +###################### + +if ($ADD==710000000000000) + { + echo "\n"; +echo "
\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 "
ADMIN CHANGE LOG: Οι αλλαγές που έγιναν από $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('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"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +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) + { + $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"; + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + 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]); + 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"; -} ###################### # ADD=999999 display reports section ###################### if ($ADD==999999) -{ - if ($LOGview_reports==1) { - echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - - $stmt="select * from servers;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $servers_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $servers_to_print) + 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;"; + $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); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; - $stmt="SELECT enable_queuemetrics_logging,queuemetrics_url from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging_LU = $row[0]; - $queuemetrics_url_LU = $row[1]; + ?> + + + + + VICIDIAL: Στατιστικά Server και Εκθέσεις + VICIDIAL: Στατιστικά Server και Εκθέσεις

+
\n"; + } else - { - echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; - exit; + { + echo "Δεν έχετε την άδεια να δείτε αυτήν την σελίδα\n"; + exit; + } } -} +echo "
\n"; echo "
\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n


\n
\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; -echo "                   ΕΚΔΟΣΗ: $admin_version"; -echo "                   ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - +echo "
\n"; +echo "

"; +echo "ΕΚΔΟΣΗ: $admin_version
"; +echo "ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; ?> - +
@@ -13336,7 +20004,7 @@ if (isset($camp_lists)) $state_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday τοπικός χρόνος + if ($GMT_day[$r]==0) #### Κυριακή τοπικός χρόνος { if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) { @@ -13349,7 +20017,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday τοπικός χρόνος + if ($GMT_day[$r]==1) #### Δευτέρα τοπικός χρόνος { if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) { @@ -13362,7 +20030,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday τοπικός χρόνος + if ($GMT_day[$r]==2) #### Τρίτη τοπικός χρόνος { if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) { @@ -13375,7 +20043,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday τοπικός χρόνος + if ($GMT_day[$r]==3) #### Τετάρτη τοπικός χρόνος { if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) { @@ -13388,7 +20056,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday τοπικός χρόνος + if ($GMT_day[$r]==4) #### Πέμπτη τοπικός χρόνος { if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) { @@ -13401,7 +20069,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday τοπικός χρόνος + if ($GMT_day[$r]==5) #### Παρασκευή τοπικός χρόνος { if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) { @@ -13414,7 +20082,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday τοπικός χρόνος + if ($GMT_day[$r]==6) #### Σάββατο τοπικός χρόνος { if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) { @@ -13449,7 +20117,7 @@ if (isset($camp_lists)) $default_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday τοπικός χρόνος + if ($GMT_day[$r]==0) #### Κυριακή τοπικός χρόνος { if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) { @@ -13462,7 +20130,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday τοπικός χρόνος + if ($GMT_day[$r]==1) #### Δευτέρα τοπικός χρόνος { if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) { @@ -13475,7 +20143,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday τοπικός χρόνος + if ($GMT_day[$r]==2) #### Τρίτη τοπικός χρόνος { if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) { @@ -13488,7 +20156,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday τοπικός χρόνος + if ($GMT_day[$r]==3) #### Τετάρτη τοπικός χρόνος { if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) { @@ -13501,7 +20169,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday τοπικός χρόνος + if ($GMT_day[$r]==4) #### Πέμπτη τοπικός χρόνος { if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) { @@ -13514,7 +20182,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday τοπικός χρόνος + if ($GMT_day[$r]==5) #### Παρασκευή τοπικός χρόνος { if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) { @@ -13527,7 +20195,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday τοπικός χρόνος + if ($GMT_day[$r]==6) #### Σάββατο τοπικός χρόνος { if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) { diff --git a/LANG_www/vicidial_el/admin_header.php b/LANG_www/vicidial_el/admin_header.php new file mode 100644 index 00000000..9de27417 --- /dev/null +++ b/LANG_www/vicidial_el/admin_header.php @@ -0,0 +1,932 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Χρήστες     Εκστρατείες     Λίστες     Βοηθοί     Φίλτρα     Εισ-Ομάδες     Ομάδες Χρήστη     Απομακρυσμένοι Χειριστές     Admin     Εκθέσεις  
+ 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 Ελληνικά
+ +
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + + + + 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) { + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # pink + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} # pink + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} # pink + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} # pink + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink + else {$status_sh=''; $status_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + + + + +
WIDTH=160> + SIZE=>Χρήστες +
+   >Δείτε Χρήστες +
+   >Προσθήκη νέου χρήστη +
+   >Χρήστης αντιγράφων +
+   >Αναζήτηση ενός χρήστη +
+   >Στατιστικά Χρήστη +
+   >Κατάσταση χρήστη +
+   >Ώρα Φύλλο
> + SIZE=>Εκστρατείες +
>   SIZE=>Κύρια Καμπάνιες
>   SIZE=>Καθεστώτων
>   SIZE=>HotKeys
>   SIZE=>Μόλυβδος Ανακύκλωσης
>   SIZE=>Auto-Alt Dial
>   SIZE=>Κατάλογος Mix
>   SIZE=>Παύση Κώδικες
> SIZE=>Λίστες
  + > Παρουσιάστε καταλόγους +
  + > Προσθέστε έναν νέο κατάλογο +
  + > Αναζήτηση ενός μολύβδου +
  + > Προσθέστε τον αριθμό σε DNC +
  + > Νέοι μόλυβδοι φορτίων +
> + SIZE=> Χειρόγραφα +
  + > Παρουσιάστε χειρόγραφα +
  + > Προσθέστε ένα νέο χειρόγραφο +
> SIZE=> Φίλτρα
  + > Παρουσιάστε φίλτρα +
  + > Προσθέστε ένα νέο φίλτρο +
> + SIZE=> $$$-ΟΜΑΔΕΣ +
  + > Παρουσιάστε-ΟΜΑΔΕΣ +
  + > Προσθέστε μια νέα-ΟΜΑΔΑ +
  + > $$$-ΟΜΑΔΑ αντιγράφων +
  + > Δείτε DIDs +
  + > Προστίθεται ένα νέο DID +
  + > ΑντιγραφήDID +
> + SIZE=> Ομάδες χρηστών +
  + > Παρουσιάστε ομάδες χρηστών +
  + > Προσθέστε μια νέα ομάδα χρηστών +
  + > Ωριαία έκθεση ομάδας +
  + > Μαζική Αλλαγή ομάδας +
> + SIZE=> Μακρινοί πράκτορες +
  + > Παρουσιάστε μακρινούς πράκτορες +
  + > Προσθέστε τους νέους μακρινούς πράκτορες +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Χρόνοι κλήσης
>   + SIZE=> Βάρδιες
>   + SIZE=> Τηλέφωνα
>   + SIZE=> Πρότυπα
>   + SIZE=> Carriers
>   + SIZE=> Κεντρικοί υπολογιστές
>   + SIZE=> Διασκέψεις
>   + SIZE=> Τοποθετήσεις συστημάτων
>   + SIZE=>Θέσεις συστημάτων
> + SIZE=> Εκθέσεις +
+
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) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + \n"; + echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε.\n"; + } + +if (strlen($reports_hh) > 1) { + ?> +> + + + + +\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 * 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 * 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); @@ -336,10 +429,13 @@ else $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 * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -349,7 +445,7 @@ else $tsr = "$row[4]"; $vendor_id = "$row[5]"; $list_id = "$row[7]"; - $campaign_id = "$row[8]"; + $gmt_offset_now = "$row[8]"; $phone_code = "$row[10]"; $phone_number = "$row[11]"; $title = "$row[12]"; @@ -379,7 +475,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -399,10 +495,11 @@ 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 "
ΣΠΙΤΙ | Ώρα ρολόι | Αποσύνδεση  
>   > Παρουσιάστε εκστρατείες     |     > Προσθέστε μια νέα εκστρατεία     |     > Εκστρατεία αντιγράφων     |     > Σε πραγματικό χρόνο περίληψη εκστρατειών
  > Παρουσιάστε χρόνους κλήσης  | > Προσθέστε έναν νέο χρόνο κλήσης  | > Παρουσιάστε χρόνους κρατικής κλήσης  | > Προσθέστε έναν νέο χρόνο κρατικής κλήσης
  > Δείτε Βάρδιες  | > Προστίθεται ένα νέο Shift
  > Παρουσιάστε τηλέφωνα  | > Προσθέστε ένα νέο τηλέφωνο  | > Τηλέφωνο Γνωστός Κατάλογος  | > Προστίθεται ένα νέο τηλέφωνο Γνωστός  | > Ομάδα Γνωστός Κατάλογος  | > Προσθέστε μια νέα ομάδα Γνωστός
  > Παρουσιάστε διασκέψεις   |   > Προσθέστε μια νέα διάσκεψη   |   > Παρουσιάστε διασκέψεις VICIDIAL   |   > Προσθέστε μια νέα διάσκεψη VICIDIAL
  > Παρουσιάστε κεντρικούς υπολογιστές   |   > Προσθέστε έναν νέο κεντρικό υπολογιστή
  > Δείτε Πρότυπα   |   > Προσθέστε ένα νέο πρότυπο
  > Show Carriers   |   > Add A New Carrier
  > Τοποθετήσεις συστημάτων
  >Θέσεις συστημάτων   |   >Κατηγορίες θέσης   |   >QC κωδικοί
  >Στατιστικά Χρήστη   |   >Κατάσταση χρήστη   |   >Ώρα Φύλλο   |   >Ημέρες Status
>  
+ LICENSE: GPLv2 +# AST GUI database administration modify lead in vicidial_list +# admin_modify_lead.php +# +# this is the administration lead information modifier screen, the administrator +# 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 # - # 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 # require("dbconnect.php"); @@ -19,6 +40,8 @@ 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"];} @@ -93,40 +116,50 @@ 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); - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier 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 -# -# 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 -# - $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); - - $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); +############################################# +##### 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); - $auth=$row[0]; + $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");} @@ -183,21 +216,22 @@ echo "ΔΙΑΧΕΙΡΙΣΗ: Τροποποί if ($end_call > 0) { -$call_length = ($STARTtime - $call_began); - - ### 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) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . 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); - ### 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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "οι πληροφορίες τροποποιήθηκαν

\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 @@ -226,18 +260,39 @@ $call_length = ($STARTtime - $call_began); echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; } - ### update last record in vicidial_agent_log and vicidial_log tables + ### 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 { @@ -281,6 +336,7 @@ else if ($lead_count > 0) { + ##### grab vicidial_log records ##### $stmt="select * 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); @@ -306,10 +362,47 @@ else $call_log .= "
$row[11] $row[3] $row[2] $row[1]
$row[1] $row[15]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$row[3] $row[2] $row[1]   $row[14]
  $row[14]   $row[17]
Χώρα :
Εναλ Τηλέφωνο :
Main Phone :
Εναλ Τηλέφωνο :
Ασφάλεια :
Σχόλια :
Σχόλια :
Τερματισμός: (with $log_campaign statuses)
Modify agent and vicidial logs
Modifyvicidial log
Modifyagent log
Modifycloser log
Add closer log record
\n"; @@ -474,7 +575,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner ΧρήστηςID: \n"; echo "
\n"; } else @@ -484,7 +585,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner ΧρήστηςID: \n"; echo "
\n"; } } @@ -513,8 +614,8 @@ echo "

\n"; echo "
\n"; echo "Κλήσεις για αυτόν τον οδηγό:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD
\n"; +echo "\n"; echo "$call_log\n"; @@ -522,8 +623,8 @@ echo "
# DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD HANGUP REASON
\n"; echo "

\n"; echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD WAIT
\n"; +echo "\n"; echo "$closer_log\n"; @@ -531,13 +632,23 @@ echo "
# DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD WAIT HANGUP REASON
\n"; echo "

\n"; +echo "ΧΕΙΡΙΣΤΗΣLOG RECORDS FOR THIS LEAD:\n"; +echo "\n"; +echo "\n"; + + echo "$agent_log\n"; + +echo "
# DATE/TIME CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
\n"; +echo "

\n"; + + echo "RECORDINGS FOR THIS LEAD:\n"; echo "\n"; echo "\n"; - $stmt="select * 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); +$stmt="select * 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); $u=0; while ($logs_to_print > $u) @@ -549,6 +660,30 @@ echo " - + @@ -514,7 +553,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -522,13 +561,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -729,7 +768,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -737,13 +776,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -764,8 +803,14 @@ function ParseFileName() { print ""; } -if ($leadfile && filesize($LF_path)<=8388608) { +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='ΛΙΣΤΕΣ', 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 ""; @@ -953,7 +998,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -961,13 +1006,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1179,7 +1224,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1187,13 +1232,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1267,54 +1312,23 @@ if ($leadfile && filesize($LF_path)<=8388608) { for ($i=0; $i\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"; } } else if (!eregi(".csv", $leadfile_name)) @@ -1369,54 +1383,22 @@ if ($leadfile && filesize($LF_path)<=8388608) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); for ($i=0; $i\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 " \r\n"; @@ -1431,8 +1413,8 @@ if ($leadfile && filesize($LF_path)<=8388608) { # } print ""; } -} else if (filesize($leadfile)>8388608) { - print "
Λάθος: Το αρχείο ξεπέρασε το όριο των 8ΜΒ.
"; +#} else if (filesize($leadfile)>8388608) { +# print "
ERROR: File exceeds the 8MB limit.
"; } ?> @@ -1554,17 +1536,17 @@ $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";} + if ($DBX) {print " Second Κυριακή March to First Κυριακή 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. + # Based on Second Κυριακή March to First Κυριακή 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) + # dow INTEGER Day of week (0=Κυριακή, to 6=Σάββατο) # OPTIONAL INPUT: # timezone INTEGER hour difference UTC - local standard time # (DEFAULT is blank) @@ -1650,12 +1632,12 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} + if ($DBX) {print " First Κυριακή April to Last Κυριακή 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. + # Based on first Κυριακή in April and last Κυριακή in October at 2 am. #********************************************************************** $USA_DST=0; @@ -1719,11 +1701,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + if ($DBX) {print " Last Κυριακή March to Last Κυριακή 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. + # Based on last Κυριακή in March and last Κυριακή in October at 1 am. #********************************************************************** $GBR_DST=0; @@ -1787,11 +1769,11 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + if ($DBX) {print " Last Κυριακή October to Last Κυριακή 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. + # Based on last Κυριακή in October and last Κυριακή in March at 1 am. #********************************************************************** $AUS_DST=0; @@ -1856,12 +1838,12 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} + if ($DBX) {print " First Κυριακή October to Last Κυριακή 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. + # Based on first Κυριακή in October and last Κυριακή in March at 1 am. #********************************************************************** $AUST_DST=0; @@ -1923,11 +1905,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} + if ($DBX) {print " First Κυριακή October to Third Κυριακή 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. + # Based on first Κυριακή in October and third Κυριακή in March at 1 am. #********************************************************************** $NZL_DST=0; @@ -1990,12 +1972,12 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + if ($DBX) {print " Third Κυριακή October to Last Κυριακή 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. + # Based on Third Κυριακή October to Last Κυριακή February at 1 am. #********************************************************************** $BZL_DST=0; @@ -2066,4 +2048,7 @@ if (!$AC_processed) } return $gmt_offset; -} \ No newline at end of file +} + +?> +
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD2) + { + $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 diff --git a/LANG_www/vicidial_el/admin_search_lead.php b/LANG_www/vicidial_el/admin_search_lead.php index 01549ba9..05162d95 100644 --- a/LANG_www/vicidial_el/admin_search_lead.php +++ b/LANG_www/vicidial_el/admin_search_lead.php @@ -1,17 +1,23 @@ LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php +# admin_search_lead.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead +# AST GUI database administration search for lead info +# admin_modify_lead.php +# +# this is the administration lead information modifier 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 # require("dbconnect.php"); @@ -31,9 +37,16 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} 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"];} $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); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -93,24 +106,49 @@ $browser = getenv("HTTP_USER_AGENT"); -ΔΙΑΧΕΙΡΙΣΗ: Αναζήτηση Οδηγού - -Ψάξιμο Καθοδήγησης - - +ΔΙΑΧΕΙΡΙΣΗ: Αναζήτηση Οδηγού <? -echo "<a href=\"./admin.php?ADD=100\">ΔΙΑΧΕΙΡΙΣΗ</a>: Lead search<BR>\n"; + +##### 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"); -if ( (!$vendor_id) and (!$phone) and (!$lead_id) ) + + + +echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user<BR>\n"; + + +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) { echo date("l F j, Y G:i:s A"); echo "\n<br><br><center>\n"; echo "<form method=post name=search action=\"$PHP_SELF\">\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<b>Παρακαλώ καταχωρήστε:<br> Vendor ID(αυτόματος κωδικός καθοδήγησης): <input type=text name=vendor_id size=10 maxlength=10> or \n"; - echo "<br><b>ένας αριθμός τηλεφώνου σπιτιού <input type=text name=phone size=10 maxlength=10> or\n"; - echo "<br><b>ID οδηγού <input type=text name=lead_id size=10 maxlength=10> <br><br>\n"; + echo "<br><b>ένας αριθμός τηλεφώνου σπιτιού <input type=text name=phone size=20 maxlength=16> or\n"; + echo "<br><b>ID οδηγού <input type=text name=lead_id size=10 maxlength=10> or\n"; + echo "<br><b>status: <input type=text name=status size=7 maxlength=6>   \n"; + echo "<b>list ID: <input type=text name=list_id size=15 maxlength=14>   \n"; + echo "<b>user: <input type=text name=user size=15 maxlength=20> <br><br>\n"; echo "<input type=submit name=submit value=ΕΠΙΒΕΒΑΙΩΣΗ></b>\n"; echo "</form>\n</center>\n"; echo "</body></html>\n"; @@ -138,8 +176,32 @@ else } else { - print "ERROR: you must search for something! Go back and search for something"; - exit; + 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 * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000"; + } + else + { + print "ERROR: you must search for something! Go back and search for something"; + exit; + } } } } @@ -182,13 +244,14 @@ else { $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]\">$row[0]</a></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"; @@ -197,11 +260,19 @@ else 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[2]</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 MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } diff --git a/LANG_www/vicidial_el/call_report_export.php b/LANG_www/vicidial_el/call_report_export.php new file mode 100644 index 00000000..87d307c7 --- /dev/null +++ b/LANG_www/vicidial_el/call_report_export.php @@ -0,0 +1,513 @@ +<? +# 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) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης 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"; + exit; + } + + + if ($RUNcampaign > 0) + { + $export_campaign_rows=''; + $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 from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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); + + $export_campaign_rows .= "$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]\r\n"; + $i++; + } + } + } + + if ($RUNgroup > 0) + { + $export_group_rows=''; + $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 from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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) + { + 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); + + $export_group_rows .= "$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]\r\n"; + $i++; + } + } + } + + + 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 ΕΚΘΕΣΗ ΕΞΑΓΩΓΗΣ CALLS', 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(); + + echo "$export_campaign_rows$export_group_rows"; + } + 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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>VICIDIAL: Εξαγωγή ζητεί έκθεση"; + + ##### 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>Εξαγωγή ζητεί έκθεση</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\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>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Εκστρατείες:</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>Εισερχόμενες Ομάδες:</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>Λίστες:</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>Καθεστώτων:</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>Ομάδες Χρήστη:</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=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_el/dbconnect.php b/LANG_www/vicidial_el/dbconnect.php index 5247e166..dae8cc7a 100644 --- a/LANG_www/vicidial_el/dbconnect.php +++ b/LANG_www/vicidial_el/dbconnect.php @@ -1,6 +1,10 @@ <? # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# dbconnect.php version 2.0.5 +# +# database connection settings and some global web settings +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # if ( file_exists("/etc/astguiclient.conf") ) { @@ -36,6 +40,9 @@ $WeBServeRRooT = '/usr/local/apache2/htdocs'; } $link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +if (!$link) { + die('MySQL connect ERROR: ' . mysql_error()); +} mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; @@ -45,5 +52,9 @@ $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/LANG_www/vicidial_el/fcstats.php b/LANG_www/vicidial_el/fcstats.php new file mode 100644 index 00000000..201ab56d --- /dev/null +++ b/LANG_www/vicidial_el/fcstats.php @@ -0,0 +1,600 @@ +<? +# fcstats.php +# +# Copyright (C) 2009 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 +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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;"; +$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> + +<? +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>VICIDIAL: In-Group Fronter-Closer Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK ΕΠΙΒΕΒΑΙΩΣΗ\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 "VICIDIAL: In-Group Fronter-Closer Stats                      $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 "| ΧΕΙΡΙΣΤΗΣ                   |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 "| ΧΕΙΡΙΣΤΗΣ                   | 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/LANG_www/vicidial_el/group_hourly_stats.php b/LANG_www/vicidial_el/group_hourly_stats.php index 1f85a0e6..3e76a4af 100644 --- a/LANG_www/vicidial_el/group_hourly_stats.php +++ b/LANG_www/vicidial_el/group_hourly_stats.php @@ -1,12 +1,13 @@ LICENSE: GPLv2 -### +# group_hourly_stats.php +# +# Copyright (C) 2009 Matt Florell 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 # require("dbconnect.php"); @@ -104,14 +105,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -ΔΙΑΧΕΙΡΙΣΗ: Ομαδοποιημένα Ωριαία Στατιστικά + +ΔΙΑΧΕΙΡΙΣΗ: Ομαδοποιημένα Ωριαία Στατιστικά <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + +##### 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"); + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> + + <CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   ΔΙΑΧΕΙΡΙΣΗ</a>: Ομαδοποιημένα Ωριαία Στατιστικά <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Ομαδοποιημένα Ωριαία Στατιστικά <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> @@ -234,7 +256,7 @@ echo "<font size=0>\n\n\n<br><br><br>\nχρόνος εκτέλεσης διαδ ?> -</TD></TR><TABLE> +</TD></TR></TABLE> </body> </html> diff --git a/LANG_www/vicidial_el/list_download.php b/LANG_www/vicidial_el/list_download.php new file mode 100644 index 00000000..32ca344d --- /dev/null +++ b/LANG_www/vicidial_el/list_download.php @@ -0,0 +1,130 @@ +<? +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης 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 * 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); + + 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]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_el/listloader.pl b/LANG_www/vicidial_el/listloader.pl index d926368b..b8f9e064 100644 --- a/LANG_www/vicidial_el/listloader.pl +++ b/LANG_www/vicidial_el/listloader.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -18,6 +17,8 @@ # 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 # ### begin parsing run-time options ### @@ -148,6 +149,23 @@ $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';"; @@ -547,14 +565,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_el/listloaderMAIN.php b/LANG_www/vicidial_el/listloaderMAIN.php index a51563f1..bfb93e8d 100644 --- a/LANG_www/vicidial_el/listloaderMAIN.php +++ b/LANG_www/vicidial_el/listloaderMAIN.php @@ -1,7 +1,7 @@ <? # listloaderMAIN.php # -# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2008 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 diff --git a/LANG_www/vicidial_el/listloader_rowdisplay.pl b/LANG_www/vicidial_el/listloader_rowdisplay.pl index 3f8695c0..bbfc8170 100644 --- a/LANG_www/vicidial_el/listloader_rowdisplay.pl +++ b/LANG_www/vicidial_el/listloader_rowdisplay.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl - -### listloader_rowdisplay.pl version 0.2 *DBI-version* -### -### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_rowdisplay.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# # # CHANGES # diff --git a/LANG_www/vicidial_el/listloader_super.pl b/LANG_www/vicidial_el/listloader_super.pl index 167fff5e..3af97f37 100644 --- a/LANG_www/vicidial_el/listloader_super.pl +++ b/LANG_www/vicidial_el/listloader_super.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader_super.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_super.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -17,6 +16,8 @@ # 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 # ### begin parsing run-time options ### @@ -149,21 +150,38 @@ $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 ##### +########################################### - ### 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(); + +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; @@ -549,14 +567,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_el/new_listloader_superL.php b/LANG_www/vicidial_el/new_listloader_superL.php index d3c0060d..7566e465 100644 --- a/LANG_www/vicidial_el/new_listloader_superL.php +++ b/LANG_www/vicidial_el/new_listloader_superL.php @@ -1,7 +1,7 @@ <? # new_listloader_superL.php # -# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -19,11 +19,17 @@ # 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 # # 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.0.4'; -$build = '70510-1518'; +$version = '2.0.5-29'; +$build = '90310-2128'; require("dbconnect.php"); @@ -47,6 +53,7 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} 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"];} @@ -113,10 +120,28 @@ if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_co # $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); - +} $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -125,6 +150,7 @@ $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]; @@ -144,6 +170,9 @@ $browser = getenv("HTTP_USER_AGENT"); 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); @@ -290,7 +319,17 @@ function ParseFileName() { </script> <title>ΔΙΑΧΕΙΡΙΣΗ: Lead Loader - + + +
"; +?> + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> @@ -304,7 +343,7 @@ function ParseFileName() {
(μόνο αριθμοί or leave blank for values in the file)
Phone Code Override: Μήκη Override: (μόνο αριθμοί or leave blank for values in the file)
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
diff --git a/LANG_www/vicidial_el/non_agent_api.php b/LANG_www/vicidial_el/non_agent_api.php new file mode 100644 index 00000000..2d525f39 --- /dev/null +++ b/LANG_www/vicidial_el/non_agent_api.php @@ -0,0 +1,1419 @@ + 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 +# + +$version = '2.0.5-5'; +$build = '90118-1056'; + +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"];} + + +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); +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) + { + $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); + } + +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';} + +$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; + } + + + + +################################################################################ +### 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';"; + if ($DB) {echo "|$stmt|\n";} + $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 + { + if ($dnc_check == 'Y') + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + if ($DB) {echo "|$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') + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';"; + if ($DB) {echo "|$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; + } + } + + ### 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';"; + if ($DB) {echo "$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) {echo "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) {echo "$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;"; + if ($DB) {echo "|$stmt|\n";} + $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) {echo "$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; + } + } + + + +$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 * 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 * 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 * 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 * 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 * 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-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 == '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 * 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 * 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/LANG_www/vicidial_el/remote_dispo.php b/LANG_www/vicidial_el/remote_dispo.php index 3f45251b..e0e1749d 100644 --- a/LANG_www/vicidial_el/remote_dispo.php +++ b/LANG_www/vicidial_el/remote_dispo.php @@ -1,10 +1,12 @@ LICENSE: GPLv2 -### -# 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 - +# remote_dispo.php +# +# Copyright (C) 2008 Matt Florell 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 diff --git a/LANG_www/vicidial_el/timeclock_edit.php b/LANG_www/vicidial_el/timeclock_edit.php new file mode 100644 index 00000000..db83429a --- /dev/null +++ b/LANG_www/vicidial_el/timeclock_edit.php @@ -0,0 +1,478 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80624-1342 - First build +# 80701-1323 - functional beta version done +# 90310-2109 - Added admin header +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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; + } + } + + + +?> + + + +ΔΙΑΧΕΙΡΙΣΗ:Ώρα ρολόι Εγγραφή Επεξεργασία +<? + +##### 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>Ώρα ρολόι Εγγραφή Επεξεργασία for <? echo $user ?></TD><TD ALIGN=RIGHT>   </TD></TR> + +<? + +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 "ERROR-Υπάρχει ένα πρόβλημα με τα δεδομένα που πληκτρολογήσατε, παρακαλώ πηγαίνετε πίσω<BR>\n"; + echo "Μια timeclock συνόδου δεν μπορεί να επικαλύπτονται άλλο timeclock συνόδου<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 "ERROR-Υπάρχει ένα πρόβλημα με τα δεδομένα που πληκτρολογήσατε, παρακαλώ πηγαίνετε πίσω<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>ΟΜΑΔΑ ΧΡΗΣΤΩΝ: </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>ΟΜΑΔΑ ΧΡΗΣΤΩΝ: </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=ΕΠΙΒΕΒΑΙΩΣΗ 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\">VICIDIAL Ώρα Φύλλο</a>\n"; +echo " - <a href=\"./user_stats.php?user=$user\">Στατιστικά Χρήστη</a>\n"; +echo " - <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</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>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +} +else +{ + +echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n"; +} +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_el/timeclock_report.php b/LANG_www/vicidial_el/timeclock_report.php new file mode 100644 index 00000000..5a300c1c --- /dev/null +++ b/LANG_www/vicidial_el/timeclock_report.php @@ -0,0 +1,359 @@ +<? +# timeclock_report.php +# +# Copyright (C) 2009 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 +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($order)<2) {$order='hours_down';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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;"; +$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> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<TITLE>VICIDIAL: ΧρήστηςΏρα ρολόι Report + +<? + +##### 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>\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>Χρονικό διάστημα:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Ομάδες Χρήστη:</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>Χρήστης:</B></font><BR>\n"; +echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; + +echo "<BR><BR><INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\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\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "VICIDIAL: ΧρήστηςΏρα ρολόι 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/LANG_www/vicidial_el/timeclock_status.php b/LANG_www/vicidial_el/timeclock_status.php new file mode 100644 index 00000000..b6499441 --- /dev/null +++ b/LANG_www/vicidial_el/timeclock_status.php @@ -0,0 +1,548 @@ +<? +# timeclock_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day 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]; + $timeclock_end_of_day = $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"); +$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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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;"; +$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>ΔΙΑΧΕΙΡΙΣΗ:Ώρα ρολόι Status +<? + +##### 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>Ώρα ρολόι Status for <? echo $user_group ?></TD><TD ALIGN=RIGHT>             +<? +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>ΟΜΑΔΑ ΧΡΗΣΤΩΝ</a>\n"; +?> +</TD></TR> + + + + +<? + +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 ΟΜΑΔΑ ΧΡΗΣΤΩΝ: $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 CAMPAIGN</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 + } + + 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]);} + + $s++; + } + $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>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? +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 ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</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 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</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>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_el/user_group_bulk_change.php b/LANG_www/vicidial_el/user_group_bulk_change.php new file mode 100644 index 00000000..95757402 --- /dev/null +++ b/LANG_www/vicidial_el/user_group_bulk_change.php @@ -0,0 +1,269 @@ +<? +# 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 +# + +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$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 * 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>ΔΙΑΧΕΙΡΙΣΗ: Ομάδα Χρήστη Μαζική Αλλαγή +<? + +##### 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>   Ομάδα Χρήστη Μαζική Αλλαγή</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<? + +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 Ομάδα Χρήστη $old_group Χρήστες changed to the $group Ομάδα Χρήστη<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 ΟΜΑΔΑ ΧΡΗΣΤΩΝ CHANGE', event_sql=\"$SQL_log\", event_notes='Old Ομάδα:$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 Χρήστες changed to the $group Ομάδα Χρήστη<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 ΟΜΑΔΑ ΧΡΗΣΤΩΝ 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 Χρήστες 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=ΕΠΙΒΕΒΑΙΩΣΗ></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 Χρήστες 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=ΕΠΙΒΕΒΑΙΩΣΗ></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>\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_el/user_stats.php b/LANG_www/vicidial_el/user_stats.php index d03abe1d..cb8c5d69 100644 --- a/LANG_www/vicidial_el/user_stats.php +++ b/LANG_www/vicidial_el/user_stats.php @@ -1,14 +1,22 @@ <? -### user_stats.php -### -### Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# user_stats.php +# +# Copyright (C) 2009 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 # header ("Content-type: text/html; charset=utf-8"); @@ -19,16 +27,18 @@ $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"];} + 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"])) {$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["submit"])) {$submit=$_GET["submit"];} +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["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} +if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -66,6 +76,7 @@ $browser = getenv("HTTP_USER_AGENT"); $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); } @@ -73,6 +84,8 @@ $browser = getenv("HTTP_USER_AGENT"); { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -88,14 +101,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> <html> <head> -<title>ΔΙΑΧΕΙΡΙΣΗ: User Stats + +ΔΙΑΧΕΙΡΙΣΗ: Στατιστικά Χρήστη <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   ΔΙΑΧΕΙΡΙΣΗ</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Στατιστικά Χρήστη for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> @@ -105,81 +139,130 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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=user value=\"$user\">\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n"; echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>  \n"; +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\n"; +echo "           $user - $full_name<BR><BR>\n"; -echo " - <a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_status.php?user=$user\">User Status</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Ώρα Φύλλο</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">Κατάσταση χρήστη</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Χρήστης multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\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); - $statuses_to_print = mysql_num_rows($rslt); - echo "<br><center>\n"; -echo "<B>ΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ:</B>\n"; +##### vicidial agent talk time and status ##### + +echo "<B>VICIDIAL ΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ:</B>\n"; echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=2>ΚΑΤΑΣΤΑΣΗ</td><td align=right><font size=2>ΚΑΤΑΜΕΤΡΗΣΗ</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo "<tr $bgcolor><td><font size=2>$row[1]</td>"; - echo "<td align=right><font size=2> $row[0]</td>\n"; - echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; +$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 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'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; +$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_seconds = $call_sec[$o]; $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); + $call_hours_int = round($call_hours, 2); + $call_hours_int = intval("$call_hours_int"); $call_minutes = ($call_hours - $call_hours_int); $call_minutes = ($call_minutes * 60); $call_minutes_int = round($call_minutes, 0); if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + 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_int:$call_minutes_int</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_seconds = $total_sec; +$call_hours = ($call_seconds / 3600); +$call_hours_int = round($call_hours, 2); +$call_hours_int = intval("$call_hours_int"); +$call_minutes = ($call_hours - $call_hours_int); +$call_minutes = ($call_minutes * 60); +$call_minutes_int = round($call_minutes, 0); +if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + echo "<tr><td><font size=2>ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; echo "</TABLE></center>\n"; + + +##### Login and Logout time from vicidial agent interface ##### + echo "<br><br>\n"; echo "<center>\n"; -echo "<B> ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; +echo "<B>VICIDIAL ΧΕΙΡΙΣΤΗΣ ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</B>\n"; echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</td></tr>\n"; @@ -215,8 +298,8 @@ echo "<tr><td><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜ $event_seconds = ($event_stop_seconds - $event_start_seconds); $total_login_time = ($total_login_time + $event_seconds); $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); + $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); @@ -245,8 +328,8 @@ echo "<tr><td><font size=2 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜ } $total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); $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); @@ -255,18 +338,152 @@ if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_mi echo "<tr><td><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> $total_login_hours_int:$total_login_minutes_int</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>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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>ΕΚΣΤΡΑΤΕΙΑ</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></tr>\n"; +echo "<B>TIMECLOCK ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:</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 >ΣΥΜΒΑΝ</td><td align=right><font size=2> ΗΜΕΡΑ</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>ΩΡΕΣ:ΛΕΠΤΑ</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 = ($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><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_int:$event_minutes_int"; + 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 = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); +$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";} + + 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_int:$total_login_minutes_int </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>ΕΚΣΤΡΑΤΕΙΑ</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n"; + + $stmt="select * 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 "</tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound calls for this time period ##### + +echo "<B>ΕΞΕΡΧΟΜΕΝΟ 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>ΕΚΣΤΡΑΤΕΙΑ</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 * 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); @@ -290,18 +507,20 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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></center><BR><BR>\n"; +echo "</TABLE><BR><BR>\n"; +##### vicidial agent inbound calls for this time period ##### -echo "<B>CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\n"; +echo "<B>Εισερχόμενα/CLOSER 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>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> WAIT (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 * 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); @@ -325,7 +544,8 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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[17] </td></tr>\n"; } @@ -333,7 +553,7 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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"; @@ -353,6 +573,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$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 @@ -375,7 +619,45 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon } -echo "</TABLE></center>\n"; +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound user manual calls for this time period ##### + +echo "<B>MANUAL ΕΞΕΡΧΟΜΕΝΟ 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"); diff --git a/LANG_www/vicidial_el/user_status.php b/LANG_www/vicidial_el/user_status.php index 97ef2cac..6af0dff4 100644 --- a/LANG_www/vicidial_el/user_status.php +++ b/LANG_www/vicidial_el/user_status.php @@ -1,11 +1,15 @@ <? -### user_status.php -### -### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# 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 # header ("Content-type: text/html; charset=utf-8"); @@ -16,7 +20,7 @@ $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"];} + 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"];} @@ -25,21 +29,43 @@ 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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"); +$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]; @@ -61,18 +87,27 @@ $browser = getenv("HTTP_USER_AGENT"); if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $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]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $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 { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } } $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; @@ -99,6 +134,19 @@ $browser = getenv("HTTP_USER_AGENT"); $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 * from vicidial_campaigns;"; @@ -118,14 +166,35 @@ while ($i < $groups_to_print) ?> <html> <head> -<title>ΔΙΑΧΕΙΡΙΣΗ: User Status + +ΔΙΑΧΕΙΡΙΣΗ: Κατάσταση χρήστη <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   ΔΙΑΧΕΙΡΙΣΗ</a>: User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=<? echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Κατάσταση χρήστη for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> @@ -134,43 +203,216 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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") -{ + { $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; $rslt=mysql_query($stmt, $link); echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<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='Ώρα ρολόι 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='Χρήστης login time: $last_action_sec|Ώρα ρολόι 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 "<PRE>"; - echo "Agent Logged in at server: $Aserver_ip\n"; - echo " in session: $Asession_id\n"; - echo " from phone: $Aextension\n"; - echo "Agent is in campaign: $Acampaign\n"; - echo " status: $Astatus\n"; - echo " hungup last call at: $Alast_call\n"; - echo " Closer groups: $Acl_campaigns\n\n"; + { + echo "<BR>\n"; + echo "$user - $full_name \n"; + echo "       GROUP: $user_group <BR>\n"; - echo "</PRE>"; + 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"; + 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 Εκστρατεία: <SELECT SIZE=1 NAME=group>\n"; @@ -182,29 +424,56 @@ if ($agents_to_print > 0) $o++; } echo "</SELECT>\n"; - echo "<input type=submit name=submit value=CHANGE><BR></form>\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 ΧΕΙΡΙΣΤΗΣOUT\"><BR></form>\n"; + } } -} else -{ - echo "Agent is not logged in\n<BR>"; + { + echo "Agent is not logged in to VICIDIAL\n<BR>"; + } -} +echo "\n<BR>"; + +if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) + { + echo "Χρήστης $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 "Χρήστης $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"; + } -echo "           $user - $full_name \n"; -echo "       GROUP: $user_group <BR><BR>\n"; - -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; +$REPORTdate = date("Y-m-d"); +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Ώρα Φύλλο</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">Στατιστικά Χρήστη</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Τροποποίηση Χρήστη</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Χρήστης multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; @@ -212,7 +481,7 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; $ENDtime = date("U"); -$RUNtime = ($ENDtime - $STARTtime); +$RUNtime = ($ENDtime - $StarTtimE); echo "\n\n\n<br><br><br>\n\n"; @@ -236,7 +505,3 @@ exit; ?> - - - - diff --git a/LANG_www/vicidial_el/vdremote.php b/LANG_www/vicidial_el/vdremote.php index a0adc1ed..c7182786 100644 --- a/LANG_www/vicidial_el/vdremote.php +++ b/LANG_www/vicidial_el/vdremote.php @@ -1,7 +1,10 @@ <? # vdremote.php # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# make sure you have added a user to the vicidial_users MySQL table with at +# least user_level 4 to access this page the first time +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -9,7 +12,6 @@ # 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 # -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time $version = '1.1.12'; $build = '60619-1603'; diff --git a/LANG_www/vicidial_el/vicidial_admin_web_logo.gif b/LANG_www/vicidial_el/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/LANG_www/vicidial_el/vicidial_admin_web_logo.gif differ diff --git a/LANG_www/vicidial_el/vicidial_admin_web_logo_small.gif b/LANG_www/vicidial_el/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/LANG_www/vicidial_el/vicidial_admin_web_logo_small.gif differ diff --git a/LANG_www/vicidial_el/vicidial_sales_viewer.php b/LANG_www/vicidial_el/vicidial_sales_viewer.php new file mode 100644 index 00000000..57731cea --- /dev/null +++ b/LANG_www/vicidial_el/vicidial_sales_viewer.php @@ -0,0 +1,236 @@ +<? header("Pragma: no-cache"); +# +# vicidial_sales_viewer.php - VICIDIAL administration page +# +# +# Copyright (C) 2009 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# + +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"];} + +?> +<html> +<head> +<title>VICIDIAL recent sales lookup + + + + + +
"; +?> + +
+ + + + + + + + + + + + + + + + + + + + + +
Vicidial ΕΞΕΡΧΟΜΕΝΟ recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a VICIDIAL 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)
Εκστρατεία 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/LANG_www/vicidial_el/vtiger_search.php b/LANG_www/vicidial_el/vtiger_search.php new file mode 100644 index 00000000..5e9c9761 --- /dev/null +++ b/LANG_www/vicidial_el/vtiger_search.php @@ -0,0 +1,788 @@ + 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 +# +# 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 +# + +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 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]; + } +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; + +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;} + + + + + +########################################################################## +##### 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 + { + 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) + { + 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]; + + 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/LANG_www/vicidial_el/vtiger_user.php b/LANG_www/vicidial_el/vtiger_user.php new file mode 100644 index 00000000..695c1622 --- /dev/null +++ b/LANG_www/vicidial_el/vtiger_user.php @@ -0,0 +1,316 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# + +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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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/LANG_www/vicidial_el/welcome.php b/LANG_www/vicidial_el/welcome.php index 00b8d8f0..e9becb18 100644 --- a/LANG_www/vicidial_el/welcome.php +++ b/LANG_www/vicidial_el/welcome.php @@ -1,20 +1,21 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # echo "VICIDIAL Καλωσήρθες\n"; echo "\n"; echo "\n"; -echo "




"; +echo "




"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "
Υποδοχή
 
Agent Login
 
Ώρα ρολόι
 
Administration
 
\n"; diff --git a/LANG_www/vicidial_el/welcome_demo.php b/LANG_www/vicidial_el/welcome_demo.php new file mode 100644 index 00000000..49c0e470 --- /dev/null +++ b/LANG_www/vicidial_el/welcome_demo.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_el/welcome_languages.php b/LANG_www/vicidial_el/welcome_languages.php new file mode 100644 index 00000000..a89bbfcb --- /dev/null +++ b/LANG_www/vicidial_el/welcome_languages.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_es/AST_CLOSER_service_level.php b/LANG_www/vicidial_es/AST_CLOSER_service_level.php new file mode 100644 index 00000000..9fad467d --- /dev/null +++ b/LANG_www/vicidial_es/AST_CLOSER_service_level.php @@ -0,0 +1,956 @@ + 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 +# + +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); +$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 "Nombre y contraseña inválidos del usuario: |$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 from vicidial_inbound_groups;"; +$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++; + } +?> + + + + + +\n"; +echo "VICIDIAL: VDAD Closer Service Level Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFICAR | INFORMES \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en 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 "VICIDIAL: Closer Service-Level Stats                      $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 "---------- LLAMADA EN ESPERA TEMNE DE SEGUNDOS\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE RESPUESTA (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/LANG_www/vicidial_es/AST_CLOSERstats.php b/LANG_www/vicidial_es/AST_CLOSERstats.php index 93a7bc05..bd0886bd 100644 --- a/LANG_www/vicidial_es/AST_CLOSERstats.php +++ b/LANG_www/vicidial_es/AST_CLOSERstats.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_CLOSERstats.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat @@ -10,6 +10,16 @@ # 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 # require("dbconnect.php"); @@ -20,24 +30,58 @@ $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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["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';} - $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); +############################################# +##### 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); - $auth=$row[0]; + $non_latin = $row[0]; + $i++; + } +##### 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); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = ($local_gmt * 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)) { @@ -52,16 +96,56 @@ $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 from vicidial_inbound_groups;"; $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); - $groups[$i] =$row[0]; + $LISTgroups[$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("--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++; } ?> @@ -79,36 +163,80 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: Estadísticas de VDAD Closer\n"; +echo "VICIDIAL: Estadísticas de VDAD Closer\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 "Rango de Fecha:
\n"; echo "\n"; -echo "\n"; +echo "
\n"; +echo "Grupos De entrada: \n"; +echo "\n"; +echo "\n"; -echo "\n"; +echo "           "; +echo "MODIFICAR | "; +echo "INFORMES | "; +echo "IVR REPORT \n"; +echo "\n"; + +echo "
\n"; + +#echo "\n"; +echo "Shift: \n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; +echo "   \n"; +echo "
\n"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if ($groups_to_print < 1)
 {
 echo "\n\n";
-echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n";
+echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
 }
 
 else
@@ -133,38 +261,124 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
-echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER                      $NOW_TIME\n";
+echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER: $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='" . mysql_real_escape_string($group) . "';";
+$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');";
+$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]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+$IVRcalls =	sprintf("%10s", $rowx[0]);
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
+	{$average_call_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);
+	$average_call_seconds = ($TOTALsec / $row[0]);
+	$average_call_seconds = round($average_call_seconds, 0);
+	$average_call_seconds =	sprintf("%10s", $average_call_seconds);
+	}
+$RESPUESTAEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($RESPUESTAEDcalls < 1) or ($TOTALcalls < 1) )
+	{$RESPUESTAEDpercent = '0';}
+else
+	{
+	$RESPUESTAEDpercent = (($RESPUESTAEDcalls / $TOTALcalls) * 100);
+	$RESPUESTAEDpercent = round($RESPUESTAEDpercent, 0);
+	}
+if ( ($rowy[0] < 1) or ($RESPUESTAEDcalls < 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 "Llamadas dentro de esta campaña $TOTALcalls\n";
-echo "Average Call Length for all Calls:            $average_hold_seconds seconds\n";
+
+echo "Total de llamadas a adoptarse en este In-Grupo:        $TOTALcalls\n";
+echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
+echo "Answered Calls:                               $RESPUESTAEDcalls  $RESPUESTAEDpercent%\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 "---------- DROPS\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='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
+$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);
@@ -179,101 +393,111 @@ else
 	}
 
 if ( ($row[0] < 1) or ($row[1] < 1) )
-	{$average_hold_seconds = '         0';}
+	{
+	$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 ( ($RESPUESTAEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_RESPUESTAEDpercent = '0';}
+else
+	{
+	$DROP_RESPUESTAEDpercent = (($DROPcalls / $RESPUESTAEDcalls) * 100);
+	$DROP_RESPUESTAEDpercent = round($DROP_RESPUESTAEDpercent, 0);
+	}
 
-echo "Total DROP Calls: $DROPcalls  $DROPpercent%\n";
+echo "Total DROP Calls: $DROPcalls  $DROPpercent%               drop/answered: $DROP_RESPUESTAEDpercent%\n";
 echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
 
 
 
-##############################
-#########  CALL STATUS STATS
 
-$TOTALcalls = 0;
+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;";
+	$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;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_two = $row[0];
+
+	if ( ($RESPUESTAEDcalls > 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 / $RESPUESTAEDcalls) * 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 / $RESPUESTAEDcalls) * 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 "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "---------- CUSTOM INDICATORS\n";
+echo "GDE (Answered/Llamadas totales tomadas in to this In-Group):  $RESPUESTAEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_RESPUESTAEDpercent%\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";
 
-$stmt="SELECT * from vicidial_statuses order by status";
-$rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
 
-$o=0;
-while ($statuses_to_print > $o) 
-	{
-	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="SELECT * from vicidial_campaign_statuses 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),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) . "' group by status;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+# 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);
-$i=0;
-while ($i < $statuses_to_print)
+$p=0;
+while ($p < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
-
-	$TOTALcalls = ($TOTALcalls + $row[0]);
-
-	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[1];
-	$status =	sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 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);}	
-		}
-	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');}	
-		}
-
-
-	echo "| $status | $status_name | $STATUScount |\n";
-
-	$i++;
+	$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++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
-
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
-
-
-
-
+##############################
+#########  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='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
+$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);
@@ -310,6 +534,563 @@ echo "Average QUEUE Length for queue calls:         $average_queue_seconds secon
 echo "Average QUEUE Length across all calls:        $average_total_queue_seconds seconds\n";
 
 
+
+##############################
+#########  CALL HOLD TIME BREAKDOWN IN SECONDS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- LLAMADA EN ESPERA TEMNE DE 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 RESPUESTAED 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') 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 "---------- CONVOCATORIA colgar RAZÓN ESTADÍSTICAS\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          | CATEGORÍA             | 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_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
+
+	$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_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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 CATEGORÍA STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| CATEGORÍA             | 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";
+
+
 ##############################
 #########  USER STATS
 
@@ -324,7 +1105,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| AGENTE                    | CALLS      | TIME M   | AVRG M |\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='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+$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);
@@ -343,23 +1124,25 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$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";
+	$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
 	$USERtotTALK_MS =		sprintf("%8s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$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 = eregi_replace('-','',$USERavgTALK_MS);
 	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
 
 	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
@@ -367,22 +1150,25 @@ while ($i < $users_to_print)
 	$i++;
 	}
 
-if (!$TOTcalls) {$TOTcalls = 1;}
-$TOTavg = ($TOTtime / $TOTcalls);
-$TOTavg = round($TOTavg, 0);
-$TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
-$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
-$TOTavg_S = ($TOTavg_S * 60);
-$TOTavg_S = round($TOTavg_S, 0);
-if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
-$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
-$TOTavg =		sprintf("%6s", $TOTavg_MS);
+if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
+else
+	{
+	$TOTavg = ($TOTtime / $TOTcalls);
+	$TOTavg = round($TOTavg, 0);
+	$TOTavg_M = ($TOTavg / 60);
+	$TOTavg_M_int = round($TOTavg_M, 2);
+	$TOTavg_M_int = intval("$TOTavg_M_int");
+	$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
+	$TOTavg_S = ($TOTavg_S * 60);
+	$TOTavg_S = round($TOTavg_S, 0);
+	if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
+	$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	}
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -408,69 +1194,86 @@ echo "---------- ESTADÍSTICAS DEL TIEMPO\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",$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)
 	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
+	$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;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
+	$drop_count[$i] = $Fdrop[$i];
 	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' 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)
@@ -482,7 +1285,7 @@ else
 	}
 
 echo "\n";
-echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LAS LLAMADAS TOTALES PUESTAS DE ESTA CAMPAÚA\n";
+echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES TAKEN INTO THIS IN-GROUP\n";
 
 $k=1;
 $Mk=0;
@@ -597,13 +1400,99 @@ while ($i <= 96)
 	$h++;
 	}
 
-
 echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
 
 
 
 
 
+
+##### Answered wait time breakdown
+echo "\n";
+echo "---------- CALL RESPUESTAED 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";
@@ -611,7 +1500,9 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 
 
+
 ?>
 
+
- \ No newline at end of file + diff --git a/LANG_www/vicidial_es/AST_IVRfilter.php b/LANG_www/vicidial_es/AST_IVRfilter.php new file mode 100644 index 00000000..86d73dfc --- /dev/null +++ b/LANG_www/vicidial_es/AST_IVRfilter.php @@ -0,0 +1,248 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# + +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 "Nombre y contraseña inválidos del usuario: |$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 "Rango de Fecha:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "INFORMES\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 "| CATEGORÍA             | 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='Entrantes_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='Entrantes_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='Entrantes_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='Entrantes_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='Entrantes_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/LANG_www/vicidial_es/AST_IVRstats.php b/LANG_www/vicidial_es/AST_IVRstats.php new file mode 100644 index 00000000..8c6d21ee --- /dev/null +++ b/LANG_www/vicidial_es/AST_IVRstats.php @@ -0,0 +1,684 @@ + 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 +# + +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); +$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 "Nombre y contraseña inválidos del usuario: |$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 from vicidial_inbound_groups;"; +$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++; + } + +$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 "VICIDIAL: IVR 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 "Rango de Fecha:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "Grupos De entrada: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "MODIFICAR | "; +echo "INFORMES | "; +echo "INFORME CLOSER \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 SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
+}
+
+else
+{
+
+
+echo "VICIDIAL: IVR Stats: $group_string          $NOW_TIME\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 CALLS 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 "---------- ESTADÍSTICAS DEL TIEMPO\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 EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES 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/LANG_www/vicidial_es/AST_VDADstats.php b/LANG_www/vicidial_es/AST_VDADstats.php index c8a5109c..4fcbf35e 100644 --- a/LANG_www/vicidial_es/AST_VDADstats.php +++ b/LANG_www/vicidial_es/AST_VDADstats.php @@ -1,14 +1,22 @@ LICENSE: GPLv2 -### -# CHANGES +# AST_VDADstats.php +# +# Copyright (C) 2009 Matt Florell 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 # header ("Content-type: text/html; charset=utf-8"); @@ -18,27 +26,51 @@ 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["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"];} + 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["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); +############################################# +##### 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); - $auth=$row[0]; + $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)) { @@ -53,18 +85,52 @@ $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";} -$groups_to_print = mysql_num_rows($rslt); +$campaigns_to_print = mysql_num_rows($rslt); $i=0; -while ($i < $groups_to_print) +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_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_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++; + } ?> @@ -80,33 +146,62 @@ while ($i < $groups_to_print) \n"; -echo "VICIDIAL: VDAD Stats\n"; +echo "VICIDIAL: VDAD Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + echo "
\n"; +echo "
Fechas:
"; +echo "\n"; +echo "\n"; echo "\n"; -echo "\n"; +echo "
Campañas:
"; +echo "\n"; +echo "
Shift:
"; echo "\n"; +echo "

\n"; echo "\n"; -echo "           MODIFICAR | INFORMES \n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " MODIFICAR | \n"; + echo " INFORMES \n"; + } +else + { + echo " CAMPAIGNS | \n"; + echo " INFORMES \n"; + } +echo "
"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if (strlen($group[0]) < 1)
 {
 echo "\n\n";
 echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n";
@@ -134,7 +229,7 @@ if ($shift == 'ALL')
 	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
 	}
 $query_date_BEGIN = "$query_date $time_BEGIN";   
-$query_date_END = "$query_date $time_END";
+$query_date_END = "$end_date $time_END";
 
 
 
@@ -144,27 +239,29 @@ 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_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 
 $TOTALcalls =	sprintf("%10s", $row[0]);
-if ( ($row[0] < 1) or ($row[1] < 1) )
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
 	{$average_hold_seconds = '         0';}
 else
 	{
-	$average_hold_seconds = ($row[1] / $row[0]);
+	$average_hold_seconds = ($TOTALsec / $row[0]);
 	$average_hold_seconds = round($average_hold_seconds, 2);
 	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
 	}
 echo "Llamadas dentro de esta campaña $TOTALcalls\n";
 echo "Longitud media para las llamadas en segundos: $average_hold_seconds\n";
 
+
 echo "\n";
 echo "---------- DROPS\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -172,11 +269,56 @@ $DROPcalls =	sprintf("%10s", $row[0]);
 $DROPcallsRAW =	$row[0];
 $DROPseconds =	$row[1];
 
-$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');";
+
+# 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]";
+	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) {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]";
+	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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
-$ANSWERcalls =	$row[0];
+$RESPUESTAcalls =	$row[0];
 
 if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
 	{$DROPpercent = '0';}
@@ -186,12 +328,12 @@ else
 	$DROPpercent = round($DROPpercent, 2);
 	}
 
-if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
-	{$DROPANSWERpercent = '0';}
+if ( ($DROPcalls < 1) or ($RESPUESTAcalls < 1) )
+	{$DROPRESPUESTApercent = '0';}
 else
 	{
-	$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
-	$DROPANSWERpercent = round($DROPANSWERpercent, 2);
+	$DROPRESPUESTApercent = (($DROPcallsRAW / $RESPUESTAcalls) * 100);
+	$DROPRESPUESTApercent = round($DROPRESPUESTApercent, 2);
 	}
 
 if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
@@ -204,13 +346,56 @@ else
 	}
 
 echo "Total DROP Calls: $DROPcalls  $DROPpercent%\n";
-echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $ANSWERcalls  $DROPANSWERpercent%\n";
+echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $RESPUESTAcalls  $DROPRESPUESTApercent%\n";
 echo "Longitud media para las llamadas DROP en segundos:    $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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$TOTALanswers = ($row[0] + $RESPUESTAcalls);
+
+
+$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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$agent_non_pause_sec = $row[0];
+
+if ($agent_non_pause_sec > 0)
+	{
+	$AVG_RESPUESTAagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+	$AVG_RESPUESTAagent_non_pause_sec = round($AVG_RESPUESTAagent_non_pause_sec, 2);
+	}
+else
+	{$AVG_RESPUESTAagent_non_pause_sec=0;}
+$AVG_RESPUESTAagent_non_pause_sec = sprintf("%10s", $AVG_RESPUESTAagent_non_pause_sec);
+
+echo "Productivity Rating:                          $AVG_RESPUESTAagent_non_pause_sec\n";
+
+
+
+
 echo "\n";
 echo "---------- AUTO-DIAL SIN RESPUESTA\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
+$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','B') and (length_in_sec <= 60 or length_in_sec is null);";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -237,6 +422,49 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls  $NApercent%\n";
 echo "Longitud media para las Llamadas sin Respuesta en segundos:       $average_na_seconds\n";
 
 
+##############################
+#########  CALL HANGUP REASON STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- CONVOCATORIA colgar RAZÓN ESTADÍSTICAS\n";
+echo "+----------------------+------------+\n";
+echo "| HANGUP REASON        | CALLS      |\n";
+echo "+----------------------+------------+\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) {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 RESPUESTA           ';}
+	if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
+
+	echo "| $reason | $REASONcount |\n";
+
+	$i++;
+	}
+
+$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+
+echo "+----------------------+------------+\n";
+echo "| TOTAL:               | $TOTALcalls |\n";
+echo "+----------------------+------------+\n";
+
+
+
+
+
 ##############################
 #########  CALL STATUS STATS
 
@@ -244,36 +472,25 @@ $TOTALcalls = 0;
 
 echo "\n";
 echo "---------- CALL STATUS STATS\n";
-echo "+--------+----------------------+------------+\n";
-echo "| STATUS | DESCRIPTION          | CALLS      |\n";
-echo "+--------+----------------------+------------+\n";
+echo "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
+echo "|        |                      |                      |            |      CALL TIME                   |AGENTE TIME|\n";
+echo "| STATUS | DESCRIPTION          | CATEGORÍA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
 
-$stmt="SELECT * from vicidial_statuses order by status";
+
+## 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' $group_SQLand and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
 $rslt=mysql_query($stmt, $link);
-$statuses_to_print = mysql_num_rows($rslt);
-$statuses_list='';
-
-$o=0;
-while ($statuses_to_print > $o) 
+$Ctally_to_print = mysql_num_rows($rslt);
+if ($Ctally_to_print > 0) 
 	{
 	$rowx=mysql_fetch_row($rslt);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
+	$AGENTsec = "$rowx[0]";
 	}
 
-$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' 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);
-	$statname_list["$rowx[0]"] = "$rowx[1]";
-	$o++;
-	}
-
-$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+## get counts and time totals for all statuses in this campaign
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END'  $group_SQLand group by status;";
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -283,34 +500,180 @@ while ($i < $statuses_to_print)
 	{
 	$row=mysql_fetch_row($rslt);
 
-	$TOTALcalls = ($TOTALcalls + $row[0]);
+	$STATUScount =	$row[0];
+	$RAWstatus =	$row[1];
+	$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 + $row[0]);
+	$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );
+		$STATUSrate =	sprintf("%.2f", $STATUSrate);
+	$AGENTrate =	($STATUScount / ($AGENTsec / 3600) );
+		$AGENTrate =	sprintf("%.2f", $AGENTrate);
+
+	$STATUShours_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
 
 	$STATUScount =	sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
-	$RAWstatus = $row[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);}
+	$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);}	
+		$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');}	
+		$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 | $STATUScount |\n";
+	echo "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
 
 	$i++;
 	}
 
-$TOTALcalls =		sprintf("%10s", $TOTALcalls);
+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_H =	($AGENTsec / 3600);
+	$aTOTALhours_H_int = round($aTOTALhours_H, 2);
+	$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
+	$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
+	$aTOTALhours_M = ($aTOTALhours_M * 60);
+	$aTOTALhours_M_int = round($aTOTALhours_M, 2);
+	$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
+	$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
+	$aTOTALhours_S = ($aTOTALhours_S * 60);
+	$aTOTALhours_S = round($aTOTALhours_S, 0);
+	if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
+	if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
+	$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
+
+	$TOTALhours_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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);}
+
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+echo "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |          |\n";
+echo "|   AGENTE TIME                                                      | $aTOTALhours |                     | $aTOTALrate |\n";
+echo "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
+
+
+
+##############################
+#########  STATUS CATEGORY STATS
+
+echo "\n";
+echo "---------- CUSTOM STATUS CATEGORÍA STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| CATEGORÍA             | 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";
 
-echo "+--------+----------------------+------------+\n";
-echo "| TOTAL:                        | $TOTALcalls |\n";
-echo "+-------------------------------+------------+\n";
 
 
 ##############################
@@ -327,7 +690,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| AGENTE                    | CALLS      | TIME M   | AVRG M |\n";
 echo "+--------------------------+------------+----------+--------+\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' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
+$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) {echo "$stmt\n";}
@@ -354,8 +717,8 @@ while ($i < $users_to_print)
 	$USERavgTALK =	$row[4];
 
 	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
 	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
 	$USERtotTALK_S = ($USERtotTALK_S * 60);
 	$USERtotTALK_S = round($USERtotTALK_S, 0);
@@ -364,8 +727,8 @@ while ($i < $users_to_print)
 	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
 
 	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
 	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
 	$USERavgTALK_S = ($USERavgTALK_S * 60);
 	$USERavgTALK_S = round($USERavgTALK_S, 0);
@@ -382,8 +745,8 @@ if (!$TOTcalls) {$TOTcalls = 1;}
 $TOTavg = ($TOTtime / $TOTcalls);
 $TOTavg = round($TOTavg, 0);
 $TOTavg_M = ($TOTavg / 60);
-$TOTavg_M = round($TOTavg_M, 2);
-$TOTavg_M_int = intval("$TOTavg_M");
+$TOTavg_M_int = round($TOTavg_M, 2);
+$TOTavg_M_int = intval("$TOTavg_M_int");
 $TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
 $TOTavg_S = ($TOTavg_S * 60);
 $TOTavg_S = round($TOTavg_S, 0);
@@ -392,8 +755,8 @@ $TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
 $TOTavg =		sprintf("%6s", $TOTavg_MS);
 
 $TOTtime_M = ($TOTtime / 60);
-$TOTtime_M = round($TOTtime_M, 2);
-$TOTtime_M_int = intval("$TOTtime_M");
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
 $TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
 $TOTtime_S = ($TOTtime_S * 60);
 $TOTtime_S = round($TOTtime_S, 0);
@@ -406,15 +769,15 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {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_M_int = round($AVGwait_M, 2);
+$AVGwait_M_int = intval("$AVGwait_M_int");
 $AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
 $AVGwait_S = ($AVGwait_S * 60);
 $AVGwait_S = round($AVGwait_S, 0);
@@ -442,14 +805,14 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -457,42 +820,42 @@ while ($i <= 96)
 	$i++;
 
 
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -643,5 +1006,6 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php index 5969cfd1..85273d71 100644 --- a/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_VICIDIAL_hopperlist.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat @@ -126,7 +126,7 @@ echo "Total de Leads en el hopper ahora mismo: $TOTALcalls\n"; echo "\n"; echo "---------- LEADS IN HOPPER\n"; echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -echo "|ORDER |PRIORITY| LEAD ID | ID DE LA LISTA | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "|ORDER |PRIORIDAD| LEAD ID | ID DE LA 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.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; diff --git a/LANG_www/vicidial_es/AST_admin_log_display.php b/LANG_www/vicidial_es/AST_admin_log_display.php index f7936b12..c0cf6161 100644 --- a/LANG_www/vicidial_es/AST_admin_log_display.php +++ b/LANG_www/vicidial_es/AST_admin_log_display.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_admin_log_display.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); @@ -106,7 +106,7 @@ echo "\n\n"; echo "
\n\n";
 
 
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
+echo "VICIDIAL ADMIN Change Log                             $NOW_TIME\n";
 
 #passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
 passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
diff --git a/LANG_www/vicidial_es/AST_agent_days_detail.php b/LANG_www/vicidial_es/AST_agent_days_detail.php
new file mode 100644
index 00000000..1e3d3300
--- /dev/null
+++ b/LANG_www/vicidial_es/AST_agent_days_detail.php
@@ -0,0 +1,601 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 90206-2202 - First build
+# 90225-1051 - Added CSV download option
+# 90310-0752 - Added admin header
+#
+
+
+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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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 "Nombre y contraseña inválidos del usuario: |$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 "VICIDIAL: Agent Situación días\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 SELECCIONE UN USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK 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 "VICIDIAL: Agent Days Detalle: $user                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENTE Detalles -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Days Detalle: $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 "CALL 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Fechas:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campañas:
"; +echo "\n"; +echo "
Usuario:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " DESCARGAR | \n"; + echo " USER | \n"; + echo " USER STATS | \n"; + } +else + {echo " USUARIOS | \n";} +echo "INFORMES \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/LANG_www/vicidial_es/AST_agent_performance.php b/LANG_www/vicidial_es/AST_agent_performance.php
index 220a5be5..7511643d 100644
--- a/LANG_www/vicidial_es/AST_agent_performance.php
+++ b/LANG_www/vicidial_es/AST_agent_performance.php
@@ -1,8 +1,8 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance.php
+# 
+# Copyright (C) 2008  Matt Florell     LICENSE: AGPLv2
+#
 # CHANGES
 #
 # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
@@ -127,7 +127,7 @@ if ($shift == 'PM')
 echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
+echo "---------- AGENTS Detalles -------------\n\n";
 
 echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
diff --git a/LANG_www/vicidial_es/AST_agent_performance_detail.php b/LANG_www/vicidial_es/AST_agent_performance_detail.php
index bce7e506..f10e0cc5 100644
--- a/LANG_www/vicidial_es/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_es/AST_agent_performance_detail.php
@@ -1,13 +1,21 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance_detail.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,28 +25,53 @@ $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["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
+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["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["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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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];
+$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))
 	{
@@ -48,14 +81,15 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     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;";
-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);
@@ -67,7 +101,6 @@ while ($i < $campaigns_to_print)
 	$i++;
 	}
 $stmt="select user_group from vicidial_user_groups;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $user_groups_to_print = mysql_num_rows($rslt);
@@ -93,9 +126,18 @@ while ($i < $user_groups_to_print)
 
 \n";
-echo "VICIDIAL: Agent Performance\n";
+echo "VICIDIAL: Agent Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + echo "
\n"; -echo "\n"; +echo "\n"; +echo "\n"; +echo " to \n"; echo "
+ \ No newline at end of file diff --git a/LANG_www/vicidial_es/AST_agent_status_detail.php b/LANG_www/vicidial_es/AST_agent_status_detail.php new file mode 100644 index 00000000..7b76d46b --- /dev/null +++ b/LANG_www/vicidial_es/AST_agent_status_detail.php @@ -0,0 +1,665 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# + + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Nombre y contraseña inválidos del usuario: |$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++; + } +$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 + { + $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 "VICIDIAL: Agent Situación días\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 SELECCIONE UNA CAMPAÑA O GRUPO DE USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK 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 "VICIDIAL: Agent Status Detalle                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENTE Detalles -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Status Detalle                     $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) )
+			{
+			$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 "CALL 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=$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 ( ($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 |";
+				}
+			### 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Fechas:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campañas:
"; +echo "\n"; +echo "
Grupos De Usuario:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " DESCARGAR | \n"; +echo " INFORMES \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/LANG_www/vicidial_es/AST_agent_time_sheet.php b/LANG_www/vicidial_es/AST_agent_time_sheet.php
index 0c562ea2..49afbb5b 100644
--- a/LANG_www/vicidial_es/AST_agent_time_sheet.php
+++ b/LANG_www/vicidial_es/AST_agent_time_sheet.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
-###
+# AST_agent_time_sheet.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,13 +19,15 @@ $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"];}
+	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"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["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);
@@ -62,15 +66,36 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 \n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "VICIDIAL ADMIN: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Modificar Usuario\n";
+echo "VICIDIAL: Agent Hoja de tiempo";
+
+
+##### 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 "AgentHoja de tiempofor: $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 "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
+echo "Usuario 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";
 
@@ -97,7 +122,7 @@ if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $full_name = $row[0];
 
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
+echo "VICIDIAL: AgentHoja de tiempo                            $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n";
@@ -277,6 +302,104 @@ $login_time = ($end - $start);
 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 TIEMPO 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> FECHA</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 = ($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><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_int:$event_minutes_int";
+			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 = ($total_login_time / 3600);
+$total_login_hours_int = round($total_login_hours, 2);
+$total_login_hours_int = intval("$total_login_hours_int");
+$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";}
+
+	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_int:$total_login_minutes_int  </td></tr>\n";
+
+echo "</TABLE>\n";
+
+
+
 }
 
 
diff --git a/LANG_www/vicidial_es/AST_inboundEXTstats.php b/LANG_www/vicidial_es/AST_inboundEXTstats.php
index e85f742c..9d0a3f21 100644
--- a/LANG_www/vicidial_es/AST_inboundEXTstats.php
+++ b/LANG_www/vicidial_es/AST_inboundEXTstats.php
@@ -1,7 +1,7 @@
 <? 
 # AST_inboundEXTstats.php
 # 
-# Copyright (C) 2006  Matt Florell <vicidial@gmail.com>    LICENSE: GPLv2
+# Copyright (C) 2008  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
 #
 # CHANGES
 # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
@@ -76,7 +76,7 @@ while ($i < $inbound_to_print)
  </STYLE>
 
 <? 
-echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
+echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
 #echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
 echo "<TITLE>ASTERISK: Estadística de Llamadas Entrantes\n";
 echo "
\n"; diff --git a/LANG_www/vicidial_es/AST_server_performance.php b/LANG_www/vicidial_es/AST_server_performance.php index 064b65f4..d3c2574a 100644 --- a/LANG_www/vicidial_es/AST_server_performance.php +++ b/LANG_www/vicidial_es/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,8 @@ # - 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 # require("dbconnect.php"); @@ -16,8 +18,6 @@ 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["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"];} @@ -54,9 +54,8 @@ $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($begin_query_time)) {$begin_query_time = '09:00:00';} -if (!isset($end_query_time)) {$end_query_time = '15:30:00';} +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;"; @@ -85,11 +84,18 @@ while ($i < $servers_to_print) \n"; -echo "VICIDIAL: Server Performance\n"; +echo "VICIDIAL: Server Performance\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + + echo "\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; +echo "Date/Time Range: \n"; +echo "to \n"; echo "Server:
+ \ No newline at end of file diff --git a/LANG_www/vicidial_es/AST_timeonVDAD.php b/LANG_www/vicidial_es/AST_timeonVDAD.php index b9024460..f38d7769 100644 --- a/LANG_www/vicidial_es/AST_timeonVDAD.php +++ b/LANG_www/vicidial_es/AST_timeonVDAD.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonVDAD.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # live real-time stats for the VICIDIAL Auto-Dialer # # CHANGES @@ -10,6 +10,9 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -110,8 +113,15 @@ if ($closer_display>0) \n"; echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
+echo "VICIDIAL: Time On VDAD\n";
+
+$short_header=1;
+
+require("admin_header.php");
+
+echo "
"; + +echo "
";
 
 ###################################################################################
 ###### SERVER INFORMATION
@@ -137,15 +147,15 @@ echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    0)
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 }
 else
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+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;";
@@ -158,18 +168,77 @@ $talking_to_print = mysql_num_rows($rslt);
 	while ($i < $talking_to_print)
 		{
 		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
+		$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])) 
 			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('R/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
 			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
+		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", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
+		$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) )
 			{
@@ -177,8 +246,8 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cc[$i]++;
 			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
 			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
+		$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) )
 			{
@@ -186,10 +255,10 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cd[$i]++;
 			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
 			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
+		$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);
@@ -206,7 +275,7 @@ $talking_to_print = mysql_num_rows($rslt);
 			$G = '';		$EG = '';
 			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
+			if (eregi("PAUSED",$Sstatus[$i])) 
 				{
 				if ($call_time_M_int >= 1) 
 					{$i++; continue;} 
@@ -214,7 +283,7 @@ $talking_to_print = mysql_num_rows($rslt);
 					{$G=''; $EG='';}
 				}
 			$agentcount++;
-			echo "| $G$extension[$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";
+			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++;
 		}
@@ -259,18 +328,18 @@ $talking_to_print = mysql_num_rows($rslt);
 		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
 
-			echo "| $G$extension[$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";
+			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 "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 		echo "  $i agentes identificados en el servidor $server_ip\n\n";
 	#	echo "             - Llamadas de 5 minutos o más\n";
 	#	echo "             - Sobre 10 minutos en llamada\n";
 		}
 	else
 		{
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
 		echo "  $agentcount agentes identificados en el servidor $server_ip\n\n";
 
 		echo "             - Agentes detenidos brevemente\n";
@@ -370,5 +439,6 @@ $parked_to_print = mysql_num_rows($rslt);
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_es/AST_timeonVDADall.php b/LANG_www/vicidial_es/AST_timeonVDADall.php index c625746e..f4d26c54 100644 --- a/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -1,826 +1,1662 @@ - LICENSE: GPLv2 -# -# 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 (Chris Doyle) -# 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 -# - -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["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -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($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} -if (!isset($usergroup)) {$usergroup='';} -if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes -if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name -if (!isset($orderby)) {$orderby='timeup';} -if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes - -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]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $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); - - -$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 "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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++; - } - -$stmt="select * from vicidial_user_groups;"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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=''; - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaña: $group\n"; -echo "\n"; -echo "VICIDIAL Campaña: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -if ($UGdisplay > 0) - { - echo "\n"; - } -echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       MODIFICAR | \n"; -echo "SUMMARY | \n"; -echo "INFORMES \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $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) from vicidial_campaigns;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select count(*) from vicidial_hopper;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="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),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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) . "';"; -if ($group=='XXXX-ALL-ACTIVE-XXXX') - { - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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 LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX LEVEL:  $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     DIAL METHOD:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "
"; - -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -if ($UGdisplay>0) - { - echo "       PIEL USER GROUP"; - } -else - { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       DEMOSTRACIÓN AGENTE ID"; - } -else - { - echo "       DEMOSTRACIÓN AGENTE NAME"; - } -if ($SERVdisplay>0) - { - echo "       PIEL SERVIDOR INFO"; - } -else - { - echo "       DEMOSTRACIÓN SERVIDOR INFO"; - } -echo "
"; - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if ($campaign_allow_inbound > 0) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} - $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;"; - } -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - 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"; - } - else - { - echo "LLAMADAS EN ESPERA\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaña: $group $NOW_TIME\n\n"; - - -$HDbegin = "+"; -$HTbegin = "|"; -$HDstation = "------------+"; -$HTstation = " STATION |"; -$HDuser = "--------------------+"; -$HTuser = " USER |"; -$HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; -$HDsessionid = "------------------+"; -$HTsessionid = " SESSIONID |"; -$HDbarge = "-------+"; -$HTbarge = " BARGE |"; -$HDstatus = "----------+"; -$HTstatus = " STATUS |"; -$HDserver_ip = "-----------------+"; -$HTserver_ip = " SERVIDOR IP |"; -$HDcall_server_ip = "-----------------+"; -$HTcall_server_ip = " CALL SERVIDOR IP |"; -$HDtime = "---------+"; -$HTtime = " MM:SS |"; -$HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; - -if ($UGdisplay < 1) - { - $HDusergroup = ''; - $HTusergroup = ''; - } -if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) - { - $HDsessionid = "-----------+"; - $HTsessionid = " SESSIONID |"; - } -if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) - { - $HDbarge = ''; - $HTbarge = ''; - } -if ($SERVdisplay < 1) - { - $HDserver_ip = ''; - $HTserver_ip = ''; - $HDcall_server_ip = ''; - $HTcall_server_ip = ''; - } - - - -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; -$Aecho .= "$Aline"; -$Aecho .= "$Bline"; -$Aecho .= "$Aline"; - -if ($orderby=='timeup') {$orderSQL='status,last_call_time';} -if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} -if ($orderby=='campaignup') {$orderSQL='campaign_id,status,last_call_time';} -if ($orderby=='campaigndown') {$orderSQL='campaign_id desc,status desc,last_call_time desc';} -if ($orderby=='groupup') {$orderSQL='user_group,status,last_call_time';} -if ($orderby=='groupdown') {$orderSQL='user_group desc,status desc,last_call_time 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 ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} -if (strlen($usergroup)<1) {$usergroupSQL = '';} -else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} - -$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - -#$stmt="select extension,vicidial_live_agents.user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id,vicidial_users.user_group,vicidial_users.full_name from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and campaign_id='" . mysql_real_escape_string($group) . "' order by $orderSQL;"; - -if ($non_latin > 0) -{ -$rslt=mysql_query("SET NAMES 'UTF8'"); -} -$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]; - } - if ($non_latin < 1) - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - } - else - { - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-40s", $extension); - while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} - } - $Luser = $row[1]; - $user = sprintf("%-18s", $row[1]); - $Lsessionid = $row[2]; - $sessionid = sprintf("%-9s", $row[2]); - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $comments= $row[11]; - - if (eregi("INCALL",$Lstatus)) - { - if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) - {$CM='A';} - else - { - if (eregi("INBOUND",$comments)) - {$CM='I';} - else - {$CM='M';} - } - } - else {$CM=' ';} - - if ($UGdisplay > 0) - { - if ($non_latin < 1) - { - $user_group = sprintf("%-12s", $row[9]); - while(strlen($user_group)>12) {$user_group = substr("$user_group", 0, -1);} - } - else - { - $user_group = sprintf("%-40s", $row[9]); - 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("%-18s", $row[10]); - while(strlen($user)>18) {$user = substr("$user", 0, -1);} - } - else - { - $user = sprintf("%-40s", $row[10]); - while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} - } - } - 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 ($Lstatus=='INCALL') - { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - } - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - $G=''; $EG=''; - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$G=''; $EG='';} - } - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$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_M_int >= 1) {$G=''; $EG='';} - if ($call_time_M_int >= 5) {$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 ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} - else {$UGD = "";} - - if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} - else {$SVD = "";} - - $agentcount++; - - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "$Aline"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load 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"; - - 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 "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "AGENTES SIN LLAMADAS\n";
-	}
-
-?>
-
- - + 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 +# + +$version = '2.0.5-36'; +$build = '90310-0906'; + +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["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["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} + +############################################# +##### 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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +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=0;} # 0=id, 1=name +if (!isset($orderby)) {$orderby='timeup';} +if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 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='N';} # 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]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $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); + + +$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 "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DAY = date("Y-m-d"); +$NOW_HOUR = date("H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id,campaign_name 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; + $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++; + } +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)"; + } + +#if ( (eregi('ALL-ACTIVE',$group_string)) and ($with_inbound=='O') and ($outbound_autodial_active > 0) ) +# {$with_inbound='N';} + +$stmt="select * 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_list .= ""; +$select_list .= "
Select Campañas:
"; +$select_list .= ""; +$select_list .= "
(Para seleccionar más de 1 campaña, mantenga pulsada la tecla Ctrl y haga clic en)"; +$select_list .= "
"; +$select_list .= "Panel de Cierre

"; + +if ($UGdisplay > 0) + { + $select_list .= "Select Grupo Del Usuario:
"; + $select_list .= "

"; + } + +$select_list .= "   Inbound:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "VERSIÓN: $version   CONSTRUCCION: $build"; +$select_list .= "
"; + +$open_list = "
Elija Opciones de Informe
"; + +?> + + + + + + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id IN($group_SQL) and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Campaña: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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 "VICIDIAL Tiempo Real                                                                          \n"; +echo "\n"; +echo "
\n"; +echo "Elija Opciones de Informe"; +echo "
\n"; +echo "
\n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       MODIFICAR | \n"; + } +else + { + echo "       MODIFICAR | \n"; + } +echo "SUMMARY \n"; +echo "\n\n"; + + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$multi_drop=0; + +##### INBOUND ONLY ### +if (ereg('O',$with_inbound)) + { + $multi_drop++; + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + if ($adastats>1) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_RESPUESTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RESPUESTAagent_non_pause_sec = round($AVG_RESPUESTAagent_non_pause_sec, 2); + $AVG_RESPUESTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RESPUESTAagent_non_pause_sec); + } + else + {$AVG_RESPUESTAagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_RESPUESTAagent_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  
RESPUESTAS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + + } + + $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);"; + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + + + if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";} + + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_pause_codes_active = $row[0]; + + $rslt=mysql_query($stmtC, $link); + $row=mysql_fetch_row($rslt); + $agent_non_pause_sec = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_RESPUESTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RESPUESTAagent_non_pause_sec = round($AVG_RESPUESTAagent_non_pause_sec, 2); + $AVG_RESPUESTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RESPUESTAagent_non_pause_sec); + } + else + {$AVG_RESPUESTAagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_RESPUESTAagent_non_pause_sec=0; + } + + 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 ""; + } + +##### NOT INBOUND ONLY ### +else + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $multi_drop++; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; + + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; + } + else + { + if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} + + if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) + { + $multi_drop++; + $stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $c=0; + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active 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) 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]; + $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); + $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); + $agent_pause_codes_active = $row[19]; + + + $stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select count(*) from vicidial_hopper;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDhop = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $DAleads = $row[0]; + $callsTODAY = $row[1]; + $dropsTODAY = $row[2]; + $drpctTODAY = $row[3]; + $diffONEMIN = $row[4]; + $agentsONEMIN = $row[5]; + $balanceFILL = $row[6]; + $answersTODAY = $row[7]; + if ($multi_drop > 0) + { + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + } + $VSCcat1 = $row[8]; + $VSCcat1tally = $row[9]; + $VSCcat2 = $row[10]; + $VSCcat2tally = $row[11]; + $VSCcat3 = $row[12]; + $VSCcat3tally = $row[13]; + $VSCcat4 = $row[14]; + $VSCcat4tally = $row[15]; + + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } + else {$diffpctONEMIN = '0.00';} + + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $balanceSHORT = $row[0]; + + 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  
RESPUESTAS TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_RESPUESTAagent_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 ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL NIVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX NIVEL:  $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     DIAL MÉTODO:  $DIALmethod    
HOPPER NIVEL:  $HOPlev     DROPPED / RESPUESTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "       PIEL GRUPO DE USUARIOS"; + } +else + { + echo "       VIEW GRUPO DE USUARIOS"; + } +if ($UidORname>0) + { + echo "       DEMOSTRACIÓN AGENTE ID"; + } +else + { + echo "       DEMOSTRACIÓN AGENTE NAME"; + } +if ($SERVdisplay>0) + { + echo "       PIEL SERVIDOR INFO"; + } +else + { + echo "       DEMOSTRACIÓN SERVIDOR INFO"; + } +if ($CALLSdisplay>0) + { + echo "       PIEL WAITING CALLS"; + } +else + { + echo "       DEMOSTRACIÓN WAITING CALLS"; + } +if ($PHONEdisplay>0) + { + echo "       PIEL PHONES"; + } +else + { + echo "       DEMOSTRACIÓN PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       PIEL CUSTPHONES"; + } +else + { + echo "       DEMOSTRACIÓN CUSTPHONES"; + } +echo "
"; + +echo "\n\n"; +} +################################################################################### +###### INBOUND/OUTBOUND CALLS +################################################################################### +if ($campaign_allow_inbound > 0) + { + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $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); + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; + } +else + { + if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} + else {$UgroupSQL = " and campaign_id IN($group_SQL)";} + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;"; + } +if ($CALLSdisplay > 0) + { + $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority"; + } +else + { + $stmtA = "SELECT status"; + } + + +$k=0; +$stmt = "$stmtA $stmtB"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + $in_ivr=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + { + $out_live++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + else + { + if (eregi("IVR",$row[0])) + { + $in_ivr++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + + $out_total++; + $i++; + } + + ##### MIDI alert audio file test ##### + # $test_midi=1; + # if ($test_midi > 0) + # { + # # echo ""; + # # echo ""; + # 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 "LLAMADAS EN ESPERA\n"; + } + + + +################################################################################### +###### CALLS WAITING +################################################################################### + +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDAD |\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-12s", $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]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_M = ($Ccall_time_S / 60); + $Ccall_time_M = round($Ccall_time_M, 2); + $Ccall_time_M_int = intval("$Ccall_time_M"); + $Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int); + $Ccall_time_SEC = ($Ccall_time_SEC * 60); + $Ccall_time_SEC = round($Ccall_time_SEC, 0); + if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";} + $Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC"; + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + $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 |\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: Agents Time On Calls Campaña: $group_string $NOW_TIME\n"; + + +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "------------+"; +$HTstation = " STATION |"; +$HDphone = "------------+"; +$HTphone = " PHONE |"; +$HDuser = "--------------------+"; +$HTuser = " USER |"; +$HDusergroup = "--------------+"; +$HTusergroup = " GRUPO DE USUARIOS |"; +$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 = " CAMPAIGN |"; +$HDcalls = "-------+"; +$HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; + +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) && ($IAXmonitorLINK<1) ) + { + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; + } +if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) + { + $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\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\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 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]; + + $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'"; + } + + $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]=$Acall_finish[$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("%-10s", $extension); + while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} + } + else + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-40s", $extension); + while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} + } + + $phone = sprintf("%-10s", $phone_split[0]); + $custphone = sprintf("%-10s", $custphone); + $Luser = $Auser[$i]; + $user = sprintf("%-18s", $Auser[$i]); + $Lsessionid = $Asessionid[$i]; + $sessionid = sprintf("%-9s", $Asessionid[$i]); + $Lstatus = $Astatus[$i]; + $status = sprintf("%-6s", $Astatus[$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)) + { + ### temporarily deactivate DEAD calls display until bug is fixed + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } + + if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) + {$CM='A';} + else + { + if (eregi("Entrantes",$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("%-18s", $Afull_name[$i]); + while(strlen($user)>18) {$user = substr("$user", 0, -1);} + } + else + { + $user = sprintf("%-40s", $Afull_name[$i]); + while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} + } + } + if (!eregi("INCALL|QUEUE",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Acall_finish[$i]);} + else + {$call_time_S = ($STARTtime - $Acall_time[$i]);} + + $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 ($Lstatus=='INCALL') + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$G=''; $EG='';} + # if ($call_time_M_int >= 10) {$G=''; $EG='';} + } + if ($Lstatus=='DEAD') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_dead++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + } + } + if ($Lstatus=='DISPO') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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)) ) {$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_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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 ($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 campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' 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[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 .= " Sistema de carga 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 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 muertos en las llamadas      \n"; + + echo "
";
+		echo "";
+		echo "$Cecho";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo "AGENTES SIN LLAMADAS\n";
+	echo "
$Cecho";
+	}
+
+?>
+
+
+ + diff --git a/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php index 4a45a5b6..b887cc79 100644 --- a/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -13,6 +13,8 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -104,7 +106,14 @@ if (!isset($RR)) {$RR=4;} \n"; -echo "VICIDIAL: Realtime All Campañas Summary\n"; +echo "VICIDIAL: Realtime All Campañas Summary\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "\n"; + $RANKcampaigns_list="\n"; $o=0; while ($campaigns_to_print > $o) @@ -1522,30 +2114,40 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($campaigns_to_print > $o) { - $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$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]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else - {$calls_today=0; $SELECT_campaign_rank=0;} + {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { 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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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); } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $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); } @@ -1600,8 +2202,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $RANKcampaigns_list .= ">$h"; $h--; } + if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) ) + {$campaign_web=$group_web_vars;} $RANKcampaigns_list .= "\n"; - $RANKcampaigns_list .= "\n"; + $RANKcampaigns_list .= "\n"; + $RANKcampaigns_list .= "\n"; $o++; } ##### END get campaigns listing for rankings ##### @@ -1609,7 +2214,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD ##### BEGIN get inbound groups listing for checkboxes ##### $xfer_groupsSQL=''; - if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) + 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); @@ -1659,12 +2264,13 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $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="\n"; + $RANKgroups_list="\n"; $o=0; while ($groups_to_print > $o) @@ -1678,14 +2284,17 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($groups_to_print > $o) { - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$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]; + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else {$calls_today=0; $SELECT_group_rank=0;} @@ -1693,15 +2302,23 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { 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' where group_id='$group_id_values[$o]' and user='$user';"; + $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); } 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';"; + $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); } @@ -1741,7 +2358,12 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD } $p++; } - $groups_list .= "> $group_id_values[$o] - $group_name_values[$o]
\n"; + $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 .= "> $group_id_values[$o] - $group_name_values[$o] - $VIG_priority
\n"; $XFERgroups_list .= "> $group_id_values[$o] - $group_name_values[$o]
\n"; $RANKgroups_list .= "> $group_id_values[$o] - $group_name_values[$o] "; $RANKgroups_list .= "\n"; - $RANKgroups_list .= "\n"; + $RANKgroups_list .= "\n"; + $RANKgroups_list .= "\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} @@ -1769,16 +2394,26 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) ) { - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';"; + $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]; + $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='4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_list.=" CHECKED"; $campaigns_value .= " -ALL-CAMPAIGNS- -"; } + if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p])) + { + $qc_campaigns_list.=" CHECKED"; + $qc_campaigns_value .= " -ALL-CAMPAIGNS- -"; + } + if (eregi('ALL-GROUPS',$qc_groups[$p])) + { + $qc_groups_list.=" CHECKED"; + $qc_groups_value .= " -ALL-GROUPS- -"; + } $p++; } $campaigns_list.="> ALL-CAMPAIGNS - LOS USUARIOS PUEDEN VISIÓN CUALQUIER CAMPAÑA
\n"; + $qc_campaigns_list.="> ALL-CAMPAIGNS - USUARIOS PUEDEN CC CUALQUIER CAMPAÑA
\n"; + $qc_groups_list.="> ALL-GROUPS - USUARIOS PUEDEN CC entrantes CUALQUIER GRUPO
\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); @@ -1802,6 +2449,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaign_id_value = $rowx[0]; $campaign_name_value = $rowx[1]; $campaigns_list .= "4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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 ""; $p++; } $campaigns_list .= "> $campaign_id_value - $campaign_name_value
\n"; + $qc_campaigns_list .= "> $campaign_id_value - $campaign_name_value
\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 .= "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) ) + 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"; @@ -1900,6 +2582,11 @@ echo "
"; + echo "VICIDIAL: Realtime All Campañas Summary           \n"; echo "STOP | "; echo "SLOW | "; @@ -201,7 +210,7 @@ $row=mysql_fetch_row($rslt); $balanceSHORT = $row[0]; echo "
"; -echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -211,7 +220,7 @@ echo ""; if ($adastats>1) { echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -229,12 +238,12 @@ echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; -echo ""; -echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -305,6 +314,7 @@ $parked_to_print = mysql_num_rows($rslt); $out_total=0; $out_ring=0; $out_live=0; + $in_ivr=0; while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); @@ -313,6 +323,8 @@ $parked_to_print = mysql_num_rows($rslt); {$out_live++;} else { + if (eregi("IVR",$row[0])) + {$in_ivr++;} if (eregi("CLOSER",$row[0])) {$nothing=1;} else @@ -334,6 +346,7 @@ $parked_to_print = mysql_num_rows($rslt); 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 { @@ -438,5 +451,6 @@ $k++; ?> +
DIAL LEVEL:  $DIALlev    DIAL NIVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  MAX LEVEL:  $maxDIALlev     MAX NIVEL:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL METHOD:  $DIALmethod     DIAL MÉTODO:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   HOPPER NIVEL:  $HOPlev     DROPPED / RESPUESTAED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
diff --git a/LANG_www/vicidial_es/AST_timeonpark.php b/LANG_www/vicidial_es/AST_timeonpark.php index c48ee38c..676e281b 100644 --- a/LANG_www/vicidial_es/AST_timeonpark.php +++ b/LANG_www/vicidial_es/AST_timeonpark.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonpark.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60620-1042 - Added variable filtering to eliminate SQL injection attack threat diff --git a/LANG_www/vicidial_es/admin.php b/LANG_www/vicidial_es/admin.php index 5fa5509c..a22d7a12 100644 --- a/LANG_www/vicidial_es/admin.php +++ b/LANG_www/vicidial_es/admin.php @@ -1,14 +1,11 @@ LICENSE: GPLv2 # - +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# require("dbconnect.php"); - ###################################################################################################### ###################################################################################################### ####### static variable settings for display options @@ -16,7 +13,7 @@ require("dbconnect.php"); ###################################################################################################### $page_width='770'; -$section_width='720'; +$section_width='750'; $header_font_size='3'; $subheader_font_size='2'; $subcamp_font_size='2'; @@ -32,22 +29,16 @@ $scripts_color = '#99FFCC'; $filters_color = '#CCCCCC'; $admin_color = '#FF99FF'; $reports_color = '#99FF33'; -#$users_color = '#FFFF99'; -#$campaigns_color = '#FFFF99'; -#$lists_color = '#FFFF99'; -#$ingroups_color = '#FFFF99'; -#$remoteagent_color ='#FFFF99'; -#$usergroups_color = '#FFFF99'; -#$scripts_color = '#FFFF99'; -#$filters_color = '#FFFF99'; -#$admin_color = '#FFFF99'; -#$reports_color = '#FFFF99'; $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'; +$subcamp_color = '#FF9933'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -64,9 +55,32 @@ $reports_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; $status_font = 'BLACK'; -$subcamp_color = '#FF9933'; $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'; +$subcamp_color = '#C6C6C6'; +### + + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -178,6 +192,8 @@ if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec 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"];} @@ -292,8 +308,8 @@ if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seco 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_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} +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"];} @@ -428,8 +444,8 @@ 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["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} +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"];} @@ -472,6 +488,8 @@ if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["update 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"];} @@ -570,7 +588,8 @@ if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["ca 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["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"];} @@ -669,6 +688,272 @@ 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($script_id)) {$script_id= strtoupper($script_id);} @@ -680,6 +965,26 @@ if (strlen($dial_status) > 0) $status = $dial_status; } +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,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]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -750,7 +1055,6 @@ $delete_users = ereg_replace("[^0-9]","",$delete_users); $dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); $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); @@ -782,7 +1086,6 @@ $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); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); $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); @@ -807,10 +1110,49 @@ $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); + +### 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("[^\n0-9]","",$phone_numbers); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -818,24 +1160,39 @@ $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); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); $selectable = ereg_replace("[^NY]","",$selectable); $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$use_campaign_dnc = ereg_replace("[^NY]","",$use_campaign_dnc); $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); -$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $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); +$disable_alter_custphone = ereg_replace("[^NY]","",$disable_alter_custphone); +$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); + +$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); + ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -853,10 +1210,19 @@ $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_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); $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); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -866,6 +1232,7 @@ $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); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -913,8 +1280,8 @@ $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); +$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); @@ -940,11 +1307,61 @@ $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); +$hold_time_option_callback_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_option_callback_filename); +$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); + +### 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 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); @@ -954,6 +1371,7 @@ $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); @@ -977,6 +1395,15 @@ $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); ### 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); @@ -994,15 +1421,36 @@ $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pas $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); +$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); + +### 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); + +### 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); +$globals_string = ereg_replace(";","",$globals_string); +$dialplan_entry = ereg_replace(";","",$dialplan_entry); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url # $admin_home_url +# $qc_web_form_address +# $vtiger_url ### VARIABLES not filtered at all ### # $script_text @@ -1141,17 +1589,74 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 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 # -# # 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.0.4-119'; -$build = '71125-1751'; +$admin_version = '2.0.5-172'; +$build = '90310-2203'; $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); @@ -1169,11 +1674,28 @@ if ($force_logout) exit; } - $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); +############################################# +##### 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); - $auth=$row[0]; + $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 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");} @@ -1196,46 +1718,50 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * 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[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]; + $stmt="SELECT * 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]; - $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]; + $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|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); } } @@ -1272,18 +1798,25 @@ if ($ADD==111) {$hh='lists'; echo "Añadir una Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} if ($ADD==1111) {$hh='ingroups'; echo "Añadir un Grupo-Entrantes";} if ($ADD==1211) {$hh='ingroups'; echo "En-Grupo Del Copy";} +if ($ADD==1311) {$hh='ingroups'; echo "Agregar nuevoDID";} +if ($ADD==1411) {$hh='ingroups'; echo "CopiarDID";} if ($ADD==11111) {$hh='remoteagent'; echo "Añadir Agentes Remotos";} if ($ADD==111111) {$hh='usergroups'; echo "Añadir un Grupo De Usuarios";} if ($ADD==1111111) {$hh='scripts'; echo "Agregue La Nueva Escritura";} if ($ADD==11111111) {$hh='filters'; echo "Agregue El Filtro Nuevo";} if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Agregue El Nuevo Tiempo De la Llamada";} +if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Añadir nuevo Mayúsculas";} if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Agregue El Nuevo Tiempo De la Llamada Del Estado";} if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "NUEVO TELÉFONO";} +if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "Añadir nuevo teléfono ALIAS";} +if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "Añadir NUEVO GRUPO DE ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NUEVO SERVIDOR";} +if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Añadir CONF NUEVA PLANTILLA";} +if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Añadir nueva compañía";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NUEVA CONFERENCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD=="2") {$hh='users'; echo "Nueva Adición De Usuario";} -if ($ADD=="2A") {$hh='users'; echo "Nueva Adición Copiada Del Usuario";} +if ($ADD=='2') {$hh='users'; echo "Nueva Adición De Usuario";} +if ($ADD=='2A') {$hh='users'; echo "Nueva Adición Copiada Del Usuario";} if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Nueva Adición Copiada De la Campaña";} if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Nueva Adición De la Campaña";} if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Nueva Adición Del Estado De la Campaña";} @@ -1296,34 +1829,55 @@ if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la if ($ADD==211) {$hh='lists'; echo "Nueva Adición De la Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Nueva Adición Del Grupo de Entrantes";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} +if ($ADD==2311) {$hh='ingroups'; echo "Nueva DID adjunta";} +if ($ADD==2411) {$hh='ingroups'; echo "Nueva copiado DID adjunta";} if ($ADD==21111) {$hh='remoteagent'; echo "Nueva Adición de Agentes Remotos";} if ($ADD==211111) {$hh='usergroups'; echo "Nueva Adición Del Grupo De Usuarios";} if ($ADD==2111111) {$hh='scripts'; echo "Nueva Adición De la Escritura";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adición Del Filtro";} if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "Nueva Adición Del Tiempo De la Llamada";} +if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "Nueva Mayús adjunta";} if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "Nueva Adición Del Tiempo De la Llamada Del Estado";} if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "CREANDO TELÉFONO";} +if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "AGREGAR NUEVO TELÉFONO ALIAS";} +if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "AGREGAR NUEVO GRUPO DE ALIAS";} if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIÓN DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} +if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "AGREGAR NUEVO CONF PLANTILLA";} +if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "AGREGAR NUEVOS SOPORTES";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "CREANDO CONFERENCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADICIÓN DE ESTADOS DE SISTEMA DE VICIDIAL";} if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADICIÓN DE CATEGORÍA DEL ESTADO DE VICIDIAL";} +if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "AGREGANDO VICIDIAL QC ESTADO CÓDIGO";} if ($ADD==3) {$hh='users'; echo "Modificar Usuario";} if ($ADD==30) {$hh='campaigns'; echo "Campaña No permitida";} if ($ADD==31) - { - $hh='campaigns'; $sh='detail'; echo "Modifcar Campaña - Detail - $campaign_id"; - if ($SUB==22) {echo " - Statuses";} - if ($SUB==23) {echo " - HotKeys";} - if ($SUB==25) {echo " -El Plomo ReciclaEntries";} - if ($SUB==26) {echo " - Auto Alt Dial Statuses";} - if ($SUB==27) {echo " - Agent Pause Codes";} - if ($SUB==29) {echo " - List Mixes";} - } + { + $hh='campaigns'; $sh='detail'; echo "Modifcar Campaña - Detalle - $campaign_id"; + if ($SUB==22) {echo " - Estados";} + if ($SUB==23) {echo " - Teclas rápidas";} + if ($SUB==25) {echo " -El Plomo ReciclaEntries";} + if ($SUB==26) {echo " - Auto Alt telefónico Estados";} + if ($SUB==27) {echo " - Agent Pausa Códigos";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Mezcla listaes";} + if ($SUB=='20A') {echo " - Encuesta";} + } +if ($ADD==34) + { + $hh='campaigns'; $sh='basic'; echo "Modificar Campaña - Vista Básica - $campaign_id"; + if ($SUB==22) {echo " - Estados";} + if ($SUB==23) {echo " - Teclas rápidas";} + if ($SUB==25) {echo " -El Plomo ReciclaEntries";} + if ($SUB==26) {echo " - Auto Alt telefónico Estados";} + if ($SUB==27) {echo " - Agent Pausa Códigos";} + if ($SUB==28) {echo " - QC";} + if ($SUB==29) {echo " - Mezcla listaes";} + if ($SUB=='20A') {echo " - Encuesta";} + } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Estados De la Campaña";} -if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaña HotKeys";} -if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Modificar Campaña - Vista Básica";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaña Teclas rápidas";} if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "El Plomo De la Campaña Recicla Entradas";} if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Estados Auto Del Dial Del Alt De la Campaña";} if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos De la Pausa Del Agente De la Campaña";} @@ -1331,20 +1885,27 @@ if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la C if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} if ($ADD==311) {$hh='lists'; echo "Modificar Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modificar In-Group";} +if ($ADD==3311) {$hh='ingroups'; echo "ModificarDID";} if ($ADD==31111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} if ($ADD==311111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==3111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==31111111) {$hh='filters'; echo "Modifique El Filtro";} if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada";} if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modifique La Lista De las Definiciones Del Estado Del Tiempo De laLlamada";} +if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Modificar Mayúsculas";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL TELÉFONO";} +if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR TELÉFONO ALIAS";} +if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR GRUPO ALIAS";} if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFICAR EL SERVIDOR";} +if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "MODIFICAR CONF PLANTILLA";} +if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICAR PORTEADOR";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LOS ESTADOS DE SISTEMA DE VICIDIAL";} if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LA CATEGORÍA DEL ESTADO DE VICIDIAL";} +if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFICAR VICIDIAL CC ESTADO CÓDIGO";} if ($ADD=="4A") {$hh='users'; echo "Modificar Usuario - Admin";} if ($ADD=="4B") {$hh='users'; echo "Modificar Usuario - Admin";} if ($ADD==4) {$hh='users'; echo "Modificar Usuario";} @@ -1354,41 +1915,56 @@ if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modifcar Campaña HotKey"; if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modificar Campaña - Vista Básica";} if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la Campaña Reciclan";} if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Código De la Pausa Del Agente";} +if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modificar la campaña de CC Configuración";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} +if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificar la campaña Encuesta";} if ($ADD==411) {$hh='lists'; echo "Modificar Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modificar In-Group";} +if ($ADD==4311) {$hh='ingroups'; echo "ModificarDID";} if ($ADD==41111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} if ($ADD==411111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==4111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==41111111) {$hh='filters'; echo "Modifique El Filtro";} if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada";} +if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Modificar Mayúsculas";} if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL TELÉFONO";} +if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR TELÉFONO ALIAS";} +if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR GRUPO ALIAS";} if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "MODIFICAR EL SERVIDOR";} if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFIQUE EL EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} +if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "MODIFICAR CONF PLANTILLA";} +if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICAR PORTEADOR";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LOS ESTADOS DE SISTEMA DE VICIDIAL";} if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LAS CATEGORÍAS DEL ESTADO DE VICIDIAL";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaña";} +if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFICAR VICIDIAL CC ESTADO CÓDIGO";} +if ($ADD==5) {$hh='users'; echo "BorrarUsuario";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "BorrarCampaña";} if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Agentes Del Registro de estado de la máquina";} if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==511) {$hh='lists'; echo "BorrarList";} +if ($ADD==5111) {$hh='ingroups'; echo "BorrarIn-Group";} +if ($ADD==5311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} if ($ADD==511111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==5111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==51111111) {$hh='filters'; echo "Filtro De la Cancelación";} -if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} +if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "BorrarCall Time";} +if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Eliminar Mayúsculas";} if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelación";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "ELIMINAR TELÉFONO ALIAS";} +if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "Eliminar grupo ALIAS";} if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "ELIMINAR CONF PLANTILLA";} +if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "ELIMINAR PORTEADOR";} 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 "Delete User";} -if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaña";} +if ($ADD==6) {$hh='users'; echo "BorrarUsuario";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "BorrarCampaña";} if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Agentes Del Registro de estado de la máquina";} if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "El Plomo De la Cancelación Recicla";} @@ -1396,21 +1972,31 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Código De la Pausa Del Agente De la Cancelación";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "El Estado Del Dial De la Campaña Quitó";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quitó";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==611) {$hh='lists'; echo "BorrarList";} +if ($ADD==6111) {$hh='ingroups'; echo "BorrarIn-Group";} +if ($ADD==6311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} if ($ADD==611111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==6111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==61111111) {$hh='filters'; echo "Filtro De la Cancelación";} -if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} +if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "BorrarCall Time";} +if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Eliminar Mayúsculas";} if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelación";} if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} +if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "ELIMINAR TELÉFONO ALIAS";} +if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "Eliminar grupo ALIAS";} if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL DE LA CANCELACIÓN";} +if ($ADD==621111111111) {$hh='admin'; $sh='templates'; echo "ELIMINAR CONF PLANTILLA";} +if ($ADD==621111111111) {$hh='admin'; $sh='carriers'; echo "ELIMINAR PORTEADOR";} 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 "Cuenta Del Plomo De Dialable";} if ($ADD==7111111) {$hh='scripts'; echo "Escritura De la Inspección previo";} +if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL ADMIN Change Log";} +if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL USUARIO ADMIN Change Log";} +if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL SECCIÓN ADMIN Change Log";} +if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL Detalle de registro de cambio ADMIN";} if ($ADD==0) {$hh='users'; echo "Lista De Usuarios";} if ($ADD==8) {$hh='users'; echo "Servicios repetidos Dentro Del Agente";} if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Servicios repetidos Dentro De la Campaña";} @@ -1419,14 +2005,20 @@ if ($ADD==8111) {$hh='usergroups'; echo "Servicios repetidos Dentro Del Grupo if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campañas";} if ($ADD==100) {$hh='lists'; echo "Listas";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} +if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} if ($ADD==100000) {$hh='usergroups'; echo "Grupos De Usuario";} if ($ADD==1000000) {$hh='scripts'; echo "Escrituras";} if ($ADD==10000000) {$hh='filters'; echo "Filtros";} if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Tiempos De la Llamada";} +if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Turnos";} if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "Tiempos De la Llamada Del Estado";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "LISTA DE TELÉFONOS";} +if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "TELÉFONO ALIAS LISTA";} +if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "GRUPO DE ALIAS LISTA";} if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "LISTA DE SERVIDORES";} +if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "CONF lista de plantillas";} +if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "LISTA DE TRANSPORTISTA";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERENCIAS";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERENCIAS";} if ($ADD==550) {$hh='users'; echo "Formulario De Búsqueda";} @@ -1507,7 +2099,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="
CAMPAIGN     RANK     CALLS
CAMPAIGN     RANK     CALLSWEB VARS
    $calls_today
    $calls_today    
INBOUND GROUP     RANK     CALLS
Entrantes GROUP     RANK     CALLSWEB VARS
        $calls_today
    $calls_today    
Paso del teléfono - aquí es para donde usted puede fijar un valor del paso del teléfono del defecto cuando los registros del usuario en vicidial.php. Este valor poblará los phone_pass automáticamente cuando el usuario entra con su usuario-pasar-campaña en la pantalla de la conexión de vicidial.php. +
+ +
+Activo - Este campo define si el usuario está activo en el sistema y puede utilizar VICIDIAL recursos. Y es por defecto +

@@ -1935,31 +2622,53 @@ echo "
Vicidial transfiere - esta opción puede evitar que un agente abra la transferencia - la sesión de la conferencia de vicidial. Si esto es lisiado, el agente no puede llamada de los terceros o la transferencia oculta cualquiera llama. -
- -
-Un defecto más cercano mezclado - esta opción omite simplemente el checkbox mezclado en una pantalla MÁS CERCANA de la conexión. + 0) + { + ?> +
+
+
+ Un defecto más cercano mezclado - esta opción omite simplemente el checkbox mezclado en una pantalla MÁS CERCANA de la conexión. +

Invalidación de la grabación de VICIDIAL - esta opción seeliminará lo que es la opción en la campaña para la grabación.LISIADO no eliminará el ajuste de la grabación de la campaña. NUNCAinhabilitará la grabación en el cliente. ONDEMAND es el defecto ypermite que el agente comience y pare a registrar según lonecesitado. ALLCALLS comenzará la grabación en el cliente siempreque una llamada se envíe a un agente. ALLFORCE comenzará lagrabación en el cliente siempre que una llamada se envíe a un agenteque no da al agente ninguna opción para parar el registrar. ParaALLCALLS y ALLFORCE hay una opción para utilizar la grabaciónretrasa para reducir en grabaciones y carga de sistema muy cortas delrecude. +
+
+
+Agente de Cambio observancia Sobrescribir - Esta configuración anular cualquiera que sea el grupo de usuarios de los usuarios se ha fijado para Mayús Observancia. MINUSVALIDOS utilizará el grupo de usuarios de configuración. NO no aplicará en todos los turnos. PRINCIPIO sólo hacer cumplir el tiempo de inicio de sesión, pero no afectará a un agente que se está ejecutando en su momento, si en cambio ya están conectado TODOS hará cumplir turnos hora de inicio y de registro de un agente a cabo después de que ellos tienen sobre el final de su cambio de tiempo. Desactivado por defecto. + +
+
+
+Alerta Activado - Este campo muestra si el agente tiene el navegador web habilitado para alertas cuando pide entrar en su período de sesiones vicidial.php. Por defecto es 0 para el NO. +

-La campaña alinea - en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. +La campaña alinea - en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. También en esta sección son la WEB VARs para cada campaña. Estas permiten a cada agente tiene una cadena de la variable que se puede agregar a la WEB DE GUIÓN ficha URL o simplemente poniendo - A - web_vars - B - como le pondría en cualquier otra esfera.

-Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. Usted también podrá fijar la fila, o el nivel de habilidad, en estasección para cada uno de los grupos de entrada así como poder ver elnúmero de las llamadas recibidas de cada grupo de entrada para esteagente específico. También en esta sección está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opción seselecciona en la pantalla del en-grupo. +Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. Usted también podrá fijar la fila, o el nivel de habilidad, en estasección para cada uno de los grupos de entrada así como poder ver elnúmero de las llamadas recibidas de cada grupo de entrada para esteagente específico. También en esta sección está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opción seselecciona en la pantalla del en-grupo. También en esta sección son la WEB VARs para cada campaña. Estas permiten a cada agente tiene una cadena de la variable que se puede agregar a la WEB DE GUIÓN ficha URL o simplemente poniendo - A - web_vars - B - como le pondría en cualquier otra esfera.

El agente altera la invalidación de los datos del cliente - estaopción se eliminará lo que es la opción en la campaña paraalterarse de los datos del cliente. NOT_ACTIVE utilizará lo que estápresente el ajuste para la campaña. ALLOW_ALTER permitirá siemprepara que el agente altere los datos del cliente, no importa qué es elajuste de la campaña. El defecto es NOT_ACTIVE. +
+
+
+Modificar Agente Cliente Teléfono Sobreescribe - Esta opción será el que la opción está en la campaña para modificar el número de teléfono del cliente. NOT_ACTIVE utilizará cualquier ajuste es para la presente campaña. ALLOW_ALTER siempre permiten el agente de alterar el número de teléfono del cliente, no importa lo que la campaña de ajuste. El valor predeterminado es NOT_ACTIVE. +

@@ -1995,10 +2704,17 @@ echo "
Suprima los agentes alejados - esta opción si el sistema a 1 permite que el usuario suprima agentes alejados vicidial del sistema. -
- -
-La carga conduce - esta opción si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. + 0) + { + ?> +
+
+
+ La carga conduce - esta opción si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. +
@@ -2030,10 +2746,17 @@ echo "
Cambie la campaña del agente - esta opción si el sistema a 1 permite que el usuario altere la campaña que un agente está registrado en mientras que se registran en él. -
- -
-La cancelación se filtra - esta opción permite que el usuario pueda suprimir los filtros vicidial del plomo del sistema. + 0) + { + ?> +
+
+
+ La cancelación se filtra - esta opción permite que el usuario pueda suprimir los filtros vicidial del plomo del sistema. +
@@ -2055,6 +2778,82 @@ echo "
La visión divulga - esta opción permite que el usuario visión losinformes de VICIDIAL. + 0) + { + ?> +
+ +
+ CC Activado - Esta opción permite al usuario acceder a la pantalla de control de calidad de agente. + +
+
+
+ Nivel de Usuario de CC - Este ajuste define lo que el agente de control de calidad de nivel de usuario es. Este dictará el nivel de funcionalidad para el agente en la sección de CC:
+ 1 - Modificar Nada
+ 2 - Modificar Nada Salvo Estado
+ 3 - Modificar todos los campos
+ 4 - Compruebe la primera ronda de CC
+ 5 - Ver estadísticas de CC
+ 6 - Capacidad para modificar los registros acabado
+ 7 - Gestor de Nivel
+ +
+
+
+ CC Actas Pass - Esta opción permite al agente para especificar que un registro ha pasado la primera ronda de control de calidad después de examinar el expediente. + +
+
+
+ Registro de control de calidad en Finalizar - Esta opción permite al agente para especificar que un registro ha terminado la segunda ronda de control de calidad después de revisar el pasado registro. + +
+
+
+ Registro de control de calidad Compro - Esta opción permite al agente para especificar que un registro se ha cometido en el control de la calidad. Ya no puede ser modificado por cualquiera. + + +
+
+
+AñadirReloj de tiempo Registrarse Expediente - Esta opción permite al usuario añadir registros a la timeclock registro. + +
+
+
+ModificarReloj de tiempo Registrarse Expediente - Esta opción permite al usuario modificar los registros en el registro timeclock. + +
+
+
+EliminarReloj de tiempo Registrarse Expediente - Esta opción permite al usuario borrar los registros en el registro timeclock. + +
+
+
+Agente de acceso a la API - Esta opción permite que la cuenta que se utilizará con el agente de la API de comandos vicidial. + +
+
+
+Gerente de Turno observancia Sobrescribir - Este ajuste, si se pone a 1 permitirá que un administrador de entrar en su usuario y contraseña en una pantalla de agente para anular las restricciones sobre el desplazamiento de un agente período de sesiones si el agente está intentando iniciar sesión fuera de su turno. El valor predeterminado es 0. + +
+
+
+Download Listas - Este ajuste, si se establece en 1 para permitir que un administrador haga clic en la lista de descargas en la parte inferior de la pantalla una lista de modificaciones a la exportación de todo el contenido de una lista a un archivo de datos plana. El valor predeterminado es 0. + +
+
+
+Informes de exportación - Este ajuste, si se pone a 1 permitirá un gerente de exportación para acceder a la llamada de los informes sobre la INFORMES pantalla. El valor predeterminado es 0. Pide para el Informe de Exportación, para el siguiente campo se utiliza para las exportaciones:
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 + + + @@ -2108,7 +2907,12 @@ echo "

-Forma del Web - aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el botón de la FORMA del WEB. +Forma del Web - aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el botón de la FORMA del WEB. Para personalizar la cadena de la consulta después de que el formulario web, basta con iniciar el formulario web con VAR y, a continuación, la URL que desee utilizar, en sustitución de las variables con el nombre de las variables que desee utilizar - A - phone_number - B -- al igual que en la pestaña de la sección ESCRITURAS. + +
+
+
+Formulario Webs Meta- Este es donde usted puede establecer el marco de página web personalizada de la web de forma que se abrirá cuando el usuario hace clic en el botón formulario Web. El valor predeterminado es _blank.
@@ -2125,96 +2929,261 @@ echo "
Grupos permitidos de la transferencia - con estos listados delcheckbox usted puede seleccionar a los grupos a quienes los agentes enesta campaña pueden transferir llamadas. Permita Closers debe serpermitido para que esta opción demuestre para arriba. -
- -
-Permita de entrada y mezclado - aquí es donde usted puede fijar silos usuarios de esta campaña tendrán la opción para tomar llamadasde entrada con esta campaña. Si usted desea hacer de entrada y desalida mezclada entonces esto se debe fijar a Y. Si usted deseasolamente hacer marcar de salida en esta campaña fijó esto a N.Default es N. + 0) + { + ?> +
+
+
+ Permita de entrada y mezclado - aquí es donde usted puede fijar silos usuarios de esta campaña tendrán la opción para tomar llamadasde entrada con esta campaña. Si usted desea hacer de entrada y desalida mezclada entonces esto se debe fijar a Y. Si usted deseasolamente hacer marcar de salida en esta campaña fijó esto a N.Default es N. -
-
-
-Estado del dial - aquí es adonde usted fija los estados que usted está deseando marcar encendido dentro de las listas que son activas para la campaña abajo. Para agregar otro estado al dial, selecciónelo de la lista drop-downy el tecleo AGREGA. Para quitar uno de los estados del dial, chasqueencendido el acoplamiento del QUITAR al lado del estado que usteddesea quitar. +
+
+
+ Estado del dial - aquí es adonde usted fija los estados que usted está deseando marcar encendido dentro de las listas que son activas para la campaña abajo. Para agregar otro estado al dial, selecciónelo de la lista drop-downy el tecleo AGREGA. Para quitar uno de los estados del dial, chasqueencendido el acoplamiento del QUITAR al lado del estado que usteddesea quitar. -
-
-
-Orden de la lista - Este menú es donde usted selecciona cómo los plomos que emparejan los estados seleccionados arriba serán puestos en la tolva del plomo: -
  - DOWN: seleccione los primeros plomos cargados en la tabla del vicidial_list -
  - UP: seleccione los plomos pasados cargados en la tabla del vicidial_list -
  - UP PHONE: seleccione el número y los trabajos más altos de teléfono su manera abajo -
  - DOWN PHONE: seleccione el número y los trabajos más bajos de teléfono su manera para arriba -
  - UP LAST NAME: comienzo con los nombres pasados comenzando con Z y trabajos su manera abajo -
  - DOWN LAST NAME: comienzo con los nombres pasados comenzando con A y trabajos su manera para arriba -
  - UP COUNT: comienzo con los plomos y los trabajos llamados su manera abajo -
  - DOWN COUNT: comienzo con menos plomos y trabajos llamados su manera para arriba -
  - DOWN COUNT 2nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada otro lead(Must para no tener NEW seleccionado en los estados del dial) -
  - DOWN COUNT 3nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada tercer lead(Must para no tener NEW seleccionado en los estados del dial) -
  - DOWN COUNT 4th NEW: comienzo con menos plomos y trabajos llamados que su manera para arriba que inserta un NEW plomo en cada adelante conduzca (no debe tener NEW seleccionado en los estados del dial) +
+
+
+ Orden de la lista - Este menú es donde usted selecciona cómo los plomos que emparejan los estados seleccionados arriba serán puestos en la tolva del plomo: +
  - DOWN: seleccione los primeros plomos cargados en la tabla del vicidial_list +
  - UP: seleccione los plomos pasados cargados en la tabla del vicidial_list +
  - UP PHONE: seleccione el número y los trabajos más altos de teléfono su manera abajo +
  - DOWN PHONE: seleccione el número y los trabajos más bajos de teléfono su manera para arriba +
  - UP LAST NAME: comienzo con los nombres pasados comenzando con Z y trabajos su manera abajo +
  - DOWN LAST NAME: comienzo con los nombres pasados comenzando con A y trabajos su manera para arriba +
  - UP COUNT: comienzo con los plomos y los trabajos llamados su manera abajo +
  - DOWN COUNT: comienzo con menos plomos y trabajos llamados su manera para arriba +
  - DOWN COUNT 2nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada otro lead(Must para no tener NEW seleccionado en los estados del dial) +
  - DOWN COUNT 3nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada tercer lead(Must para no tener NEW seleccionado en los estados del dial) +
  - DOWN COUNT 4th NEW: comienzo con menos plomos y trabajos llamados que su manera para arriba que inserta un NEW plomo en cada adelante conduzca (no debe tener NEW seleccionado en los estados del dial) -
-
-
-Tolva llana - éste es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a través en un minuto. +
+
+
+ Tolva llana - éste es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a través en un minuto. -
-
-
-Filtro del plomo - éste es un método de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaución, él es fácil de parar el marcar accidentalmente con la alteración más leve a la declaración del SQL. El defecto no es NINGUNO. +
+
+
+ Filtro del plomo - éste es un método de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaución, él es fácil de parar el marcar accidentalmente con la alteración más leve a la declaración del SQL. El defecto no es NINGUNO. -
-
-
-Reajuste de la fuerza de la tolva - esto permite que usted limpie fuera del contenido de la tolva sobre la sumisión de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. +
+
+
+ Reajuste de la fuerza de la tolva - esto permite que usted limpie fuera del contenido de la tolva sobre la sumisión de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. -
-
-
-Método del dial - Este campo es la manera de definir cómo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el método del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y después no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos métodos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los métodos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profético. +
+
+
+ Método del dial - Este campo es la manera de definir cómo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el método del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y después no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos métodos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los métodos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profético. Entrantes_MAN permite que el agente de marcación manual de lugar a las llamadas de una campaña de la lista, mientras que ser capaz de tomar las llamadas entrantes entre marcación manual de llamadas. -
-
-
-Nivel auto del dial - aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automóvil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIÓN del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el método del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. +
+
+
+ Nivel auto del dial - aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automóvil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIÓN del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el método del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. -
-
-
-Solamente cuenta disponible - este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. +
+
+
+ Solamente cuenta disponible - este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. -
-
-
-Límite del porcentaje de la gota - este campo es donde usted fijó ellímite del porcentaje de llamadas caídas que usted quisiera mientrasque usaba un método adaptante-profe'tico del dial, NO MANUAL o delCOCIENTE. +
+
+
+ Límite del porcentaje de la gota - este campo es donde usted fijó ellímite del porcentaje de llamadas caídas que usted quisiera mientrasque usaba un método adaptante-profe'tico del dial, NO MANUAL o delCOCIENTE. -
-
-
-El máximo adapta el dial llano - este campo es donde usted fijó ellímite del límite al numbr de líneas que usted quisiera marcado poragente mientras que usaba un método adaptante-profe'tico del dial, NOMANUAL o del COCIENTE. Este número puede ser más alto que el nivelauto del dial si su hardware lo apoya. El valor debe ser un númeropositivo mayor de uno y puede tener defecto 3.0 de los lugaresdecimales. +
+
+
+ El máximo adapta el dial llano - este campo es donde usted fijó ellímite del límite al numbr de líneas que usted quisiera marcado poragente mientras que usaba un método adaptante-profe'tico del dial, NOMANUAL o del COCIENTE. Este número puede ser más alto que el nivelauto del dial si su hardware lo apoya. El valor debe ser un númeropositivo mayor de uno y puede tener defecto 3.0 de los lugaresdecimales. -
-
-
-El tiempo más último del servidor - este campo es utilizadosolamente por el método del dial de ADAPT_TAPERED. Usted debe entraren la hora y el minuto que usted parará el invitar de esta campaña,2100 significaría que usted parará el marcar de esta campaña en eltiempo del servidor de los 9PM. Esto permite que el algoritmo afiladodecida a cómo agresivamente al dial cerca cuánto tiempo usted tienehasta que usted será el llamar acabado. +
+
+
+ El tiempo más último del servidor - este campo es utilizadosolamente por el método del dial de ADAPT_TAPERED. Usted debe entraren la hora y el minuto que usted parará el invitar de esta campaña,2100 significaría que usted parará el marcar de esta campaña en eltiempo del servidor de los 9PM. Esto permite que el algoritmo afiladodecida a cómo agresivamente al dial cerca cuánto tiempo usted tienehasta que usted será el llamar acabado. -
-
-
-Adapte el modificante de la intensidad - este campo se utiliza paraajustar la intensidad profética más alta o más baja. El más altoun número positivo que usted selecciona, mayor va el sintonizadoraumentará la llamada que establece el paso cuando para arriba y máslentamente va el sintonizador disminuirá la llamada que establece elpaso cuando abajo. Cuanto más bajo es el número negativo que ustedseleccionan aquí, más lentamente el sintonizador aumentará lallamada que establece el paso y más rápidamente el sintonizadorbajará la llamada que establece el paso cuando va abajo. El defectoes 0. Este campo no es utilizado por los métodos del dial del MANUALo del COCIENTE. +
+
+
+ Adapte el modificante de la intensidad - este campo se utiliza paraajustar la intensidad profética más alta o más baja. El más altoun número positivo que usted selecciona, mayor va el sintonizadoraumentará la llamada que establece el paso cuando para arriba y máslentamente va el sintonizador disminuirá la llamada que establece elpaso cuando abajo. Cuanto más bajo es el número negativo que ustedseleccionan aquí, más lentamente el sintonizador aumentará lallamada que establece el paso y más rápidamente el sintonizadorbajará la llamada que establece el paso cuando va abajo. El defectoes 0. Este campo no es utilizado por los métodos del dial del MANUALo del COCIENTE. -
-
-
-Blanco llana de la diferencia del dial - este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los métodos del dial del MANUAL o del COCIENTE. +
+
+
+ Blanco llana de la diferencia del dial - este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los métodos del dial del MANUAL o del COCIENTE. -
-
-
-Transferencias concurrentes - este ajuste se utiliza para definir elnúmero de las llamadas que se pueden enviar a los agentes en el mismotiempo. Se recomienda que este ajuste está dejado en el AUTOMÓVIL. Este campo no es utilizado por el método MANUAL del dial. +
+
+
+ Transferencias concurrentes - este ajuste se utiliza para definir elnúmero de las llamadas que se pueden enviar a los agentes en el mismotiempo. Se recomienda que este ajuste está dejado en el AUTOMÓVIL. Este campo no es utilizado por el método MANUAL del dial. -
-
-
-Alt-Nu'mero auto que marca - este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA métodos del dial cuando no hay contacto en elnúmero de teléfono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el métodoMANUAL del dial. +
+
+
+ Cola de prioridad - Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla. + +
+
+
+ Alt-Nu'mero auto que marca - este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA métodos del dial cuando no hay contacto en elnúmero de teléfono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el métodoMANUAL del dial. PRORROGADO suplentes números son números cargados en el sistema fuera de la pantalla de información estándar. PRORROGADO utilizando usted puede tener cientos de números de teléfono de un solo registro de cliente. + +
+
+
+ Descanso del dial - si está definido, llamadas que normalmente retraso después de que el descanso definido en extensions.conf en lugar de otro descanso en esta cantidad de segundos si es menos que el descanso de extensions.conf. Esto permite descansos del dial rápidamente que cambian del servidor al servidor y a limitar los efectos a una sola campaña. Si usted está teniendo muchos de llamadas del contestador automático o de Buzón de Voz usted puede desear intentar cambiar este valor entre a 21-26 y ver si los resultados mejoran. + +
+
+
+ Campaña de extensión VDAD - Este campo permite una transferencia personalizada VDAD extensión. Esto le permite utilizar diferentes métodos de gestión de llamadas en función de su campaña. +- 8364 - 8368 misma que +- 8365 - Se envía la llamada a un sólo agente en el mismo servidor que la llamada está en +- 8366 - Utilizado para la prensa-1 y las campañas de estudio +- 8367 - ¿Se tratará de enviar la primera llamada a un agente en el servidor local, entonces se verá en otros servidores + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on +- 8369 - Se utiliza para Contestador automático de detección después de que, el mismo comportamiento como 8368 +- 8373 - Se utiliza para Contestador automático de detección después de que el mismo comportamiento de 8366 + +
+
+
+ Mensaje del contestador automático - este campo está para entrar en una extensión para cegar llamadas de la transferencia a cuando el agente consigue un contestador automático y chasca encendido el botón del mensaje del contestador automático en el marco de la conferencia de la transferencia. Usted debe fijar esto exten para arriba en el dial plan - extensions.conf - y se cerciora de que juega un archivo audio después que cuelga para arriba. + +
+
+
+ AMD envían a la VM exten - este menú permite que usted defina si un mensaje esté dejado en un contestador automático cuando se detecta la llamada será remitido inmediatamente a la extensión del Contestar-Ma'quina-Mensaje si AMD es activo y se determina que la llamada es un contestador automático. + +
+
+
+ CPD AMD Acción - Si está utilizando el Sangoma ParaXip software de detección de llamadas Progreso entonces usted desea habilitar esta configuración, o bien se DISPO a que la llamada disposición como AA y colgar la llamada si se está procesando y no se ha enviado aún a un agente o un mensaje que envía la llamada al contestador automático de mensajes definidos para esta campaña. Desactivado por defecto. + +
+
+
+ El marcar numérico del Alt del agente - esta opción permite que un agente marque manualmente el número de teléfono o el campo alterno address3 después de que se haya llamado el número principal. + +
+
+
+ Segundos de la llamada de la gota - el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, sólo se aplica a las llamadas desalida. + +
+
+
+ Acción gota - Este menú le permite elegir lo que le sucede a una llamada cuando se ha estado esperando durante más de lo establecido en la Convocatoria de caída Segundos campo. Colgar simplemente colgar la llamada, enviar el mensaje de llamar a la Extensión de caída que ha definido a continuación, Buzón de voz se envía la llamada a la casilla de voz que ha definido a continuación y IN_GROUP enviará la convocatoria a la entrada del Grupo que se define a continuación + +
+
+
+ seguro puerto Exten - este ser dial plan extensión que desear seguropuerto audio archivo ser localizar en en su servidor. + +
+
+
+ Buzón de Voz - si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. + +
+
+
+ Grupo de Transferencia de gota - En caso de caída de Acción se establece en IN_GROUP, la llamada será enviada a este grupo entrantes si llega a soltar Convocatoria Segundos. + +
+
+
+ Permita Ninguno-Tolva-Conduce conexiones - si el sistema a Y, permiteagentes a la conexión a la campaña incluso si no hay plomos cargadosen la tolva para esa campaña. Esta función no se necesita encampañas de CLOSER-type. El defecto es N. + +
+
+
+ Mezcla de la orden de la lista - elimina los campos de la orden delplomo y del estado del dial. Utilizará los parámetros de la lista ydel estado para la entrada seleccionada de la mezcla de la lista en lasección del submarino de la mezcla de la lista en lugar de otro. Eldefecto es LISIADO. + +
+
+
+ Identificación de la mezcla de la lista - identificación de lamezcla de la lista. Debe ser a partir de 2-20 caracteres en longitudsin los espacios o la otra puntuación especial. + +
+
+
+ Nombre de la mezcla de la lista - nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. + +
+
+
+ Detalle de la mezcla de la lista - la composición de la entrada de lamezcla de la lista. Contiene la identificación de la lista, la ordende la mezcla, los porcentajes y los estados que hacen para arriba estamezcla de la lista. Los porcentajes tienen que agregar siempre hasta100, y las listas todas tienen que ser activas y fijadas a la campañapara que la entrada de la mezcla de la orden sea activada. + +
+
+
+ Método de la mezcla de la lista - el método de mezclar a todas laspartes del detalle de la mezcla de la lista juntas. EVEN_MIX mezclarálos plomos de cada parte interpolada con las otras partes, como estos1.2.3.1.2.3.1.2.3. IN_ORDER pondrá los plomos en la orden en la cualse enumeran en la pantalla 1.1.1.2.2.2.3.3.3 del detalle de la mezclade la lista. La voluntad AL AZAR los puso en la orden AL AZAR1.3.2.1.1.3.2.1.3. El defecto es IN_ORDER. + +
+
+
+ Agente de pantalla ampliada Alt Dial - Esta característica permite a los agentes el acceso ampliado a los números de teléfono de suplentes lleva más allá de la norma Alt Teléfono y Address3 campos que pueden ser utilizados en VICIDIAL más allá de los números de teléfono de los principales número de teléfono. La extensión números de teléfono se puede marcar automáticamente utilizando la auto-Alt-función Marcación VICIDIAL en la configuración de la campaña, pero activar esta función de agente de pantalla también permitirá que el agente a llamar a estos números de la pantalla de su mandatario, así como editar su información. + +
+
+
+ Primera encuesta de archivo de audio - Este es el nombre de archivo de audio que se reproduce en cuanto el cliente coge el teléfono cuando se ejecuta una campaña de estudio. + +
+
+
+ Encuesta dígitos DTMF - Este campo es donde se define los dígitos que un cliente puede pulsar como una opción en una encuesta sobre la campaña. válidos son los dígitos DTMF0123456789*# + +
+
+
+ No encuesta interesadas dígitos - Este campo es donde se define el cliente presiona dígitos que indican que no están interesados. + +
+
+
+ Estudio de estado no le interesa - Este es un campo en el que seleccione el estado que debe utilizarse para no estoy interesado. Si se utiliza DNC y la campaña está configurada para utilizar DNC entonces el número de teléfono se añade automáticamente a la lista VICIDIAL interior DNC.y, posiblemente, la campaña específica de DNC lista. + +
+
+
+ Encuesta de Opt-in de archivos de audio - Este es el nombre de archivo de audio que se reproduce cuando el cliente ha decidido participar en la encuesta, no esta opción, o no respondió si la respuesta no-acción se establece a OptOut. Después de este archivo de audio se reproduce, el método de encuesta se toman medidas. + +
+
+
+ No encuesta interesadas archivo de audio - Este es el nombre de archivo de audio que se reproduce cuando el cliente ha optado-de la encuesta, no ha optado-o no respondió si la respuesta no-acción se establece en OptIn. Después de este archivo de audio se reproduce, la llamada se colgó. + +
+
+
+ Método de encuesta - Esta opción se define lo que sucede a una convocatoria después de que el cliente ha optado-en. AGENT_XFER enviará la convocatoria a la siguiente agente disponible. Buzón de voz se envía la llamada al buzón de voz de la caja que se especifica en el campo de voz. EXTENSIÓN enviará al cliente a la extensión se define en la Encuesta Xfer campo Extensión. Colgar se cuelgue el cliente. CAMPREC_60_WAV enviará al cliente a tener una grabación con su respuesta, esta grabación se coloca en una carpeta con el nombre de la campaña dentro de la Campaña de Estudio de grabación Directorio. + +
+
+
+ Estudio n-Respuesta Acción - Este es donde se define lo que ocurrirá si no hay respuesta a la pregunta de la encuesta. OptIn sólo enviar la llamada al método de encuesta si el cliente pulsa una dígitos DTMF. OptOut enviará al cliente en el método de encuesta, aun cuando no presiona una dígitos DTMF. + +
+
+
+ Respuesta encuesta dígitos Mapa - Esta es la sección donde usted puede definir una descripción para ir dígitos DTMF con cada opción que el cliente puede seleccionar. + +
+
+
+ Encuesta Xfer Extensión - Si el método de encuesta de EXTENSIÓN se selecciona entonces la llamada de cliente se dirige a esta extensión dialplan. + +
+
+
+ Estudio de grabación Campaña Directorio - Si el método de encuesta de CAMPREC_60_WAV luego se selecciona la respuesta de los clientes se registran y se coloca en un directorio llamado después de la campaña dentro de este directorio. + +
@@ -2232,11 +3201,6 @@ echo "
Tiempo de la llamada local - aquí es adonde usted fijó durante qué horas usted quisiera marcar, según lo determinado por el tiempo local en está en cuál usted está llamando. Esto es controlada por código de área y ajustada por tiempo de los ahorros de la luz del día si es aplicable. Las pautas generales en los E.E.U.U. para el negocio al negocio son los 9am a los 5pm y el negocio a las llamadas del consumidor es los 9am a los 9pm. -
- -
-Descanso del dial - si está definido, llamadas que normalmente retraso después de que el descanso definido en extensions.conf en lugar de otro descanso en esta cantidad de segundos si es menos que el descanso de extensions.conf. Esto permite descansos del dial rápidamente que cambian del servidor al servidor y a limitar los efectos a una sola campaña. Si usted está teniendo muchos de llamadas del contestador automático o de Buzón de Voz usted puede desear intentar cambiar este valor entre a 21-26 y ver si los resultados mejoran. -

@@ -2252,11 +3216,6 @@ echo "
Campaña CallerID - este campo permite enviar de un número de encargo del callerid en las llamadas de salida. Úste es el número que demostraría para arriba en el callerid de la persona que usted está llamando. El defecto es DESCONOCIDO. Esta opción está solamente disponible si usted está utilizando PRIs - ISDN T1 o E1 - que tienen la característica de encargo del callerid se giraron. Esta característica puede también trabajar con los troncos IAX2 dependiendo de lo que admite su abastecedor. El callerID de encargo se aplica solamente a las llamadas puestas para la campaña de VICIDIAL directamente, cualquier tercer persona llama o las transferencias no enviarán el callerID de encargo. NOTA: A veces el poner DESCONOCIDO o PRIVADO en el campo rendirá enviar de su número del callerID del defecto por su portador con las llamadas. Usted puede desear probar esto y poner 0000000000 en el campo del callerid en lugar de otro si usted no desea enviarle CallerID. -
- -
-Extensión de la campaña VDAD - este campo permite una extensión de la transferencia del costumbre VDAD. Esto permite que usted utilice diversas escrituras del agi de VDADtransfer... dependiendo de su campaña. La transferencia AGI(exten 8365 agi-VDADtransfer.agi del defecto) apenas envía inmediatamente invita a los agentes tan pronto como él se tome. Una encuesta sobre política AGI la muestra adicional es también (8366 agi-VDADtransferSURVEY.agi ) ese ahora incluido los juegos un mensaje a la persona llamada y permite que él haga una opción presionando buttons(effectively la pre-investigacio'n el plomo). Observe por favor eso a excepción de los exámenes, llamadas políticas y las caridades esta forma de llamar son ilegales en los Estados Unidos. -

@@ -2287,51 +3246,16 @@ echo "
Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. -
- -
-Mensaje del contestador automático - este campo está para entrar en una extensión para cegar llamadas de la transferencia a cuando el agente consigue un contestador automático y chasca encendido el botón del mensaje del contestador automático en el marco de la conferencia de la transferencia. Usted debe fijar esto exten para arriba en el dial plan - extensions.conf - y se cerciora de que juega un archivo audio después que cuelga para arriba. - -
-
-
-AMD envían a la VM exten - este menú permite que usted defina si un mensaje esté dejado en un contestador automático cuando se detecta la llamada será remitido inmediatamente a la extensión del Contestar-Ma'quina-Mensaje si AMD es activo y se determina que la llamada es un contestador automático. -

Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. Si usted desea permitir transferencias consultivas, un fronter a unmás cercano, usted puede colocar CXFER pues uno de lasprecolocaciones del nu'mero-a-dial y del dial string apropiado seráenviado para hacer una transferencia consultiva local, entonces lalata LEAVE-3WAY-CALL justo del agente y movimiento encendido a sullamada siguiente. Si usted desea permitir transferencias ocultas declientes a una escritura de VICIDIAL AGI para registrar o un IVR,entonces coloque AXFER en el campo del nu'mero-a-dial. Usted puedetambién especificar una extensión de encargo después del AXFER odel CXFER, por ejemplo si usted desea hacer transferencias consultivasinternas en vez de local que usted pondría CXFER90009 en el campo delnu'mero-a-dial. -
-
-
-El marcar numérico del Alt del agente - esta opción permite que un agente marque manualmente el número de teléfono o el campo alterno address3 después de que se haya llamado el número principal. -

Servicios repetidos programar - esta opción no prohibe a agente a la disposición una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. -
-
-
-Segundos de la llamada de la gota - el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, sólo se aplica a las llamadas desalida. - -
-
-
-Buzón de Voz - si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. - -
-
-
-seguro puerto mensaje - si fijar y juego uno mensaje clientedespués gota llamar segundo descanso ser alcanzar sin ser transferiruno agente. _ este fijar eliminar sending uno voicemail caja si esteser fijar y. - -
-
-
-seguro puerto Exten - este ser dial plan extensión que desear seguropuerto audio archivo ser localizar en en su servidor. -

@@ -2347,6 +3271,11 @@ echo "
Lista interna del uso DNC - esto define si esta campaña es filtrarlos plomos contra la lista interna de DNC. Si se fija a Y, la tolvabuscará cada número de teléfono en la lista de DNC antes de ponerlaen la tolva. Si está en la lista de DNC entonces que cambiará eseconduce estado a DNCL así que no puede ser marcada. El defecto es N. +
+ +
+Campaña de uso Lista DNC - Este define si esta campaña es un filtro contra el DNC lleva lista que es específico de la campaña únicamente. Si se configura a Y, la tolva se verá para cada número de teléfono en la campaña específica de DNC lista antes de colocarla en la tolva. Si es en la campaña específica de DNC se lista a continuación, cambiar de estado que llevan a DNCC por lo que no pueden ser marcados. El valor por defecto es N. +

@@ -2355,7 +3284,7 @@ echo "

-La pausa del agente cifra activo - permite que los agentes seleccionenun código de la pausa cuando chascan encendido el botón de PAUSA envicidial.php. Los códigos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinión de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. +La pausa del agente cifra activo - permite que los agentes seleccionenun código de la pausa cuando chascan encendido el botón de PAUSA envicidial.php. Los códigos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinión de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. Fuerza de la fuerza de los agentes para elegir un código PAUSA si hacen clic en el botón PAUSA.
@@ -2363,40 +3292,113 @@ echo "
Inhabilite alteran datos del cliente - si el sistema a Y, no cambiacualquiera del expediente de datos del cliente cuando lasdisposiciones de un agente la llamada. El defecto es N.
- +
-Permita Ninguno-Tolva-Conduce conexiones - si el sistema a Y, permiteagentes a la conexión a la campaña incluso si no hay plomos cargadosen la tolva para esa campaña. Esta función no se necesita encampañas de CLOSER-type. El defecto es N. +Deshabilitar Modificar Cliente Teléfono - Si se pone a Y, no cambia el número de teléfono del cliente, cuando un agente disposiciones de la llamada. Y es por defecto.
-
+
-Mezcla de la orden de la lista - elimina los campos de la orden delplomo y del estado del dial. Utilizará los parámetros de la lista ydel estado para la entrada seleccionada de la mezcla de la lista en lasección del submarino de la mezcla de la lista en lugar de otro. Eldefecto es LISIADO. - -
-
-
-Identificación de la mezcla de la lista - identificación de lamezcla de la lista. Debe ser a partir de 2-20 caracteres en longitudsin los espacios o la otra puntuación especial. - -
-
-
-Nombre de la mezcla de la lista - nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. - -
-
-
-Detalle de la mezcla de la lista - la composición de la entrada de lamezcla de la lista. Contiene la identificación de la lista, la ordende la mezcla, los porcentajes y los estados que hacen para arriba estamezcla de la lista. Los porcentajes tienen que agregar siempre hasta100, y las listas todas tienen que ser activas y fijadas a la campañapara que la entrada de la mezcla de la orden sea activada. - -
-
-
-Método de la mezcla de la lista - el método de mezclar a todas laspartes del detalle de la mezcla de la lista juntas. EVEN_MIX mezclarálos plomos de cada parte interpolada con las otras partes, como estos1.2.3.1.2.3.1.2.3. IN_ORDER pondrá los plomos en la orden en la cualse enumeran en la pantalla 1.1.1.2.2.2.3.3.3 del detalle de la mezclade la lista. La voluntad AL AZAR los puso en la orden AL AZAR1.3.2.1.1.3.2.1.3. El defecto es IN_ORDER. +Agente Mostrar cola Conde - Si se establece a Y, cuando un cliente está a la espera de un agente, la cola de llamadas en la pantalla superior de la pantalla agente se iluminará en rojo y muestran el número de llamadas en espera. Y es por defecto.

Identificación manual de la lista del dial - el list_id del defectoque se utilizará cuando los placces de un agente una llamada manual yun nuevo expediente del plomo se crean en vicidial_list. El defecto es999. Este campo puede contener dígitos solamente. +
+
+
+Manual de Acceso telefónico Filtro - Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTAS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas. + +
+
+
+Agente de pantalla Portapapeles Copiar - esta función por el momento sólo se han permitido para Internet Explorer. Esta característica le permite seleccionar un campo que será copiado al portapapeles el equipo del agente ordenador a una llamada que se envían a un agente. Usos comunes para ello son para permitir la fácil pegar los números de cuenta o números de teléfono en el legado de las aplicaciones cliente en el equipo agente. + +
+
+
+3-Vías de salida de llamadas CallerID - Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en. AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones. + +
+
+
+3-Vías de llamadas Prefijo telefónico - Esto define lo que se utiliza como prefijo de marcación para las llamadas de 3 vías, por defecto está vacío por lo que la campaña se utiliza el prefijo de marcación, por lo que puede passthru oye un pitido es de 88. + + 0) + { + ?> +
+
+
+ CC Activado - Configuración Y a este campo permite que el agente de control de calidad de elementos de trabajo. El valor predeterminado es N. + +
+
+
+ CC estados - Esta zona es donde se selecciona el que lleva de estados debe ser pasado por el sistema de CC. Coloque una marca de verificación junto a la situación que desea revisar CC. + +
+
+
+ CC Mayúsculas - Este es el paso de tiempo utilizado para tirar de registros de control de calidad para una campaña. Los días de la semana no se tienen en cuenta para estas funciones. + +
+
+
+ CC Obtener Registro de lanzamiento- Esto permite que una de las siguientes acciones, que se activará en un agente de control de la calidad de recibir un nuevo registro. + +
+
+
+ Mostrar control de la calidad de grabación - , lo que permite una grabación que puede estar vinculado con el control de la calidad de registro que se mostrará en pantalla el agente de control de calidad. + +
+
+
+ CC Webform Dirección - Esta es la dirección del sitio web que un agente de control de calidad puede ir a al hacer clic en el enlace Formulario de Asistencia en la pantalla de control de calidad. + +
+
+
+ CC Escritura - Este es el script que puede ser utilizada por agentes de control de la calidad en la secuencia de comandos en la ficha de CC pantalla. + + +
+
+
+Buscar Vtiger Categoría - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si vtiger_search.php la página de búsqueda para el número de teléfono que se inscribió. Hay 4 opciones que pueden utilizarse en este campo: LEAD-Esta opción de búsqueda a través de la Vtiger sólo conduce, CUENTA-Esta opción de búsqueda a través de las cuentas y Vtiger todos los contactos y sub-contactos para el número de teléfono, VENDEDOR-Esta opción sólo a través de la búsqueda Vtiger vendedores, ACCTID-Esta opción sólo funciona para las cuentas y que se llevará a vicidial vendor_lead_code el campo y tratar de buscar el ID de cuenta Vtiger. Si se intenta sin éxito que cualquier otro método que la lista que ha seleccionado. Múltiples opciones pueden ser utilizados para cada búsqueda, pero en grandes bases de datos no es recomendable. El valor predeterminado es PLOMO. + +
+
+
+Crear Vtiger Registro de llamadas - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si la nueva actividad Vtiger registro se crea para la llamada cuando el agente va a la página vtiger_search. Y es por defecto. + +
+
+
+Crear Vtiger plomo Expediente - Si está habilitado Vtiger integración en la configuración del sistema y Vtiger Búsqueda Categoría incluye PLOMO entonces esta configuración definirá si un nuevo registro de conducir Vtiger es creada cuando el agente va a la página vtiger_search y no se registro determinó que la llamada número de teléfono. Y es por defecto. + +
+
+
+Pantalla de inicio de sesión Vtiger - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si el usuario está conectado a la interfaz automáticamente Vtiger los usuarios cuando ingresan a VICIDIAL. Y es por defecto. + +
+
+
+Grupo Alias permitidas - Si desea permitir que su grupo de agentes a utilizar alias, entonces necesita hacer esto a Y. Grupo Alias se explican más en la sección de administración, permiten a los agentes para seleccionar diferentes callerIDs para llamadas salientes manual que se puede colocar. El valor predeterminado es N. + +
+
+
+Grupo Alias predeterminado - Si han permitido Grupo Alias este es el grupo de alias que se ha seleccionado en primer lugar, por defecto cuando el agente decide usar un alias para un grupo de salida manual de llamada. El valor por defecto es vacío o NINGUNA. + + @@ -2445,13 +3447,13 @@ echo "

-Lista de VICIDIAL DNC - esto no llama la lista contiene cada plomo quese ha fijado a un estado de DNC en el sistema. A través de las LISTAS- AGREGUE EL NÚMERO a la página de DNC que usted puede agregarmanualmente un número a esta lista de modo que no sea llamada por lascampañas que utilizan la lista interna de DNC. +Lista DNC VICIDIAL - Esta lista de No Llamar contiene cada lugar que se ha establecido en un estado de la DNC en el sistema. A través de la LISTAS - AÑADIR AL NÚMERO DNC página usted puede agregar manualmente los números de esta lista a fin de que no van a ser llamados por las campañas que utilizan la lista interna DNC. También existe la opción de añadir conduce a la campaña específica de DNC listas para esas campañas que les han.



-VICIDIAL_INBOUND_GROUPS TABLA

+VICIDIAL_Entrantes_GROUPS TABLA


Identificación de grupo - Úste es el nombre corto del grupo de entrada, él no es editable después de la sumisión inicial, no debe contener cualquier espacio y debe estar entre 2 y 20 caracteres en longitud. @@ -2489,6 +3491,12 @@ echo "
  - campaign_rank: órdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible.
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.
+ +
+ +
+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. +

Exhibición de Fronter - este campo se determina si el agente de entrada de VICIDIAL tendría el name(if del fronter allí es uno) exhibido en el campo del estado cuando la llamada viene al agente. @@ -2511,22 +3519,27 @@ echo "

-Segundos de la llamada de la gota - el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, sólo se aplica a las llamadas desalida. +Llame a gota Segundos - el número de segundos de una llamada se quedará en la cola antes de ser considerado uno de DROP.
-
+
-Buzón de Voz - si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. - -
-
-
-Mensaje de la gota - si el sistema a Y juega un mensaje al clientedespués de que el descanso de los segundos de la llamada de la gotase alcance sin la transferencia a un agente. Este ajuste eliminaráenviar a una caja del voicemail si esto se fija a Y. +Acción gota - Este menú le permite elegir lo que le sucede a una llamada cuando se ha estado esperando durante más de lo establecido en la Convocatoria de caída Segundos campo. Colgar simplemente colgar la llamada, enviar el mensaje de llamar a la Extensión de caída que ha definido a continuación, Buzón de voz se envía la llamada a la casilla de voz que ha definido a continuación y IN_GROUP enviará la convocatoria a la entrada del Grupo que se define a continuación.

-Gota Exten - ésta es la extensión dial plan que el archivo audiocaído deseado de la llamada está situado en en su servidor. +Caída Extensión - En caso de caída de acción se fija a un mensaje, este es el dial plan de ampliación que la convocatoria se enviará a si llega a soltar Convocatoria Segundos. + +
+
+
+Buzón 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 Transferencia de gota - En caso de caída de Acción se establece en IN_GROUP, la llamada será enviada a este grupo entrantes si llega a soltar Convocatoria Segundos.
@@ -2536,7 +3549,7 @@ echo "

-Después de la acción de las horas - la acción a realizarse si esdespués de horas según lo definido en la época de la llamada paraeste grupo de entrada. Del RETRASO de la voluntad el retrasoinmediatamente la llamada, MESSASGE jugará el archivo en después delcampo de Filenam del mensaje de las horas, la EXTENSIÓN enviará lallamada a después de la extensión de las horas en el dialplan yVOICEMAIL enviará la llamada a la caja del voicemail enumerada endespués del campo de Buzón de Voz de las horas. El defecto es MENSAJE. +Horas después de Acción - La acción para llevar a cabo si es después de horas, tal como se definen en el tiempo de atención para este grupo entrante. Colgar inmediatamente colgar la llamada, MESSASGE de reproducir el archivo en el mensaje después de las horas Filenam campo, EXTENSIÓN enviará la llamada a la extensión del horario en el dialplan de voz y se envía la llamada al buzón de voz que figuran en el cuadro Después de horas de voz sobre el terreno , IN_GROUP enviará la convocatoria a la entrada seleccionada en el grupo después de las horas Grupo de Transferencia de seleccionar la lista. El valor predeterminado es MENSAJE.
@@ -2553,11 +3566,21 @@ echo "
Después de las horas Buzón de Voz - la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. +
+ +
+Horas después de la transferencia Grupo - Si después de las horas de Acción se establece en IN_GROUP, la llamada será enviada a este grupo de entrada si ésta entra en el grupo de fuera de la convocatoria régimen de tiempo definido para el grupo en -. +

Nombre de fichero agradable del mensaje - el archivo audio situado enel servidor que se jugará cuando viene la llamada adentro. Si sistemaa ---NONE --- entonces no se jugará ningún mensaje. El defecto es---NONE --- +
+
+
+Reproducir Mensaje de Bienvenida - Esta configuración seleccione para jugar cuando se define el mensaje de bienvenida, SIEMPRE desempeñará cada vez, NUNCA nunca jugar, IF_WAIT_ONLY sólo reproducirá el mensaje de bienvenida si la llamada no ir inmediatamente a un agente , y siempre YES_UNLESS_NODELAY reproducir el mensaje de bienvenida NO_DELAY menos que el ajuste está activado. El valor predeterminado es SIEMPRE. +

@@ -2571,7 +3594,52 @@ echo "

-En el intervalo del aviso del asimiento - la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. +En el intervalo del aviso del asimiento - la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. Para desactivar la espera El símbolo, definir el intervalo a 0. + +
+
+
+Lugar jugar en línea - Este define si la persona que llama escuchará su lugar en la línea cuando entran en la cola, así como cuando escuchan la announcemend. El valor predeterminado es N. + +
+
+
+Juega Mantenga Tiempo estimado - Este define si la persona que llama escuchará la estimación de tiempo de espera antes de ser transferido a un agente. El valor predeterminado es N. + +
+
+
+Mantenga la opción Tiempo - Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA. + +
+
+
+Mantenga la opción Tiempo Segundos - Si el tiempo de la opción se establece en algo, pero ninguno, este es el número de segundos de tiempo de espera estimado que el tiempo de activar la opción. El valor por defecto es 360 segundos. + +
+
+
+Mantenga la opción Tiempo de Extensión - Si el tiempo de la opción se fija a la extensión, esta es la extensión dialplan que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. + +
+
+
+Mantenga la opción Tiempo de voz - Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. + +
+
+
+Opción de Transferencia de celebrar Tiempo-Grupo A - Si el tiempo de la opción está establecida en IN_GROUP, este es el grupo de entrada que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. + +
+
+
+Mantenga la opción Tiempo de llamada de archivo - Si el tiempo de la opción está establecida en CALLERID_CALLBACK, este es el símbolo del nombre de archivo que se juega antes de la llamada se registra como un nuevo lugar a la lista de identificación se especifican a continuación si el tiempo de espera estimado es superior a la Mantenga la opción Tiempo Segundos. + +
+
+
+Mantenga la opción Tiempo de llamada Lista ID - Si el tiempo de la opción está establecida en CALLERID_CALLBACK, esta es la lista de ID de la llamada, se añadirá como un nuevo lugar si el tiempo de espera estimado es superior a la opción Tiempo de Espera Segundos.
@@ -2588,6 +3656,176 @@ echo "
Grupo de la transferencia del defecto - este campo es el En-Grupo deldefecto que será seleccionado automáticamente cuando el agente va almarco de la transferir-conferencia en su interfaz del agente. +
+ +
+En el Grupo de grabación Sobreescribe - Este campo permite la superposición de la campaña llamada de ajuste de grabación. Este ajuste puede ser anulado por la grabación vicidial_user sobre el establecimiento. MINUSVALIDOS no anular la campaña de ajuste de grabación. NUNCA deshabilitará la grabación en el cliente. OnDemand es el valor por defecto y permite que el agente para iniciar y detener la grabación cuando sea necesario. ALLCALLS empezará a grabar en el cliente cuando se envía una llamada a un agente. ALLFORCE empezará a grabar en el cliente cuando se envía una llamada a un agente que el agente de ninguna opción para detener la grabación. + +
+
+
+En Nombre de archivo del grupo de grabación - Este campo sobre la Campaña de grabación régimen de nombramiento de ficheros si no está definido en ninguno. La variables son permitidos CAMPAÑA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. El valor por defecto es FULLDATE_AGENTE y se vería así 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así TESTCAMP_51020103108_3125551212. 50 caracteres máx. El valor predeterminado es NINGUNA. + + 0) + { + ?> +
+
+
+ CC Activado - Configuración Y a este campo permite que el agente de control de calidad de elementos de trabajo. El valor predeterminado es N. + +
+
+
+ CC estados - Esta zona es donde se selecciona el que lleva de estados debe ser pasado por el sistema de CC. Coloque una marca de verificación junto a la situación que desea revisar CC. + +
+
+
+ CC Mayúsculas - Este es el paso de tiempo utilizado para tirar de un control de calidad para los registros inbound_group. Los días de la semana no se tienen en cuenta para estas funciones. + +
+
+
+ CC Obtener Registro de lanzamiento- Esto permite que una de las siguientes acciones, que se activará en un agente de control de la calidad de recibir un nuevo registro. + +
+
+
+ Mostrar control de la calidad de grabación - , lo que permite una grabación que puede estar vinculado con el control de la calidad de registro que se mostrará en pantalla el agente de control de calidad. + +
+
+
+ CC Webform Dirección - Esta es la dirección del sitio web que un agente de control de calidad puede ir a al hacer clic en el enlace Formulario de Asistencia en la pantalla de control de calidad. + +
+
+
+ CC Escritura - Este es el script que puede ser utilizada por agentes de control de la calidad en la secuencia de comandos en la ficha de CC pantalla. + + +
+
+
+Recordatorio de Transferencia de celebrar en Grupo - Si un cliente pide de nuevo a este grupo en más de una vez y esto no está establecido en NINGUNO, entonces la llamada será automáticamente enviado al Grupo de In-seleccionado en este campo . El valor predeterminado es NINGUNA. + +
+
+
+N Retraso de llamada Ruta - Configuración Y esto eliminará todos los tiempos de espera y anuncios de audio y tratar de enviar la llamada a un agente de la derecha. No anula el mensaje de bienvenida o celebrar la configuración rápida. El valor predeterminado es N. + +
+
+
+Estadísticas Porcentaje de llamadas respondidas dentro de X segundos - Este campo le permite ajustar el número de segundos que tienen las estadísticas en tiempo real de la pantalla se utiliza para calcular el porcentaje de llamadas que fueron contestadas respuesta en el plazo de X número de segundos en espera. + +
+
+
+Grupo Alias predeterminado - Si han permitido Alias Grupo para la campaña de que el agente se registra en este grupo es el alias que se ha seleccionado en primer lugar por incumplimiento de una llamada procedente de este grupo entrante cuando el agente decide usar un alias para un grupo de salida manual de llamada. El valor por defecto es vacío o NINGUNA. + + + + + +



+ +VICIDIAL_Entrantes_DIDS TABLA

+
+
+
+Extensión DID - Este es el número, extensión o DID que hará que esta entrada y que va a la ruta en el sistema que utiliza esta función. Hay un DID reservados por defecto que puede utilizar que es sólo la palabra-por defecto-, sin los guiones, que permiten el envío de cualquier llamada que no coincida con cualquier otro de los modelos existentes por defecto DID. + +
+
+
+Descripción DID - Esta es la descripción de la entrada de rutas DID. + +
+
+
+DID activa - Este es el campo en el que configurar la entrada a DID activa o no. Y es por defecto. + +
+
+
+Ruta DID - Este es el tipo de ruta que establezca el uso de DID. EXTEN enviará las llamadas a la extensión entró a continuación, enviará las llamadas de voz directamente a la caja de voz entró a continuación, AGENTE enviará las llamadas a un agente VICIDIAL si está conectado, TELÉFONO enviará la llamada a un teléfono de entrada, seleccione a continuación, se IN_GROUP enviar las llamadas directamente a la entrada del grupo especificado. El valor predeterminado es EXTEN. + +
+
+
+Extensión - Si se ha seleccionado como EXTEN DID la ruta, entonces esta es la extensión que llama dialplan se enviará a. El valor predeterminado es 9998811112, no hay servicio. + +
+
+
+Extensión Contexto - Si se ha seleccionado como EXTEN DID la Ruta, este es el contexto en el que pide dialplan se enviará a. El valor por defecto es por defecto. + +
+
+
+Buzón de voz Caja - Si se ha seleccionado como voz de la DID de carreteras, este es el buzón de voz que llama a la casilla se enviará a. Por defecto está vacío. + +
+
+
+Teléfono Extensión - TELÉFONO Si está seleccionado como la Ruta de DID, entonces esta es la extensión del teléfono que las llamadas se enviarán a. + +
+
+
+Teléfono IP del servidor - TELÉFONO Si está seleccionado como la Ruta de DID, entonces esta es la IP del servidor para la extensión del teléfono que las llamadas se enviarán a. + +
+
+
+Agente de usuario - Si se ha seleccionado como Agente de la DID de carreteras, este es el Agente VICIDIAL pide que se enviará a. + +
+
+
+Usuario no disponible Acción - Si se ha seleccionado como Agente de la Ruta de DID, y el usuario no está conectado o disponible, entonces este es el camino que las convocatorias se. + +
+
+
+En Configuración de usuario Ruta-Grupo - Si se ha seleccionado como Agente de la DID de carreteras, este es el grupo en que se utilizará para la configuración de la cola como la persona que llama está a la espera de ser enviado a la agente. El valor predeterminado es AGENTDIRECT. + +
+
+
+En el Grupo-ID - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el grupo en que las llamadas se enviarán a. + +
+
+
+En llamada de grupo Manipule Método - Si se ha seleccionado como IN_GROUP DID la ruta, entonces este es el llamado método utilizado para la manipulación de estas llamadas. CID se añada un nuevo registro de conducir en cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP tratará de buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL se attampt a buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC se attampt a buscar el número de teléfono por el CallerID en las listas de todos los que pertenecen a la campaña se especifica, más cerca se especifica para VICIDIAL pide más estrecha, ANI se añada un nuevo registro de conducir en cada llamada mediante la ANI como el número de teléfono, ANILOOKUP tratará de buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL se attampt a buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID impulsará la persona que llama para una X dígitos antes de la llamada se pondrá en la cola. El valor predeterminado es CID. + +
+
+
+En Grupo Agente Método de búsqueda - Si se ha seleccionado como IN_GROUP la ruta DID, este agente es el método de búsqueda para ser utilizado por el grupo de entrada, la LO es equilibrado de carga-y-Rebose intentará enviar la convocatoria a un agente en el servidor local antes de intentar enviar a un agente en otro servidor, LB es equilibrado de carga-y se trata de enviar la convocatoria a la siguiente agente, sin importar lo que ellos están en el servidor, el SO es el servidor y sólo se sólo intenta enviar las llamadas a los agentes en el servidor que la llamada se produjo en el. El valor predeterminado es LB. + +
+
+
+-En la lista Grupo de Identificación - Si se ha seleccionado como IN_GROUP DID la ruta, entonces esta es la lista de ID que lleva puede ser buscado a través de y que se lleva inserta en caso necesario. + +
+
+
+En el Grupo-ID de campaña - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el ID de campaña que lleva pueden ser buscadas en si la llamada es manejar método CIDLOOKUPRC. + +
+
+
+En el Grupo-Teléfono Código - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el Teléfono Código utilizarse si el plomo es un nuevo creado. + +



@@ -2645,36 +3883,42 @@ echo "



+ 0) + { + ?> +



-VICIDIAL_CAMPAIGN_HOTKEYS TABLA

- -
-Con el uso de los hot keys de encargo de la campaña, los agentes que utilizan el retraso vicidial de la lata del tela-cliente y la disposición llama apenas presionando una sola llave en su teclado. Hay dos opciones especiales que usted puede utilizar conjuntamente conel número de teléfono alterno que marca, ALTPH2 de HotKey - el dialcaliente del teléfono alterno y el dial caliente ADDR3-----Address3permiten que un agente utilice un hotkey al retraso su llamada,permanecen en el mismo plomo, y marcan otro número del contacto deese conducen. + VICIDIAL_CAMPAIGN_HOTKEYS TABLA

+
+
+ Con el uso de los hot keys de encargo de la campaña, los agentes que utilizan el retraso vicidial de la lata del tela-cliente y la disposición llama apenas presionando una sola llave en su teclado. Hay dos opciones especiales que usted puede utilizar conjuntamente conel número de teléfono alterno que marca, ALTPH2 de HotKey - el dialcaliente del teléfono alterno y el dial caliente ADDR3-----Address3permiten que un agente utilice un hotkey al retraso su llamada,permanecen en el mismo plomo, y marcan otro número del contacto deese conducen. -



+



-VICIDIAL_LEAD_RECYCLE TABLA

-
-
-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. + VICIDIAL_LEAD_RECYCLE TABLA

+
+
+ 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. -



- -ESTADOS AUTO DEL DIAL DE VICIDIAL ALT

-
-
-Si se fija el campo que marca del Alt-Nu'mero auto, después losplomos que son dispositioned bajo estos estados del dial del alt delautomóvil tendrán su alt_phone y-o los campos address3 marcadosdespués de que cualesquiera de estos ninguno-contesten a estados sefijan. +



+ ESTADOS AUTO DEL DIAL DE VICIDIAL ALT

+
+
+ Si se fija el campo que marca del Alt-Nu'mero auto, después losplomos que son dispositioned bajo estos estados del dial del alt delautomóvil tendrán su alt_phone y-o los campos address3 marcadosdespués de que cualesquiera de estos ninguno-contesten a estados sefijan. + @@ -2701,11 +3945,42 @@ echo "
Nombre de grupo - Ésta es la descripción del máximo vicidial del grupo de usuario de 40 caracteres. +
+ +
+FuerzaReloj de tiempo Login - Esta opción le permite no dejar que un agente acceder a la interfaz de agente VICIDIAL si no han iniciado sesión en el timeclock. El valor por defecto es N. Hay una opción para eximir a los usuarios de administración, los niveles 8 y 9. + +
+
+
+Cambio de título ejecutivo - Esta opción le permite restringir el acceso basado en agente de los cambios que se seleccione a continuación. NO no aplicará en todos los turnos. PRINCIPIO sólo hacer cumplir el tiempo de inicio de sesión, pero no afectará a un agente que se está ejecutando en su momento, si en cambio ya están conectado TODOS hará cumplir turnos hora de inicio y de registro de un agente a cabo después de que ellos tienen sobre el final de su cambio de tiempo. El valor predeterminado es desactivado. + +
+
+
+Grupo de cambios - Esta es una lista de cambios seleccionables que pueden limitar el tiempo de acceso de agentes en el sistema. +

Campañas permitidas - ésta es una lista seleccionable de lascampañas a las cuales los miembros de este grupo de usuario puedenabrirse una sesión. La opción de ALL-CAMPAIGNS permite que losusuarios en este grupo consideren y se abran una sesión a cualquiercampaña en el sistema. + 0) + { + ?> +
+
+
+ CC permitidas Campañas - Esta es una lista de seleccionables Campañas que los miembros de este grupo de usuarios podrá CC. El ALL-CAMPAÑAS opción permite a los usuarios en este grupo para cualquier campaña de control de la calidad en el sistema. + +
+
+
+ CC permitidas entrantes Grupos - Esta es una lista de seleccionables de entrada que los miembros de grupos de este grupo de usuarios podrá CC. TODOS LOS GRUPOS-La opción permite a los usuarios en este grupo de usuarios a cualquier entrada del grupo de CC en el sistema. + @@ -2743,25 +4018,31 @@ echo "



+ 0) + { + ?> +



-VICIDIAL_LEAD_FILTROS TABLA

- -
-Identificación del filtro - Éste es el nombre corto de un filtro del plomo de Vicidial. Éste necesita ser un identificador único. No utilice ningunos espacios o puntuación para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. + VICIDIAL_LEAD_FILTROS TABLA

+
+
+ Identificación del filtro - Éste es el nombre corto de un filtro del plomo de Vicidial. Éste necesita ser un identificador único. No utilice ningunos espacios o puntuación para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. -
-
-Nombre del filtro - éste es un nombre más descriptivo del filtro. Éste es un resumen corto de los caracteres del máximo 30 del filtro, mínimo de 2 caracteres. +
+
+ Nombre del filtro - éste es un nombre más descriptivo del filtro. Éste es un resumen corto de los caracteres del máximo 30 del filtro, mínimo de 2 caracteres. -
-
-El filtro comenta - aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. - -
-
-Filtro SQL - Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. +
+
+ El filtro comenta - aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. +
+
+ Filtro SQL - Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. + @@ -2802,43 +4083,75 @@ echo "\n";echo "\n"; -$stmt="SELECT admin_home_url from system_settings;"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; - -?> -
-



-FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL

- +VICIDIAL_SHIFTS TABLA

+

-El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para tomar un archivo del plomo - hasta 8MB de tamaño quees la lengüeta o la pipa delimitada y para cargarlo en la tabla delvicidial_list. El cargador del plomo permite el campo que elige y deTXT- el texto claramente, los valores separados coma de CSV- y XLS-sobresalen formatos del archivo. El cargador del plomo no hace lavalidación de datos, sino que permite que usted compruebe para sabersi hay duplicados en sí mismo, dentro de la campaña o dentro delsistema entero. También, cerciórese de que usted haya creado lalista que estos plomos son estar debajo de modo que usted puedautilizarlos. Aquí está una lista de los campos en su orden apropiadapara los archivos del plomo: -
    -
  1. Código del plomo del vendedor - demuestra para arriba en el campo de la identificación del vendedor del GUI -
  2. Código de fuente - uso interno solamente para los admins y DBAs -
  3. Identificación de la lista - el número de la lista que estos plomos demostrarán para arriba debajo -
  4. Código del teléfono - el prefijo para el teléfono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) -
  5. Número de teléfono - debe ser por lo menos 8 dígitos de largo -
  6. Título - título del customer(Mr. Ms señ., etc...) -
  7. Nombre -
  8. Inicial Media -
  9. Apellidos -
  10. Dirección, línea 1 -
  11. Dirección, línea 2 -
  12. Dirección, línea 3 -
  13. Ciudad -
  14. Estado - limitado a 2 caracteres -
  15. Provincia -
  16. Código Postal -
  17. País -
  18. Sexo -
  19. Fecha de nacimiento -
  20. Número De Teléfono Alternativo -
  21. Dirección Email -
  22. Frase De Seguridad -
  23. Comentarios -
+Cambio de ID - Este es el nombre corto de un Vicidial Mayús Definición. Este debe ser un identificador único. No utilice espacios ni puntuacion para este campo. 20 caracteres como máximo, mínimo de 2 caracteres. -
NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. También, los módulos de un Perl de los pares sedeben cargar para ella para trabajar también -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en éstos mirando suarchivo del error_log de apache. También, para los cheques deduplicación contra gampaign enumera, la lista que tiene nuevos plomosel entrar él necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. +
+
+Cambio de nombre - Este es un nombre más descriptivo de la Definición Mayúsculas. Este es un breve resumen de la definición Mayús. 50 caracteres como máximo, mínimo de 2 caracteres. + +
+
+Hora de inicio cambio - Este es el momento en que comienza la campaña por turnos. Sólo deben ser números, serían las 9:30 AM y 5:00 AM 0930 sería 1700. + +
+
+Longitud cambio - Este es el tiempo en horas y minutos que dura la campaña por turnos. 8 horas sería 08:00 y 7 horas y 30 minutos sería 07:30. + +
+
+Cambio semana - En esta sección usted debe elegir los días de la semana que este cambio está activo. + + + + 0) + { + ?> + +



+ + FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL

+
+
+ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para tomar un archivo del plomo - hasta 8MB de tamaño quees la lengüeta o la pipa delimitada y para cargarlo en la tabla delvicidial_list. El cargador del plomo permite el campo que elige y deTXT- el texto claramente, los valores separados coma de CSV- y XLS-sobresalen formatos del archivo. El cargador del plomo no hace lavalidación de datos, sino que permite que usted compruebe para sabersi hay duplicados en sí mismo, dentro de la campaña o dentro delsistema entero. También, cerciórese de que usted haya creado lalista que estos plomos son estar debajo de modo que usted puedautilizarlos. Aquí está una lista de los campos en su orden apropiadapara los archivos del plomo: +
    +
  1. Código del plomo del vendedor - demuestra para arriba en el campo de la identificación del vendedor del GUI +
  2. Código de fuente - uso interno solamente para los admins y DBAs +
  3. Identificación de la lista - el número de la lista que estos plomos demostrarán para arriba debajo +
  4. Código del teléfono - el prefijo para el teléfono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) +
  5. Número de teléfono - debe ser por lo menos 8 dígitos de largo +
  6. Título - título del customer(Mr. Ms señ., etc...) +
  7. Nombre +
  8. Inicial Media +
  9. Apellidos +
  10. Dirección, línea 1 +
  11. Dirección, línea 2 +
  12. Dirección, línea 3 +
  13. Ciudad +
  14. Estado - limitado a 2 caracteres +
  15. Provincia +
  16. Código Postal +
  17. País +
  18. Sexo +
  19. Fecha de nacimiento +
  20. Número De Teléfono Alternativo +
  21. Dirección Email +
  22. Frase De Seguridad +
  23. Comentarios +
+ +
NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. También, los módulos de un Perl de los pares sedeben cargar para ella para trabajar también -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en éstos mirando suarchivo del error_log de apache. También, para los cheques deduplicación contra gampaign enumera, la lista que tiene nuevos plomosel entrar él necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. -



- +



+ @@ -3179,6 +4492,58 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para
DBY viran - el puerto de MySQL hacia el lado de babor TCP que este usuario debe utilizar al conectar. El defecto es 3306. Secundario server, no utilizado actualmente. +
+
+
+Alias ID - el ID de los alias utilizados para permitir el balanceo de carga de teléfono de acceso. sin espacios ni otros caracteres especiales permitidos. Debe estar entre 2 y 20 caracteres de longitud. + +
+
+
+Alias Nombre - El nombre utilizado para describir un alias de teléfonos, debe ser entre 2 y 50 caracteres de longitud. + +
+
+
+Lista de teléfonos Logins - La lista separada por comas de teléfono de acceso utilizado cuando un agente en la utilización de registros de teléfono de acceso equilibrado de carga. El agente de aplicación se encuentra el servidor activo con el menor número de agentes registrados en él y hacer una llamada de ese servidor con el agente al inicio de sesión. + +
+
+
+Teléfonos E-mail - La dirección de correo electrónico asociada con la entrada de este teléfono. Esto se utiliza para configuraciones de buzón de voz. + +
+
+
+ID de la plantilla - Este es el archivo de configuración de plantilla ID que este teléfono va a utilizar para la entrada de su configuración de Asterisk. El valor por defecto es - Inexistencia --. + +
+
+
+Conf Override Settings - If populated, and the ID de plantilla 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. + +
+
+
+Grupo Alias ID - el ID del grupo de alias utilizado por los agentes a marcar llamadas desde la interfaz de agente VICIDIAL con diferentes números de identificación de llamadas. sin espacios ni otros caracteres especiales permitidos. Debe estar entre 2 y 20 caracteres de longitud. + +
+
+
+Grupo Alias Nombre - El nombre utilizado para describir un grupo de alias, debe ser entre 2 y 50 caracteres de longitud. + +
+
+
+Número de identificación de llamadas - el número de identificación de llamadas se utilizan en este Grupo de Alias. Debe ser sólo cifras. + +
+
+
+Nombre de identificación de llamadas - El nombre de identificación de llamadas que se pueden enviar a cabo con este grupo de alias. Por lo que sabemos esto sólo funcionará en Canadá en los circuitos del PRI y la utilización de un bucle troncal IAX de Asterisk a través de. + + +



@@ -3202,6 +4567,21 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para
Activo - fije si el servidor del asterisco es activo o inactivo. +
+
+
+Sistema de carga - Estas dos estadísticas muestran la loadavg veces de un sistema 100 y el porcentaje de uso de la CPU del servidor y se actualiza cada minuto. El loadavg debería ser en promedio por debajo de los 100 multiplicado por el número de núcleos de CPU de su sistema, para un rendimiento óptimo. El porcentaje de uso de la CPU debería permanecer por debajo de 50 para un rendimiento óptimo. + +
+
+
+Canales en vivo - Este campo muestra el número actual de canales que son de Asterisk en vivo en el sistema ahora. Es importante señalar que el número de canales de Asterisk es generalmente mucho mayor que el número de llamadas en un sistema. Este campo se actualiza una vez cada minuto. + +
+
+
+Uso del disco - Este campo mostrará el uso del disco para cada partición en este servidor. Este campo se actualiza una vez cada minuto. +

@@ -3212,6 +4592,11 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para
Troncos máximos de VICIDIAL - este campo determinará el número de las líneas máximo que el auto-dialer de VICIDIAL procurará invitar este servidor. Si usted desea dedicar dos PRI llenos T1 a VICIDIALing en un servidor entonces usted fijaría esto a 46. E1 defecto es 96. +
+
+
+Pide máximo por segundo - Esta configuración determina el número máximo de llamadas que pueden ser colocados por la salida de marcación automática de secuencia de comandos en este servidor por segundo. Debe ser de 1 a 100. El valor predeterminado es 20. +

@@ -3292,6 +4677,111 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para
Balance Offlimits de VICIDIAL - este ajuste define el número detroncos para no permitir el balance de VICIDIAL que marca parautilizar. Por ejemplo si usted tiene 40 troncos y offlimits vicidialmáximos del balance se fijan a 10 que usted podrá solamenteutilizar 30 líneas interurbanas para marcar del balance de VICIDIAL.El defecto es 0. +
+
+
+Grabación Web Link - Esta opción le permite ignorar el valor por defecto de la pantalla de la grabación enlace en la página web de administración. El valor predeterminado es server_ip. + +
+
+
+Grabación de IP del servidor alternativo - Este valor es donde usted puede poner un servidor IP o nombre de otra máquina que se puede utilizar en lugar de la server_ip en los enlaces a las grabaciones en el administrador de páginas web. Por defecto está vacío. + +
+
+
+Activa del servidor de Asterisk - de Asterisk Si no se está ejecutando en este servidor, o si VICIDIAL no deberían usar este servidor, o si sólo se utiliza este servidor para otros scripts como script de la tolva de carga que usted quiere hacer esto para N. El valor por defecto es Y. + +
+
+
+Generar los archivos de configuración - Si desea que el sistema de auto-generar conf asterisco archivos sobre la base de los teléfonos entradas, las entradas de transportista y balanceo de carga dentro de la configuración VICIDIAL luego a este valor por defecto es Y. Y. + +
+
+
+Reconstruir los archivos de configuración - Si desea forzar una reconstrucción de los archivos de configuración de Asterisk o si alguno de los teléfonos o transportista entradas han cambiado esto debe establecerse en Y. Después de la configuración de archivos se han generado y se ha de Asterisk luego se vuelve a cargar esta será cambiado a N. El valor por defecto es Y. + + + + + +



+ +vicidial_conf_templates TABLA

+
+
+ID de la plantilla - Este campo tiene que ser al menos de 2 caracteres de longitud y no más de 15 caracteres, sin espacios. Esta es la identificación que se utilizará para identificar la configuración de plantillas en todo el sistema. + +
+
+
+Nombre de la plantilla - Este es el nombre descriptivo de la plantilla de archivo de configuración de entrada. + +
+
+
+Plantilla de Contenido - Este campo es donde usted puede entrar en la configuración específica para ser utilizado por todos los teléfonos o los transportistas y que están configurados para utilizar esta plantilla conf. Campos que no deben incluirse en este cuadro son: secreto, accountcode, cuenta, el nombre de usuario y buzón de correo. + + + + + +



+ +vicidial_server_carriers TABLA

+
+
+Portador de Identificación - Este campo tiene que ser al menos de 2 caracteres de longitud y no más de 15 caracteres, sin espacios. Esta es la identificación que se utilizará para identificar el soporte de esta entrada a través del sistema. + +
+
+
+Nombre del transportista - Este es el nombre descriptivo de la compañía entrada. + +
+
+
+Registro de cadena - Este campo es donde usted puede entrar en la cadena exacta necesaria en el SIP o IAX archivo de configuración de registro para el proveedor. Opcional, pero altamente recomendable si tu proveedor permite el registro. + +
+
+
+Plantilla ID - Este campo opcional permite elegir un archivo de configuración de plantilla para esta compañía aérea de entrada. + +
+
+
+Cuenta Entrar - Este campo se usa si no ha seleccionado una plantilla de usar, y es donde puede entrar en la configuración de la cuenta específica que se utilizará para esta compañía aérea. Si va a tomar en las llamadas entrantes de esta compañía aérea tronco es posible que desee establecer el contexto = trunkinbound dentro de este ámbito de modo que usted puede usar el proceso de tramitación de DID en VICIDIAL. + +
+
+
+Protocolo - Este campo le permite definir el protocolo a utilizar para el transportista entrada. Actualmente, sólo IAX y SIP son compatibles. + +
+
+
+Globals String - Este campo opcional le permite definir una variable global a utilizar para el transportista en el dialplan. + +
+
+
+Entrada Dialplan - Este campo opcional le permite definir un conjunto de entradas dialplan a usar para esta compañía aérea. + +
+
+
+IP del servidor - Este es el servidor que soporte este registro está asociado con. + +
+
+
+Activo - Esto define si el transportista se incluirán en la auto-generado o no los archivos de conf. + + + +



@@ -3308,13 +4798,19 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para -



- -VICIDIAL_SERVER_TRUNKS TABLA

-
-
-Los troncos del servidor de VICIDIAL permiten que usted restrinja laslíneas salientes que se utilizan en este servidor para la campañaque marca sobre una base de la por-campaña. Usted tiene la opciónpara reservar un número de las líneas específico que se utilizaránpor solamente una campaña así como permitir que esa campañafuncione sobre sus líneas reservadas en cualesquiera líneas siguensiendo abiertas, según lo en las líneas totales usadas por vicidialen este servidor es de largo menos que fijar de los troncos delmáximo VICIDIAL. No tener cualesquiera de estos expedientespermitirá la campaña que marca la línea primero para tener tantaslíneas mientras que puede conseguir bajo fijar de los troncos delmáximo VICIDIAL. + 0) + { + ?> +



+ VICIDIAL_SERVER_TRONCOS TABLA

+
+
+ Los troncos del servidor de VICIDIAL permiten que usted restrinja laslíneas salientes que se utilizan en este servidor para la campañaque marca sobre una base de la por-campaña. Usted tiene la opciónpara reservar un número de las líneas específico que se utilizaránpor solamente una campaña así como permitir que esa campañafuncione sobre sus líneas reservadas en cualesquiera líneas siguensiendo abiertas, según lo en las líneas totales usadas por vicidialen este servidor es de largo menos que fijar de los troncos delmáximo VICIDIAL. No tener cualesquiera de estos expedientespermitirá la campaña que marca la línea primero para tener tantaslíneas mientras que puede conseguir bajo fijar de los troncos delmáximo VICIDIAL. + @@ -3331,6 +4827,99 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para
Webroot escribible - este ajuste permite que usted defina si losarchivos de la temperatura y los archivos de la autentificación seancolocados en el webroot en su web server. El defecto es 1. +
+
+
+El agente de VICIDIAL inhabilita la exhibición - este campo seutiliza para seleccionar cuando demostrar a un agente cuando susesión ha sido inhabilitada por el sistema, una acción del encargadoo por una medida externa. El ajuste de NOT_ACTIVE inhabilitará elmensaje en la pantalla de los agentes. El ajuste de LIVE_AGENTexhibirá solamente el mensaje lisiado cuando se ha quitado elexpediente de los vicidial_auto_calls de los agentes, por ejemplodurante un registro de estado de la máquina de la fuerza o registrode estado de la máquina de la emergencia. + +
+
+
+Permita los mensajes de SIPSAK - si el sistema a 1, éste permite queel ajuste de la tabla de los teléfonos trabaje correctamente, elservidor enviará mensajes al teléfono del SIP a la exhibición en laexhibición del LCD del teléfono cuando está registrado en VICIDIAL.Esta característica trabaja solamente con los teléfonos del SIP yrequiere el uso del sipsak ser instalada en el web server. El defectoes 0. + +
+
+
+Agente de la API de Activo - Si se pone a 1, esto permitirá a la interfaz API de agente para su funcionamiento. Por defecto es 0. + +
+
+
+URL casero del Admin - ésta es la dirección del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. + +
+
+
+Permita el logfile de la transferencia del agente - esta opciónregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. + +
+
+
+Reloj de tiempo Fin de Día - Este ajuste define cuando todos los usuarios se van a auto cerrado la sesión de la timeclock sistema. Sólo se ejecuta una vez al día. debe ser sólo el 4 dígitos dígitos 2 horas y 2 minutos en cifras de 24 horas. Por defecto es 0000. + +
+
+
+Última sesiónReloj de tiempo Auto - Este campo muestra la fecha de la última sesión de auto -. + +
+
+
+Agente de la pantalla de encabezado Formato de fecha - Este menú le permite elegir el formato de la fecha que aparece en la parte superior de la pantalla VICIDIAL agente. Las opciones para este ajuste son los siguientes: el valor predeterminado es MS_DASH_24HR
+MS_DASH_24HR 2008-06-24 23:59:59 - Por defecto el formato de fecha con el año mes día seguido por 24 horas
+US_SLASH_24HR 06/24/2008 23:59:59 - EE.UU. fecha con el formato mes día año seguido por 24 horas
+EU_SLASH_24HR 24/06/2008 23:59:59 - Europea con el formato de fecha día mes año seguido por 24 horas
+AL_TEXT_24HR JUN 24 23:59:59 - Texto con formato de fecha abreviado mes día seguido por 24 horas
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Por defecto el formato de fecha con el año mes día seguido por 12 horas
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - EE.UU. fecha con el formato mes día año seguido por 12 horas
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europea con el formato de fecha día mes año seguido por 12 horas
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Texto con formato de fecha abreviado mes día seguido por 12 horas
+ +
+
+
+Agente del cliente Fecha Formato de pantalla - Este menú le permite elegir el formato de la fecha los clientes de zona horaria que aparece en la parte superior de la sección de información al cliente de la agencia de VICIDIAL pantalla. Las opciones para este ajuste son los siguientes: el valor predeterminado es AL_TEXT_AMPM
+MS_DASH_24HR 2008-06-24 23:59:59 - Por defecto el formato de fecha con el año mes día seguido por 24 horas
+US_SLASH_24HR 06/24/2008 23:59:59 - EE.UU. fecha con el formato mes día año seguido por 24 horas
+EU_SLASH_24HR 24/06/2008 23:59:59 - Europea con el formato de fecha día mes año seguido por 24 horas
+AL_TEXT_24HR JUN 24 23:59:59 - Texto con formato de fecha abreviado mes día seguido por 24 horas
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Por defecto el formato de fecha con el año mes día seguido por 12 horas
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - EE.UU. fecha con el formato mes día año seguido por 12 horas
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europea con el formato de fecha día mes año seguido por 12 horas
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Texto con formato de fecha abreviado mes día seguido por 12 horas
+ +
+
+
+Agente Cliente Teléfono Formato de pantalla - Este menú le permite elegir el formato del cliente el número de teléfono que aparece en el estado de la agente VICIDIAL pantalla. Las opciones para este ajuste son los siguientes: el valor predeterminado es US_PARN
+US_DASH 000-000-0000 - USA guión separado el número de teléfono
+US_PARN (000)000-0000 - USA guión separados número con código de área entre paréntesis
+MS_NODS 0000000000 - N de formato
+UK_DASH 00 0000-0000 - UK guión separado el número de teléfono con el espacio después del código de ciudad
+AU_SPAC 000 000 000 - Australia espacio separado el número de teléfono
+IT_DASH 0000-000-000 - Italy guión separado el número de teléfono
+FR_SPAC 00 00 00 00 00 - France espacio separado el número de teléfono
+ +
+
+
+Agent interface API Access Activo - This option allows you to enable or disable the agent interface API. Default is 0. + +
+
+
+Características de Activo CC - Esta opción le permite activar o desactivar el control de la calidad o las características de Control de Calidad. El valor por defecto es 0 para inactivos. + +
+
+
+Salida de marcación automática de Activo - Esta opción le permite activar o desactivar la marcación automática de salida dentro de VICIDIAL, en este campo a 0 se eliminará de las listas y FILTROS secciones y muchos campos de la Campaña Modificación pantallas. Manual de entrada de marcación seguirá siendo permitida dentro de la agente de la pantalla, lista de marcación, pero no será posible. El valor predeterminado es 1 para los activos. + +
+
+
+Max LLENAR Pide por segundo - Esta configuración determina el número máximo de llamadas que pueden ser colocados por la auto-LLENAR salida de marcación automática de secuencia de comandos de todos los servidores, por segundo. Debe ser de 1 a 200. El valor predeterminado es 40. +

@@ -3372,27 +4961,34 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para QueueMetrics EnterQueue prepend - este campo se utiliza para permitirprepending de una de las zonas de informaciones del vicidial_listdelante del número de teléfono del cliente para los informesmodificados para requisitos particulares de QueueMetrics. El defectono es NINGUNO no poblar cualquier cosa.
-
+
-El agente de VICIDIAL inhabilita la exhibición - este campo seutiliza para seleccionar cuando demostrar a un agente cuando susesión ha sido inhabilitada por el sistema, una acción del encargadoo por una medida externa. El ajuste de NOT_ACTIVE inhabilitará elmensaje en la pantalla de los agentes. El ajuste de LIVE_AGENTexhibirá solamente el mensaje lisiado cuando se ha quitado elexpediente de los vicidial_auto_calls de los agentes, por ejemplodurante un registro de estado de la máquina de la fuerza o registrode estado de la máquina de la emergencia. +Habilitar Vtiger Integración - Este ajuste le permite activar Vtiger integración con VICIDIAL. Actualmente enlaces a Vtiger administración y búsqueda de usuarios, así como la reproducción son las únicas características disponibles integración. Por defecto es 0.
-
+
-Permita los mensajes de SIPSAK - si el sistema a 1, éste permite queel ajuste de la tabla de los teléfonos trabaje correctamente, elservidor enviará mensajes al teléfono del SIP a la exhibición en laexhibición del LCD del teléfono cuando está registrado en VICIDIAL.Esta característica trabaja solamente con los teléfonos del SIP yrequiere el uso del sipsak ser instalada en el web server. El defectoes 0. +PP Vtiger IP del servidor - Este es la dirección IP de la base de datos para su instalación Vtiger.
-
+
-URL casero del Admin - ésta es la dirección del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. +Vtiger nombre de base de datos - Este es el nombre de base de datos para su base de datos Vtiger.
-
+
-Permita el logfile de la transferencia del agente - esta opciónregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. - +Base de datos de inicio de sesión Vtiger - Este es el nombre de usuario utilizado para acceder a su base de datos Vtiger. +
+
+
+Base de datos Vtiger Contraseña - Esta es la contraseña utilizada para acceder a su base de datos Vtiger. +
+
+
+Vtiger URL - Este es el URL o dirección del sitio web utilizado para acceder a tu Vtiger instalación.



@@ -3408,9 +5004,23 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para VICIDIAL_STATUS_CATEGORIES TABLA


-Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificación de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripción es opcional y la exhibiciónde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD. +Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificación de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripción es opcional y la exhibiciónde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD. La venta y Categoría Categoría Principal Muerto son utilizados tanto por el sistema de lista de sugerencias en el análisis de estadísticas de la lista. + 0) + { + ?> +



+ + CÓDIGOS DE ESTADO VICIDIAL CC

+
+
+ El Control de Calidad, sistema de control de calidad dentro de VICIDIAL tiene su propio conjunto de códigos de estado separados de los de la gestión de llamadas de funciones VICIDIAL. CC statuse códigos debe estar entre 2 y 8 caracteres de longitud y no contienen caracteres especiales, como un espacio o de colon. El código de estado de CC descripción debe estar entre 2 y 30 caracteres de longitud. + +







@@ -3509,7 +5119,7 @@ if ($ADD==73) ###################### if ($ADD==7111111) -{ + { ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; @@ -3549,459 +5159,115 @@ if ($ADD==7111111) $RGSIPexten = 'SIP/gs102'; $RGsession_id = '8600051'; -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; + $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = $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); + 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); + } + + $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("\n","
",$script_text); + + + echo ""; + + echo "Escritura De la Inspección previo: $script_id
\n"; + echo "
\n"; + echo "
$script_name
\n"; + echo "$script_text\n"; + echo "
\n"; + + echo "\n"; + + exit; } -$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("\n","
",$script_text); - -echo ""; - -echo "Escritura De la Inspección previo: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') - {$users_hh="bgcolor =\"$users_color\""; $users_fc="$users_font"; $users_bold="$header_selected_bold";} - else {$users_hh=''; $users_fc='WHITE'; $users_bold="$header_nonselected_bold";} -if ($hh=='campaigns') - {$campaigns_hh="bgcolor=\"$campaigns_color\""; $campaigns_fc="$campaigns_font"; $campaigns_bold="$header_selected_bold";} - else {$campaigns_hh=''; $campaigns_fc='WHITE'; $campaigns_bold="$header_nonselected_bold";} -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 ($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 "
English Español
BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> - - - - - - - - - - - - - - - 1) { - ?> -> - 1) - { - -# if ($sh=='basic') {$basic_sh="bgcolor=\"$subcamp_color\""; $basic_fc="$subcamp_font";} -# else {$basic_sh=''; $basic_fc='BLACK';} -# if ($sh=='detail') {$detail_sh="bgcolor=\"$subcamp_color\""; $detail_fc="$subcamp_font";} -# else {$detail_sh=''; $detail_fc='BLACK';} -# if ($sh=='dialstat') {$dialstat_sh="bgcolor=\"$subcamp_color\""; $dialstat_fc="$subcamp_font";} -# else {$dialstat_sh=''; $dialstat_fc='BLACK';} - - 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';} - - ?> -> - - - - - - - - - 1) { - ?> - > - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # hard teal - else {$times_sh=''; $times_fc='BLACK';} - if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink - else {$phones_sh=''; $phones_fc='BLACK';} - if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink - else {$server_sh=''; $server_fc='BLACK';} - if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink - else {$conference_sh=''; $conference_fc='BLACK';} - if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink - else {$settings_sh=''; $settings_fc='BLACK';} - if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink - else {$status_sh=''; $status_fc='BLACK';} - - ?> -> - - - - - - - - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - \n"; - echo "Le no autorizan a visión esta página. Vaya por favor detrás.\n"; - } - -} -if (strlen($reports_hh) > 1) { - ?> -> - - - - -
  VICIDIAL ADMIN - CASERO | Salir  
> SIZE=> Usuarios > SIZE=> Campañas > SIZE=> Listas > SIZE=> Escrituras > SIZE=> Filtros > SIZE=> En-Grupos > SIZE=> Grupos De Usuario > SIZE=> Agentes Alejados > SIZE=> Admin > SIZE=> Informes
>   > Demuestre A Usuarios     |     > Agregue A Nuevo Usuario     |     > Usuario Del Copy     |     > Búsqueda Para Un Usuario
COLSPAN=2> SIZE=>Campañas Principales COLSPAN=1> SIZE=> Statuses COLSPAN=1> SIZE=> HotKeys COLSPAN=2> SIZE=>El Plomo Recicla COLSPAN=1> SIZE=>Dial Automo'vil-Auto-Alt COLSPAN=1> SIZE=>Códigos De la Pausa COLSPAN=2> SIZE=>Mezcla De la Lista
>   > Demuestre Las Campañas     |     > Agregue Una Nueva Campaña     |     > Campaña Del Copy     |     > Campañas En tiempo real Sumarias
>   > Demuestre Las Listas     |     > Agregue Una Nueva Lista     |     > Búsqueda Para Un Plomo     |     > Agregue El Número a DNC     |     > Nuevos Plomos De la Carga
>   > Demuestre Las Escrituras     |     > Agregue Una Nueva Escritura
>   > Demuestre Los Filtros     |     > Agregue Un Filtro Nuevo
>   > Demuestre A En-Grupos     |     > Agregue A Nuevo En-Grupo     |     > En-Grupo Del Copy
>   > Demuestre A Grupos De Usuario     |     > Agregue A Nuevo Grupo De Usuario     |     > Informe Cada hora Del Grupo
>   > Demuestre Los Agentes Alejados     |     > Agregue Los Agentes Alejados Nuevos
COLSPAN=2> SIZE=> Tiempos De la Llamada COLSPAN=2> SIZE=> Teléfonos COLSPAN=2> SIZE=> Conferencias COLSPAN=1> SIZE=> Servidores COLSPAN=1> SIZE=> Ajustes Del Sistema COLSPAN=2> SIZE=>Estados De Sistema
>   > Demuestre Los Tiempos De la Llamada     |     > Agregue Un Nuevo Rato De la Llamada     |     > Demuestre Los Tiempos De la Llamada Del Estado     |     > Agregue Un Nuevo Rato De la Llamada Del Estado  
>   > Demuestre Los Teléfonos   |   > Agregue Un Teléfono Nuevo
> Demuestre Las Conferencias   |   > Agregue Una Nueva Conferencia   |   > Demuestre Las Conferencias de VICIDIAL   |   > Agregue Una Nueva Conferencia de VICIDIAL
> Demuestre Los Servidores   |   > Agregue Un Servidor Nuevo
> Ajustes Del Sistema
>Estados De Sistema   |   >Categorías Del Estado
>  
- 1) { ###################### if ($ADD=="1") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; - - echo "
NUEVO USUARIO
\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE
Grupo Del Usuario: \n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
\n"; + echo ""; + + echo "
NUEVO USUARIO \n"; + echo "\n"; + echo "\n"; + echo "
\n"; + 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 De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE
Grupo Del Usuario:
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
\n"; } - echo "$Ugroups_list"; - echo "\n"; - echo "
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
\n"; - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### -# ADD=1 display the COPY USER FORM SCREEN +# ADD=1A display the COPY USER FORM SCREEN ###################### if ($ADD=="1A") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_users==1) + { + echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
USUARIO DEL COPY\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
USUARIO DEL COPY\n"; + echo "\n"; + echo "\n"; + echo "
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} - echo "\n"; + echo "\n"; + echo "
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Source User:
Source Usuario: $NWB#vicidial_users-user$NWE
\n"; } - echo "$Uusers_list"; - echo "$NWB#vicidial_users-user$NWE
\n"; - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4120,41 +5390,49 @@ if ($ADD=="1A") ###################### if ($ADD==11) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUEVA CAMPAÑA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\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 la Campaña: $NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Escritura: $NWB#vicidial_campaigns-campaign_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - } + echo "
NUEVA CAMPAÑA\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"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID De la Campaña: $NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Escritura: $NWB#vicidial_campaigns-campaign_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4162,19 +5440,19 @@ if ($ADD==11) ###################### if ($ADD==12) -{ - if ($LOGmodify_campaigns==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_campaigns==1) + { + echo "\n"; - - echo "\n"; - echo "
\n"; + echo ""; - echo "
Copy Una CAMPAÑA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
CopiarUna CAMPAÑA\n"; + echo "\n"; + echo "
ID De la Campaña: $NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID De la Campaña: $NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Campaña De la Fuente:
Campaña De la Fuente:$NWB#vicidial_campaigns-campaign_id$NWE
NOTA: Copia de una campaña de copiar todos los ajustes del maestro campaña que seleccione, pero no va a copiar una campaña específica de DNC lista si hay un maestro seleccionado en la campaña.
\n"; } - echo "$campaigns_list"; - echo "$NWB#vicidial_campaigns-campaign_id$NWE
\n"; - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4206,19 +5486,19 @@ if ($ADD==12) ###################### if ($ADD==111) -{ - if ($LOGmodify_lists==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; - echo "
ADD A NEW LIST\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID De la Lista: (Solamente dígitos)$NWB#vicidial_lists-list_id$NWE
Nombre De la Lista: $NWB#vicidial_lists-list_name$NWE
Descripción De la Lista: $NWB#vicidial_lists-list_description$NWE
Campaña: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID De la Lista: (Solamente dígitos)$NWB#vicidial_lists-list_id$NWE
Nombre De la Lista: $NWB#vicidial_lists-list_name$NWE
Descripción De la Lista: $NWB#vicidial_lists-list_description$NWE
Campaña: $NWB#vicidial_lists-campaign_id$NWE
Activo: $NWB#vicidial_lists-active$NWE
\n"; } - echo "$campaigns_list"; - echo "\n"; - echo "$NWB#vicidial_lists-campaign_id$NWE
Activo: $NWB#vicidial_lists-active$NWE
\n"; - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4251,79 +5532,128 @@ if ($ADD==111) ###################### if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + echo "
\n"; + echo ""; + + $campaigns_list = "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id"; $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NO AGREGADO - este número de teléfono está en no llama ya lalista: $phone_number

\n";} - else + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; + } - echo "
DNC AGREGADO: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); + 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 "
DNC NO AGREGADO - este número de teléfono está en no llama ya lalista: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC AGREGADO: $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 AGREGUE EL NÚMERO A 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] > 0) + {echo "
DNC NO AGREGADO - este número de teléfono está en no llama ya lalista: $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 "
DNC AGREGADO: $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 CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; } } + + echo "
Añadir números a la DNC LISTA\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Números de teléfono:

(un número de teléfono por línea sólo)
$NWB#vicidial_list-dnc$NWE
\n"; } -echo "
AGREGUE Un NÚMERO A la LISTA De DNC\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Número De Teléfono: (Solamente dígitos)$NWB#vicidial_list-dnc$NWE
\n"; - -} - ###################### # ADD=1111 display the ADD NEW INBOUND GROUP SCREEN ###################### if ($ADD==1111) -{ + { if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUEVO GRUPO DE ENTRADA\n"; - echo "\n"; - echo "
\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 Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Activo: $NWB#vicidial_inbound_groups-active$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Escritura: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } + echo "
NUEVO GRUPO DE ENTRADA\n"; + echo "\n"; + echo "
\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 Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Activo: $NWB#vicidial_inbound_groups-active$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Escritura: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4331,19 +5661,19 @@ if ($ADD==1111) ###################### if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_ingroups==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
GRUPO DE ENTRADA DEL COPY\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
GRUPO DE ENTRADA DEL COPY\n"; + echo "\n"; + echo "
ID De Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$groups_list"; + echo "$NWB#vicidial_inbound_groups-group_id$NWE\n"; - echo "\n"; - echo "
ID De Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Source ID De Grupo:
Source ID De Grupo: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } + echo "
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
AGREGAR UN NUEVO DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
DID Extensión: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + +###################### +# ADD=1411 display the COPY DID SCREEN +###################### + +if ($ADD==1411) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
COPIA DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
DID Extensión: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
Fuente DID:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4375,38 +5778,38 @@ if ($ADD==1211) ###################### if ($ADD==11111) -{ + { if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUEVO AGENTE REMOTO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensión Externa: (número del dial plan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Estado: $NWB#vicidial_remote_agents-status$NWE
Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos De entrada: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - } + echo "
NUEVO AGENTE REMOTO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensión Externa: (número del dial plan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Estado: $NWB#vicidial_remote_agents-status$NWE
Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos De entrada: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4414,26 +5817,26 @@ if ($ADD==11111) ###################### if ($ADD==111111) -{ + { if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUEVO GRUPO DE USUARIOS\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } + echo "
NUEVO GRUPO DE USUARIOS\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4441,72 +5844,72 @@ if ($ADD==111111) ###################### if ($ADD==1111111) -{ + { if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Identificación De la Escritura:: (sin espacios o signos de puntuación)$NWB#vicidial_scripts-script_id$NWE
Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
Activo: $NWB#vicidial_scripts-active$NWE
Texto de la escritura: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Identificación De la Escritura:: (sin espacios o signos de puntuación)$NWB#vicidial_scripts-script_id$NWE
Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
Activo: $NWB#vicidial_scripts-active$NWE
Texto de la escritura: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4514,28 +5917,28 @@ if ($ADD==1111111) ###################### if ($ADD==11111111) -{ + { if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGREGUE EL FILTRO NUEVO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Identificación Del Filtro: (sin espacios o signos de puntuación)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } + echo "
AGREGUE EL FILTRO NUEVO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Identificación Del Filtro: (sin espacios o signos de puntuación)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4543,29 +5946,29 @@ if ($ADD==11111111) ###################### if ($ADD==111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA\n"; + echo "\n"; + echo "
Identificación Del Tiempo De la Llamada: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Identificación Del Tiempo De la Llamada: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; - } + echo "
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4573,30 +5976,70 @@ if ($ADD==111111111) ###################### if ($ADD==1111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO\n"; + echo "\n"; + echo "
Identificación Del Tiempo De la Llamada Del Estado: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Identificación Del Tiempo De la Llamada Del Estado: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; - } + echo "
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión 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 "
Cambio ID: (sin espacios o signos de puntuación)$NWB#vicidial_shifts-shift_id$NWE
Cambio de nombre: (breve descripción del cambio)$NWB#vicidial_shifts-shift_name$NWE
Cambio Hora de inicio:\n"; + echo "   Cambio Hora de finalización:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Longitud cambio: $NWB#vicidial_shifts-shift_length$NWE
Cambio semana:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Domingo
\n"; + echo "Lunes
\n"; + echo "Martes
\n"; + echo "Miércoles
\n"; + echo "Jueves
\n"; + echo "Viernes
\n"; + echo "Sábado
\n"; + echo "
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4604,47 +6047,111 @@ if ($ADD==1111111111) ###################### if ($ADD==11111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGREGUE Un TELÉFONO NUEVO\n"; - echo "\n"; - echo "
\n"; + echo "
AGREGUE Un TELÉFONO NUEVO\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Buzón de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Caja de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión 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 "
AGREGAR UN NUEVO TELÉFONO ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias ID:$NWB#phones-alias_id$NWE
Alias Nombre: $NWB#phones-alias_name$NWE
Teléfono Logins Lista: (comma separated)$NWB#phones-logins_list$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión 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 "
AGREGAR UN NUEVO GRUPO DE ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias ID Grupo: $NWB#phones-group_alias_id$NWE
Grupo Alias Nombre: $NWB#phones-group_alias_name$NWE
Número CallerID: $NWB#phones-caller_id_number$NWE
Nombre CallerID: $NWB#phones-caller_id_name$NWE
Activo:
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4652,29 +6159,127 @@ if ($ADD==11111111111) ###################### if ($ADD==111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGREGAR Un SERVIDOR NUEVO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
\n"; - } + echo "
AGREGAR Un SERVIDOR NUEVO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión 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 "
Añadir CONF NUEVA PLANTILLA\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Plantilla ID: $NWB#vicidial_conf_templates-template_id$NWE
Nombre de plantilla: $NWB#vicidial_conf_templates-template_name$NWE
Plantilla de contenidos: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
Añadir nueva compañía\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Portador de Identificación: $NWB#vicidial_server_carriers-carrier_id$NWE
Transportista Nombre: $NWB#vicidial_server_carriers-carrier_name$NWE
Cadena de registro: $NWB#vicidial_server_carriers-registration_string$NWE
Plantilla ID: $NWB#vicidial_server_carriers-template_id$NWE
Cuenta Entrada: $NWB#vicidial_server_carriers-account_entry$NWE
Protocolo: $NWB#vicidial_server_carriers-protocol$NWE
Globals Serie de caracteres: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entrada: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Del Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4682,30 +6287,30 @@ if ($ADD==111111111111) ###################### if ($ADD==1111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGREGUE Una NUEVA CONFERENCIA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} ###################### @@ -4713,30 +6318,30 @@ if ($ADD==1111111111111) ###################### if ($ADD==11111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW VICIDIAL CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} @@ -4752,7 +6357,7 @@ if ($ADD==11111111111111) ###################### if ($ADD=="2") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4761,38 +6366,265 @@ if ($ADD=="2") {echo "
USUARIO NO AGREGADO - hay ya un usuario en el sistema con este número del usuario\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if (ereg('AUTOGENERA',$user)) + { + $user = 'AUTOGENERA'; + } + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID del usuario debe estar entre 2 y 8 caracteres de largo\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
el nombre completo y la contraseña deben ser por lo menos 2 caracteres de largo\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 "
EL USUARIOAÑADIDO: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USUARIOS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); + $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 = 'Activo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=3; + } ###################### # ADD=2A adds the copied new user to the system ###################### if ($ADD=="2A") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -4801,15 +6633,53 @@ if ($ADD=="2A") {echo "
USUARIO NO AGREGADO - hay ya un usuario en el sistema con este número del usuario\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) { echo "
USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID del usuario debe estar entre 2 y 8 caracteres de largo\n"; + echo "
user id must be between 2 and 10 characters long\n"; echo "
el nombre completo y la contraseña deben ser por lo menos 2 caracteres de largo\n"; + echo "\n"; } else { - $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) 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 from vicidial_users where user=\"$source_user_id\";"; + 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) 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 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\";"; @@ -4818,30 +6688,216 @@ if ($ADD=="2A") $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='USUARIOS', event_type='COPY', record_id='$user', event_code='ADMIN USUARIO DEL COPY', 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 = 'Activo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A COPIED USER |$PHP_AUTH_USER|$ip|$user|$source_user_id|$stmt|\n"); - fclose($fp); - } } } -exit; -} + exit; + } ###################### # ADD=21 adds the new campaign to the system ###################### if ($ADD==21) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4870,31 +6926,28 @@ if ($ADD==21) $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) 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); - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $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='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA ', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } } } -$ADD=31; -} + $ADD=31; + } ###################### # ADD=20 adds copied new campaign to the system ###################### if ($ADD==20) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4913,7 +6966,7 @@ if ($ADD==20) { echo "
CAMPAIGN 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,safe_harbor_message,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) 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,safe_harbor_message,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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $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) 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 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');"; @@ -4931,27 +6984,24 @@ if ($ADD==20) $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); - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY TO NEW CAMPAIGN|$PHP_AUTH_USER|$ip|$campaign_id|$source_campaign_id|$stmt|$stmtA|\n"); - fclose($fp); - } - + ### 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='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=31; -} + $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';"; $rslt=mysql_query($stmt, $link); @@ -4980,19 +7030,19 @@ if ($ADD==22) $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA STATUS', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$SUB=22; -$ADD=31; -} + $SUB=22; + $ADD=31; + } ###################### @@ -5000,7 +7050,7 @@ $ADD=31; ###################### if ($ADD==23) -{ + { $HKstatus_data = explode('-----',$HKstatus); $status = $HKstatus_data[0]; $status_name = $HKstatus_data[1]; @@ -5026,18 +7076,18 @@ if ($ADD==23) $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA HOT KEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA HOTKEY', event_sql=\"$SQL_log\", event_notes='Estado: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=23; -$ADD=31; -} + $SUB=23; + $ADD=31; + } ###################### @@ -5045,7 +7095,7 @@ $ADD=31; ###################### if ($ADD==25) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; @@ -5055,11 +7105,11 @@ if ($ADD==25) {echo "
El PLOMO de la CAMPAÑA RECICLA NO AGREGADO - hay ya unconducir-reciclaje para esta campaña con este estado\n";} else { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
CAMPAIGN LEAD RECYCLE NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos y menos de 43.200 segundos o 12 horas\n"; echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; } else @@ -5069,18 +7119,18 @@ if ($ADD==25) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=25; -$ADD=31; -} + $SUB=25; + $ADD=31; + } ###################### @@ -5088,7 +7138,7 @@ $ADD=31; ###################### 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 %\";"; @@ -5116,18 +7166,18 @@ if ($ADD==26) $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A AUTO-ALT-DIAL STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA ALT DIAL', event_sql=\"$SQL_log\", event_notes='Estado: $auto_alt_dial_statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=26; -$ADD=31; -} + $SUB=26; + $ADD=31; + } ###################### @@ -5135,7 +7185,7 @@ $ADD=31; ###################### 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); @@ -5148,7 +7198,7 @@ if ($ADD==27) { echo "
CÓDIGO DE LA PAUSA DEL AGENTE NO AGREGADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
pause code must be between 1 and 6 characters in length\n"; - echo "
pause code name must be between 2 and 30 characters in length\n"; + echo "
pause nombre de código debe estar entre 2 y 30 caracteres de longitud\n"; } else { @@ -5157,18 +7207,18 @@ if ($ADD==27) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW AGENTE PAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Código De la Pausa: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=27; -$ADD=31; -} + $SUB=27; + $ADD=31; + } ###################### @@ -5176,7 +7226,7 @@ $ADD=31; ###################### if ($ADD==28) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; @@ -5204,18 +7254,18 @@ if ($ADD==28) $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA DIAL STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Estado: $statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -#$SUB=28; -$ADD=31; -} + #$SUB=28; + $ADD=31; + } ###################### @@ -5223,7 +7273,7 @@ $ADD=31; ###################### if ($ADD==211) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); @@ -5246,17 +7296,17 @@ if ($ADD==211) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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=311; + } @@ -5265,7 +7315,7 @@ $ADD=311; ###################### if ($ADD==2111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5292,20 +7342,23 @@ if ($ADD==2111) $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) 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 AÑADIDO: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 Entrantes GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=3111; -} + $ADD=3111; + } ###################### @@ -5313,7 +7366,7 @@ $ADD=3111; ###################### if ($ADD==2011) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -5330,22 +7383,118 @@ if ($ADD==2011) } 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_message,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) 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_message,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
GRUPO AÑADIDO: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 GRUPO DE ENTRADA DEL COPY', 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 "
DIDNOT AÑADIDO - ya hay un DID en el sistema con este ID\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 "
DIDNOT AÑADIDO - ya hay un DID en el sistema con esta extensión\n";} + else + { + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPIED TO NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
DIDNOT AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\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=3111; -} + $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 "
DIDNOT AÑADIDO - ya hay un DID en el sistema con esta extensión\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 "
DIDNOT AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\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) 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 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 COPIA DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3311; + } ###################### @@ -5353,7 +7502,7 @@ $ADD=3111; ###################### 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); @@ -5374,24 +7523,24 @@ if ($ADD==21111) echo "
AGENTES REMOTO AÑADIDO: $user_start\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } + ### 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=10000; + } ###################### # ADD=211111 adds new user group to the system ###################### if ($ADD==211111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); @@ -5412,24 +7561,100 @@ if ($ADD==211111) echo "
GRUPO DE USUARIO AÑADIDO: $user_group\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 NUEVO GRUPO DE USUARIO', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVO USUARIO GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=100000; + } ###################### # ADD=2111111 adds new script to the system ###################### if ($ADD==2111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); @@ -5450,17 +7675,17 @@ if ($ADD==2111111) echo "
ESCRITURA AGREGADA: $script_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ESCRITURAS', event_type='ADD', record_id='$script_id', event_code='ADMIN AGREGUE LA ESCRITURA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=1000000; -} + $ADD=1000000; + } ###################### @@ -5468,7 +7693,7 @@ $ADD=1000000; ###################### if ($ADD==21111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); @@ -5489,17 +7714,17 @@ if ($ADD==21111111) echo "
EL FILTRO AGREGÓ: $lead_filter_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 AGREGUE EL FILTRO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=10000000; -} + $ADD=10000000; + } ###################### @@ -5507,7 +7732,7 @@ $ADD=10000000; ###################### if ($ADD==211111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); @@ -5528,17 +7753,17 @@ if ($ADD==211111111) echo "
TIEMPO DE LA LLAMADA AGREGADO: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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=311111111; + } ###################### @@ -5546,7 +7771,7 @@ $ADD=311111111; ###################### 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); @@ -5567,17 +7792,66 @@ if ($ADD==2111111111) echo "
TIEMPO DE LA LLAMADA DEL ESTADO AGREGADO: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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=3111111111; + } + + +###################### +# ADD=231111111 adds new shift definition to the system +###################### + +if ($ADD==231111111) + { + 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 "
MAYÚS DEFINICIÓN NO AÑADIDO - ya hay un cambio de entrada con 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 "
MAYÚS DEFINICIÓN NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Identificación y cambio de nombre debe ser al menos de 2 caracteres de longitud\n"; + echo "
Hora de inicio cambio debe ser de 4 dígitos de longitud y una hora válida\n"; + echo "
Longitud cambio debe ser de 5 caracteres de longitud y 24 horas o 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); + + echo "
MAYÚS AÑADIDO:$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; + } ###################### @@ -5585,8 +7859,7 @@ $ADD=3111111111; ###################### if ($ADD==21111111111) -{ -echo "
\n"; + { echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5595,18 +7868,127 @@ echo "
\n"; {echo "
TELÉFONO NO AGREGADO - hay ya un teléfono en el sistema con esta extensión/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 "
TELÉFONO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\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 - ya hay un teléfono en el sistema con esta información de acceso\n";} + else { - echo "
EL TELÉFONO AGREGÚ\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');"; + $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 - ya existe un Teléfono de alias en el sistema con esta información de acceso\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 "
TELÉFONO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
EL TELÉFONO AGREGÚ\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); + + ### 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=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 "
TELÉFONO ALIAS NO AÑADIDO - ya existe un alias de teléfono en el sistema con este 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 "
TELÉFONO ALIAS NO AÑADIDO - ya existe un Teléfono de inicio de sesión en el sistema con este ID\n";} + else + { + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
TELÉFONO ALIAS NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
TELÉFONO ALIAS AÑADIDO\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 TELÉFONO ALIAS', 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 GRUPO NO AÑADIDO - ya existe un alias de teléfono en el sistema con este ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) + {echo "
ALIAS GRUPO NO AÑADIDO - no puede usar palabras reservadas en el grupo de alias\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
ALIAS GRUPO NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
GRUPO DE ALIAS AÑADIDO\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; + } ###################### @@ -5614,8 +7996,7 @@ $ADD=31111111111; ###################### if ($ADD==211111111111) -{ -echo "
\n"; + { echo ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); @@ -5632,10 +8013,18 @@ 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 * 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 "
\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); + + ### 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=311111111111; + } ###################### @@ -5643,7 +8032,7 @@ $ADD=311111111111; ###################### if ($ADD==221111111111) -{ + { echo ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5682,18 +8071,90 @@ if ($ADD==221111111111) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW VICIDIAL TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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=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 "
CONF PLANTILLA NO AÑADIDO - ya hay una plantilla en el sistema con este ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
CONF PLANTILLA NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
CONF PLANTILLA AÑADIDO\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 "
TRANSPORTISTA NO AÑADIDO - ya existe un soporte en el sistema con este ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
TRANSPORTISTA NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $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='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; + } ###################### @@ -5701,8 +8162,7 @@ $ADD=311111111111; ###################### if ($ADD==2111111111111) -{ -echo "\n";} echo "\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 -| @@ -10073,7 +14771,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "\n"; echo "ADD   \n"; echo "QUITE\n"; @@ -10134,7 +14832,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "$mixlists_list"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -10593,7 +15291,6 @@ if ($ADD==311) $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); @@ -10606,7 +15303,7 @@ if ($ADD==311) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; + { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5721,8 +8181,8 @@ echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "QUITE\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + $dtl = 'Balanced'; + if ($n<0) {$dtl = 'Less Intense';} + if ($n>0) {$dtl = 'More Intense';} + if ($n == $adaptive_intensity) + {echo "\n";} + else + {echo "\n";} + $n--; } + echo " $NWB#vicidial_campaigns-adaptive_intensity$NWE\n"; } - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; echo "\n"; @@ -9825,71 +14464,129 @@ if ($ADD==34) echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=3111111111111; -} + $ADD=3111111111111; + } ###################### @@ -5730,8 +8190,7 @@ $ADD=3111111111111; ###################### if ($ADD==21111111111111) -{ -echo ""; echo ""; echo ""; - echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + } echo "\n"; echo "\n"; + if ($SSoutbound_autodial_active < 1) + { + echo ""; + } echo "
\n"; + { echo ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -5750,8 +8209,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) { @@ -8725,9 +12862,18 @@ if ($ADD==3) 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"; + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } } if ($LOGuser_level > 8) { @@ -8759,6 +12913,8 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8766,6 +12922,8 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -8773,16 +12931,26 @@ if ($ADD==3) 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"; + echo "\n"; echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=31111111111111; -} + $ADD=31111111111111; + } ###################### @@ -5759,8 +8218,7 @@ $ADD=31111111111111; ###################### if ($ADD==221111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status';"; $rslt=mysql_query($stmt, $link); @@ -5789,18 +8247,18 @@ if ($ADD==221111111111111) $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SYSTEMSTATUSES', event_type='ADD', record_id='$status', 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=321111111111111; + } ###################### @@ -5808,8 +8266,7 @@ $ADD=321111111111111; ###################### if ($ADD==231111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_query($stmt, $link); @@ -5826,7 +8283,7 @@ if ($ADD==231111111111111) } else { - echo "
STATUS CATEGORY ADDED: $vsc_id - $vsc_name\n"; + echo "
STATUS CATEGORÍA 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); @@ -5837,20 +8294,61 @@ if ($ADD==231111111111111) echo "
ERROR: Hay ya sistema de 4 categorías del estado a la exhibición deTimeOnVDAD\n"; } - $stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display');"; + $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATUS CATEGORY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 CATEGORÍA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=331111111111111; -} + $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 "
CC Código de estado no se añade- ya hay una qc código de estado en el sistema con el nombre: $row[0]\n";} + else + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
CC Código de estado no se añade- Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
código debe estar entre 1 y 8 caracteres de longitud\n"; + echo "
nombre de código debe estar entre 2 y 30 caracteres de longitud\n"; + } + else + { + echo "
CC Código AÑADIDO:$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='QCSTATUSES', 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; + } @@ -5879,20 +8377,211 @@ if ($ADD=="4A") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
USUARIO MODIFICADO - 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' where user='$user';"; + $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' 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='USUARIOS', 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); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ############################################################### + ##### 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Activo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5921,18 +8610,211 @@ if ($ADD=="4B") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
USUARIO MODIFICADO - 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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USUARIOS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Activo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5964,16 +8846,203 @@ if ($ADD==4) { echo "
USUARIO MODIFICADO: $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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USUARIOS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Activo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -5985,90 +9054,164 @@ $ADD=3; # go to user modification below } ###################### -# ADD=41 submit campaign modifications to the system +# ADD=41 submit campaign modifications to the system - DETAIL ###################### if ($ADD==41) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - echo "
|$campaign_name|$active|\n"; - } - else - { - echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; + echo ""; - if ($dial_method == 'MANUAL') + if ($SSoutbound_autodial_active < 1) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + $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 = '8300'; + $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'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
LISTAS DE CAMBIO DE ACTIVO"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN 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 ($dial_level_override > 0) + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; + echo "
|$campaign_name|$active|\n"; } - else + else { - if ($dial_method == 'RATIO') + echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; + + if ($dial_method == 'MANUAL') { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_level_override > 0) { - $auto_dial_level = "1.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' 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 "
- Espera 1 minuto antes de marcar el número siguiente\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - 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',safe_harbor_message='$safe_harbor_message',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' 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 "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; - } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } $ADD=31; # go to campaign modification form below } @@ -6100,14 +9243,13 @@ if ($ADD==42) $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmtA, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } if (ereg('modify',$stage)) { @@ -6116,13 +9258,13 @@ if ($ADD==42) $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -6159,13 +9301,13 @@ if ($ADD==43) $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Estado: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6184,76 +9326,139 @@ $ADD=31; # go to campaign modification form below if ($ADD==44) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - } - else - { - echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; + echo ""; - if ($dial_method == 'RATIO') + if ($SSoutbound_autodial_active < 1) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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 = '8300'; + $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 DE CAMBIO DE ACTIVO"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN 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 ($dial_method == 'MANUAL') + + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; } - else + else { - $adlSQL = ""; - if ($auto_dial_level < 1) + echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; + + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', 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 "
- Espera 1 minuto antes de marcar el número siguiente\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } } } - 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); - - if ($reset_hopper == 'Y') - { - echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; - } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } $ADD=34; # go to campaign modification form below } @@ -6267,11 +9472,11 @@ if ($ADD==45) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) + 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 "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos y menos de 43.200 segundos o 12 horas\n"; echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; } else @@ -6281,13 +9486,13 @@ if ($ADD==45) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6313,7 +9518,7 @@ if ($ADD==47) { echo "
CÓDIGO DE LA PAUSA DEL AGENTE NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
pause_code must be between 1 and 6 characters in length\n"; - echo "
pause_code name must be between 2 and 30 characters in length\n"; + echo "
pause_nombre de código debe estar entre 2 y 30 caracteres de longitud\n"; } else { @@ -6322,13 +9527,13 @@ if ($ADD==47) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENTE PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -6341,6 +9546,103 @@ $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 "
AJUSTES CC NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\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 "
AJUSTES CC MODIFICADOS: $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='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión 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 "
ENCUESTA DE VALORES NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + } + else + { + echo "
ENCUESTA DE AJUSTES MODIFICADOS: $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' 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='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +$SUB='20A'; +$ADD=31; # go to campaign modification form below +} + + ###################### # ADD=49 modify campaign list mix in the system ###################### @@ -6371,22 +9673,22 @@ if ($ADD==49) if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) ) { - echo "
MEZCLA DE LA LISTA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\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"; + echo "
MEZCLA DE LA LISTA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LA MEZCLA DE LA LISTA SE MODIFICÓ: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6414,13 +9716,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LA MEZCLA DE LA LISTA SE MODIFICÓ: $campaign_id - $vcl_id - $list_id\n"; } @@ -6487,13 +9789,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LA MEZCLA DE LA LISTA SE MODIFICÓ: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; } @@ -6525,13 +9827,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA LIST MIX', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LA MEZCLA DE LA LISTA AGREGÓ:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6553,13 +9855,13 @@ if ($ADD==49) $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MEZCLA DE LA LISTA SUPRIMIDA:$campaign_id - $vcl_id - $vcl_name\n"; } @@ -6583,13 +9885,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='Mezcla lista: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
LA MEZCLA DE LA LISTA ACTIVÓ: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -6627,33 +9929,33 @@ if ($ADD==411) $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate' 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 "
REAJUSTANDO LA LISTA - LLAMADA - ESTADO\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); + $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; + $rslt=mysql_query($stmtB, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } + ### 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 "
QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description' where list_id='$list_id'|\n"); - fclose($fp); + $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; + $rslt=mysql_query($stmtC, $link); } } } @@ -6683,18 +9985,36 @@ if ($ADD==4111) } 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 "
GRUPO MODIFICADO: $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_message='$drop_message',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' where group_id='$group_id';"; + $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' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6707,6 +10027,47 @@ $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 "
NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
did_extension must be at least 1 character in length\n"; + } + else + { + echo "
DID MODIFICADOS: $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' 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 "Usted no tiene permiso de visión esta página\n"; + exit; + } +$ADD=3311; # go to did modification form below +} + + + ###################### # ADD=41111 modify remote agents info in the system ###################### @@ -6729,13 +10090,13 @@ if ($ADD==41111) echo "
LOS AGENTES ALEJADOS SE MODIFICARON\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|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'|\n"); - fclose($fp); - } + ### 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 @@ -6765,17 +10126,106 @@ if ($ADD==411111) } else { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value' where user_group='$OLDuser_group';"; + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $GROUP_shifts .= "$group_shifts[$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' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
GRUPO DE USUARIO MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 USUARIOS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 + ###################################### } } } @@ -6811,13 +10261,13 @@ if ($ADD==4111111) echo "
LA ESCRITURA SE MODIFICÓ\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='ESCRITURAS', 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 @@ -6851,13 +10301,13 @@ if ($ADD==41111111) echo "
FILTRO MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6907,13 +10357,13 @@ if ($ADD==411111111) echo "
TIEMPO DE LA LLAMADA MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6963,13 +10413,13 @@ if ($ADD==4111111111) echo "
TIEMPO DE LA LLAMADA DEL ESTADO MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -6981,6 +10431,57 @@ $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 - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Identificación y cambio de nombre debe ser al menos de 2 caracteres de longitud\n"; + echo "
Hora de inicio cambio debe ser de 4 dígitos de longitud y una hora válida\n"; + echo "
Longitud cambio debe ser de 5 caracteres de longitud y 24 horas o 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 "
MAYÚS MODIFICADOS\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 "Usted no tiene permiso de visión esta página\n"; + exit; + } +$ADD=331111111; # go to shift modification form below +} + + ###################### # ADD=41111111111 modify phone record in the system ###################### @@ -7004,7 +10505,18 @@ if ($ADD==41111111111) { echo "
TELÉFONO MODIFICADO: $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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $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' 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 MODIFICAR EL TELÉFONO', event_sql=\"$SQL_log\", event_notes='IP Del Servidor: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7018,6 +10530,86 @@ $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 "
TELÉFONO ALIAS NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
TELÉFONO ALIAS MODIFICADOS: $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 MODIFICAR TELÉFONO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión 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 GRUPO NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
GRUPO DE ALIAS MODIFICADOS: $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 MODIFICAR GRUPO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +$ADD=33111111111; # go to group alias modification form below +} + + ###################### # ADD=411111111111 modify server record in the system ###################### @@ -7048,7 +10640,18 @@ if ($ADD==411111111111) { echo "
SERVIDOR MODIFICADO: $server_ip\n"; - $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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_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); + + ### 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 MODIFICAR EL SERVIDOR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } @@ -7102,13 +10705,13 @@ if ($ADD==421111111111) $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFICAR EL SERVIDOR TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SERVERTRONCOS', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN MODIFICAR EL SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='Campaña: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -7121,6 +10724,86 @@ $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 "
CONF PLANTILLA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $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); + + ### 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 MODIFICAR CONF PLANTILLA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión 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 "
TRANSPORTISTA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
PORTEADOR MODIFICADOS: $carrier_id\n"; + + $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' 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); + + ### 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 MODIFICAR PORTEADOR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +$ADD=341111111111; # go to carrier modification form below +} + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -7202,31 +10885,31 @@ $ADD=31111111111111; # go to vicidial conference modification form below ###################### if ($ADD==411111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo ""; - - echo "
AJUSTES DEL SISTEMA DE VICIDIAL MODIFICADOS\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';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM SETTINGS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo ""; + + echo "
AJUSTES DEL SISTEMA DE VICIDIAL MODIFICADOS\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';"; + $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 "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $ADD=311111111111111; # go to vicidial system settings form below } -$ADD=311111111111111; # go to vicidial system settings form below -} ###################### @@ -7234,70 +10917,70 @@ $ADD=311111111111111; # go to vicidial system settings form below ###################### 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 ""; + + if (ereg('delete',$stage)) { - echo "
ESTADO DE SISTEMA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); + echo "
ESTADO DE SISTEMA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\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='SYSTEMSTATUSES', 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 "
ESTADO DE SISTEMA NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; + echo "
el nombre del estado de sistema necesita ser por lo menos loscaracteres 1 en longitud\n"; + } + else + { + echo "
ESTADO DE SISTEMA MODIFICADO: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='SYSTEMSTATUSES', 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); } } } - if (ereg('modify',$stage)) - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
ESTADO DE SISTEMA NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; - echo "
el nombre del estado de sistema necesita ser por lo menos loscaracteres 1 en longitud\n"; - } - else - { - echo "
ESTADO DE SISTEMA MODIFICADO: $status\n"; - - $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $ADD=321111111111111; # go to system settings modification form below } -$ADD=321111111111111; # go to system settings modification form below -} ###################### @@ -7305,57 +10988,125 @@ $ADD=321111111111111; # go to system settings modification form below ###################### if ($ADD==431111111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + { + echo "
CATEGORÍA DEL ESTADO NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
la categoría del estado no puede ser una categoría reservada:UNDEFINED\n"; + echo "
la categoría del estado necesita ser por lo menos 2 caracteres enlongitud\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
CATEGORÍA DEL ESTADO SUPRIMIDA: $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 CATEGORÍA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
LA CATEGORÍA DEL ESTADO SE MODIFICÓ: $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 "
ERROR: Hay ya sistema de 4 categorías del estado a la exhibición deTimeOnVDAD\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 CATEGORÍA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Usted no tiene permiso de visión 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 ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) + if (ereg('delete',$stage)) { - echo "
CATEGORÍA DEL ESTADO NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la categoría del estado no puede ser una categoría reservada:UNDEFINED\n"; - echo "
la categoría del estado necesita ser por lo menos 2 caracteres enlongitud\n"; - } - else - { - if (ereg('delete',$stage)) + if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) { - echo "
CATEGORÍA DEL ESTADO SUPRIMIDA: $vsc_id\n"; - - $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + echo "
CC Código del Estatuto no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
la qc código de estado debe ser por lo menos 1 caracteres de longitud\n"; } - if (ereg('modify',$stage)) + else { - echo "
LA CATEGORÍA DEL ESTADO SE MODIFICÓ: $vsc_id\n"; + echo "
CC Código SUPRIMIDO:$code\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 "
ERROR: Hay ya sistema de 4 categorías del estado a la exhibición deTimeOnVDAD\n"; - } - - $stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display' where vsc_id='$vsc_id';"; + $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 "
CC ESTADO CÓDIGO NO MODIFICADA- Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
la qc código de estado debe ser por lo menos 1 caracteres de longitud\n"; + echo "
el código de estado qc nombre debe ser por lo menos 1 caracteres de longitud\n"; + } + else + { + echo "
CC Código MODIFICADOS:$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); } } } @@ -7364,7 +11115,7 @@ if ($ADD==431111111111111) echo "Usted no tiene permiso de visión esta página\n"; exit; } -$ADD=331111111111111; # go to system settings modification form below +$ADD=341111111111111; # go to qc status code modification form below } @@ -7388,7 +11139,7 @@ if ($ADD==5) if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) { echo "
USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Usuario be at least 2 characters in length\n"; } else { @@ -7515,6 +11266,28 @@ if ($ADD==5111) $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 "
DIDNOT SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + echo "
DID SUPRESIÓN DE CONFIRMACIÓN: $group_id\n"; + echo "

Haga clic aquí para eliminarDID $did_id


\n"; + } + +$ADD='3311'; # go to did modification below +} + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -7548,7 +11321,7 @@ if ($ADD==511111) if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) { echo "
GRUPO DE USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
Usuario_group be at least 2 characters in length\n"; } else { @@ -7619,7 +11392,7 @@ if ($ADD==511111111) else { echo "
CONFIRMACIÓN DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; + echo "

Haga clic aquí para eliminarcall time $call_time_id


\n"; } $ADD='311111111'; # go to call time modification below @@ -7641,12 +11414,33 @@ if ($ADD==5111111111) else { echo "
CONFIRMACIÓN DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; + echo "

Haga clic aquí para eliminarstate 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 "
SHIFT no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + echo "
MAYÚS SUPRESIÓN DE CONFIRMACIÓN:$shift_id\n"; + echo "

Haga clic aquí para suprimir el cambio $shift_id


\n"; + } + +$ADD='331111111'; # go to call time modification below +} ###################### # ADD=51111111111 confirmation before deletion of phone record @@ -7671,6 +11465,50 @@ $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 "
TELÉFONO ALIAS no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
TELÉFONO ALIAS SUPRESIÓN DE CONFIRMACIÓN: $alias_id\n"; + echo "

Haga clic aquí para eliminar alias teléfono $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 "
GRUPO DE ALIAS no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Alias ID Grupo must be at least 2 characters in length\n"; + } + else + { + echo "
ALIAS GRUPO DE SUPRESIÓN DE CONFIRMACIÓN: $group_alias_id\n"; + echo "

Haga clic aquí para suprimir el grupo de alias $group_alias_id


\n"; + } +$ADD='33111111111'; # go to group alias modification below +} + + ###################### # ADD=511111111111 confirmation before deletion of server record ###################### @@ -7694,6 +11532,50 @@ $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 "
CONF PLANTILLA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Plantilla de Identificación ser al menos de 2 caracteres de longitud\n"; + } + else + { + echo "
CONF PLANTILLA SUPRESIÓN DE CONFIRMACIÓN: $template_id - $template_name\n"; + echo "

Haga clic aquí para eliminar conf plantilla $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 "
TRANSPORTISTA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Portador de Identificación ser al menos de 2 caracteres de longitud\n"; + } + else + { + echo "
PORTEADOR SUPRESIÓN DE CONFIRMACIÓN: $carrier_id - $carrier_name\n"; + echo "

Haga clic aquí para suprimir el transportista $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier modification below +} + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -7753,15 +11635,15 @@ $ADD='31111111111111'; # go to vicidial conference modification below ###################### if ($ADD==6) -{ + { echo ""; - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) + if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) { echo "
USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Usuario be at least 2 characters in length\n"; } - else + else { $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; $rslt=mysql_query($stmtA, $link); @@ -7772,37 +11654,38 @@ if ($ADD==6) $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|$user|$stmtA|$stmt|\n"); - fclose($fp); - } + ### 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='USUARIOS', 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 "
CANCELADURA DEL USUARIO TERMINADA: $user\n"; echo "

\n"; } -$ADD='0'; # go to user list -} + $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) ) + if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) { echo "
CAMPAÑA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; echo "
Campaña_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -7841,58 +11724,60 @@ if ($ADD==61) $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
LA CANCELADURA DE LA CAMPAÑA TERMINÓ: $campaign_id\n"; echo "

\n"; } -$ADD='10'; # go to campaigns list -} + $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 NO REGISTRADOS FUERA DE CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENTE LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
AGENTES NO REGISTRADOS FUERA DE CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Campaña_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_live_agents 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='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EL REGISTRO DE ESTADO DE LA MÁQUINA DEL AGENTE TERMINÓ: $campaign_id\n"; + echo "

\n"; } - echo "
EL REGISTRO DE ESTADO DE LA MÁQUINA DEL AGENTE TERMINÓ: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $ADD='31'; # go to campaign modification below } -$ADD='31'; # go to campaign modification below -} ###################### @@ -7900,45 +11785,46 @@ $ADD='31'; # go to campaign modification below ###################### if ($ADD==63) -{ + { if ($LOGmodify_campaigns==1) - { - if (eregi('IN',$stage)) - {$group_id=$campaign_id;} - echo ""; - - if (strlen($campaign_id) < 2) { - echo "
VDAC NO DESPEJÓ PARA LA CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_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); + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|EMERGENCY VDAC CLEAR|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
VDAC NO DESPEJÓ PARA LA CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Campaña_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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
DE REGISTRO PASADO DE VDAC DESPEJADA PARA LA CAMPAÑA: $campaign_id\n"; + echo "

\n"; } - echo "
DE REGISTRO PASADO DE VDAC DESPEJADA PARA LA CAMPAÑA: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} } -# go to campaign modification below -if (eregi('IN',$stage)) - {$ADD='3111';} -else - {$ADD='31';} -} ###################### @@ -7946,42 +11832,42 @@ else ###################### if ($ADD==65) -{ - if ($LOGmodify_campaigns==1) { - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + if ($LOGmodify_campaigns==1) { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; - echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; - } - else - { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $campaign_id - $status - $attempt_delay\n"; + echo ""; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
EL PLOMO DE LA CAMPAÑA RECICLA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; + echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; + } + else + { + echo "
EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $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='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below } -$SUB=25; -$ADD=31; # go to campaign modification form below -} ###################### @@ -7989,92 +11875,92 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - este estado del dial del alt del automóvil no está en esta campaña\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - este estado del dial del alt del automóvil no está en esta campaña\n";} + else { - echo "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - } - else - { - echo "
ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AUTALTDIALSTTUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + } + else + { + echo "
ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $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='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $SUB=26; + $ADD=31; # go to campaign modification form below } -$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) ) + if ($LOGmodify_campaigns==1) { - echo "
CÓDIGO DE LA PAUSA DE LA CAMPAÑA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code\n"; + echo ""; - $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AGENTE PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
CÓDIGO DE LA PAUSA DE LA CAMPAÑA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Estado: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below } -$SUB=27; -$ADD=31; # go to campaign modification form below -} ###################### @@ -8082,67 +11968,67 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ESTADO DEL DIAL DE LA CAMPAÑA NO QUITADO - este estado del dial no se selecciona para esta campaña\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ESTADO DEL DIAL DE LA CAMPAÑA NO QUITADO - este estado del dial no se selecciona para esta campaña\n";} + else { - echo "
ESTADO DEL DIAL DE LA CAMPAÑA NO QUITADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - } - else - { - echo "
EL ESTADO DEL DIAL DE LA CAMPAÑA QUITÓ: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DIAL STATUS REMOVED |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ESTADO DEL DIAL DE LA CAMPAÑA NO QUITADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + } + else + { + echo "
EL ESTADO DEL DIAL DE LA CAMPAÑA QUITÓ: $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='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Estado: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + #$SUB=28; + $ADD=31; # go to campaign modification form below } -#$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) ) + if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) { - echo "
LISTA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
List_id be at least 2 characters in length\n"; + echo "
LISTA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
List_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; $rslt=mysql_query($stmt, $link); @@ -8155,37 +12041,38 @@ if ($ADD==611) $stmt="DELETE from vicidial_list where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } + ### 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 "
LA CANCELADURA DE LA LISTA TERMINÓ: $list_id\n"; echo "

\n"; } -$ADD='100'; # go to lists list -} + $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) ) + if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) { - echo "
EN-GRUPO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Group_id be at least 2 characters in length\n"; + echo "
EN-GRUPO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Group_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8193,115 +12080,155 @@ if ($ADD==6111) $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } + $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 "
CANCELADURA DE EN-GRUPO TERMINADA: $group_id\n"; echo "

\n"; } -$ADD='1000'; # go to in-group list -} + $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 "
DIDNOT SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\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 "
DID SUPRESIÓN RELLENARSE: $did_id\n"; + echo "

\n"; + } + + $ADD='1300'; # go to did 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) ) + if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
AGENTE ALEJADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; + echo "
AGENTE ALEJADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } + ### 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 "
CANCELADURA ALEJADA DEL AGENTE TERMINADA: $remote_agent_id\n"; echo "

\n"; } -$ADD='10000'; # go to remote agents list -} + $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) ) + if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) { - echo "
GRUPO DE USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
GRUPO DE USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Usuario_group be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } + ### 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 USUARIOS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; echo "

\n"; } -$ADD='100000'; # go to user group list -} + $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) ) + if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) { - echo "
ESCRITURA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Script_id be at least 2 characters in length\n"; + echo "
ESCRITURA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Script_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } + ### 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='ESCRITURAS', 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 "
CANCELADURA DE LA ESCRITURA TERMINADA: $script_id\n"; echo "

\n"; } -$ADD='1000000'; # go to script list -} + $ADD='1000000'; # go to script list + } ###################### @@ -8309,32 +12236,33 @@ $ADD='1000000'; # go to script list ###################### if ($ADD==61111111) -{ + { echo ""; - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) + if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) { - echo "
FILTRO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La identificación del filtro debe ser por lo menos 2 caracteres en longitud\n"; + echo "
FILTRO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
La identificación del filtro debe ser por lo menos 2 caracteres en longitud\n"; } - else + else { $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } + ### 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 "
CANCELADURA DEL FILTRO TERMINADA: $lead_filter_id\n"; echo "

\n"; } -$ADD='10000000'; # go to filter list -} + $ADD='10000000'; # go to filter list + } ###################### @@ -8342,32 +12270,33 @@ $ADD='10000000'; # go to filter list ###################### if ($ADD==611111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; + echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; } - else + else { $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } + ### 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 "
_ LLAMAR TIEMPO CANCELADURA TERMINAR: $call_time_id\n"; echo "

\n"; } -$ADD='100000000'; # go to call times list -} + $ADD='100000000'; # go to call times list + } ###################### @@ -8375,18 +12304,18 @@ $ADD='100000000'; # go to call times list ###################### if ($ADD==6111111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; + echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; } - else + else { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -8394,36 +12323,72 @@ if ($ADD==6111111111) $sct_list=''; $o=0; - while ($sct_to_print > $o) { + 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) { + 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 "Regla Del Estado Quitada: $sct_ids[$o]
\n"; $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); } + + ### 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 "
CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO TERMINADA: $call_time_id\n"; echo "

\n"; } -$ADD='1000000000'; # go to call times list -} + $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 "
SHIFT no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\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 "
MAYÚS SUPRESIÓN RELLENARSE: $shift_id\n"; + echo "

\n"; + } + + $ADD='130000000'; # go to shifts list + } ###################### @@ -8431,32 +12396,99 @@ $ADD='1000000000'; # go to call times list ###################### if ($ADD==61111111111) -{ + { echo ""; - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
TELÉFONO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; + echo "
TELÉFONO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP Del Servidor be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
LA CANCELADURA DEL TELÉFONO TERMINÓ: $extension - $server_ip\n"; echo "

\n"; } -$ADD='10000000000'; # go to phone list -} + $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 "
TELÉFONO ALIAS no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\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 ELIMINAR TELÉFONO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
TELÉFONO ALIAS SUPRESIÓN RELLENARSE: $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 "
GRUPO DE ALIAS no se eliminan - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Alias ID Grupo 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 Eliminar grupo ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
GRUPO DE SUPRESIÓN RELLENARSE ALIAS: $group_alias_id\n"; + echo "

\n"; + } + $ADD='13000000000'; # go to group alias list + } ###################### @@ -8464,32 +12496,33 @@ $ADD='10000000000'; # go to phone list ###################### if ($ADD==611111111111) -{ + { echo ""; - if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
SERVIDOR NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
ID Del Servidor be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; + echo "
SERVIDOR NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
ID Del Servidor be at least 2 characters in length\n"; + echo "
IP Del Servidor be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING SERVER!!|$PHP_AUTH_USER|$ip|server_id='$server_id'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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='100000000000'; # go to server list + } ###################### @@ -8497,40 +12530,123 @@ $ADD='100000000000'; # go to server list ###################### if ($ADD==621111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + { + echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
la campaña debe estar entre 3 y 8 caracteres en longitud\n"; + echo "
el server_ip retrasa debe ser por lo menos 7 caracteres\n"; + } + else + { + echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL SUPRIMIDO: $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='SERVERTRONCOS', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='Campaña: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión 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($campaign_id) < 2) or (strlen($server_ip) < 7) ) + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { - echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la campaña debe estar entre 3 y 8 caracteres en longitud\n"; - echo "
el server_ip retrasa debe ser por lo menos 7 caracteres\n"; + echo "
CONF PLANTILLA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Plantilla de Identificación ser al menos de 2 caracteres de longitud\n"; } - else + else { - echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL SUPRIMIDO: $campaign_id - $server_ip\n"; - - $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SERVIDOR TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $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 ELIMINAR CONF PLANTILLA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONF PLANTILLA SUPRESIÓN RELLENARSE: $server_id - $server_ip\n"; + echo "

\n"; } + $ADD='130000000000'; # go to conf template list } - else + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
TRANSPORTISTA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Portador de Identificación ser al menos de 2 caracteres de longitud\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 ELIMINAR PORTEADOR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
SUPRESIÓN RELLENARSE PORTEADOR: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier list } -$ADD=311111111111; # go to server modification form below -} ###################### @@ -8538,32 +12654,33 @@ $ADD=311111111111; # go to server modification form below ###################### if ($ADD==6111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
CONFERENCE NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; + echo "
CONFERENCE NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Del Servidor be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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='1000000000000'; # go to conference list + } ###################### @@ -8571,32 +12688,33 @@ $ADD='1000000000000'; # go to conference list ###################### if ($ADD==61111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
VICIDIAL CONFERENCE NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; + echo "
VICIDIAL CONFERENCE NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Del Servidor be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 -} + $ADD='10000000000000'; # go to vicidial conference list + } @@ -8666,6 +12784,24 @@ if ($ADD==3) $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]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -8714,6 +12850,7 @@ if ($ADD==3) echo "$NWB#vicidial_users-user_group$NWE
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
Activo: $NWB#vicidial_users-active$NWE
Manual de la llamada del agente: $NWB#vicidial_users-agentcall_manual$NWE
Grabación de Vicidial: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial transfiere: $NWB#vicidial_users-vicidial_transfers$NWE
Un Defecto Más cercano Mezclado: $NWB#vicidial_users-closer_default_blended$NWE
Un Defecto Más cercano Mezclado: $NWB#vicidial_users-closer_default_blended$NWE
Invalidación De la Grabación de VICIDIAL:$NWB#vicidial_users-vicidial_recording_override$NWE
El Agente Altera La Invalidación De los Datos Del Cliente: $NWB#vicidial_users-alter_custdata_override$NWE
Modificar Agente Cliente Sobreescribe Teléfono:$NWB#vicidial_users-alter_custphone_override$NWE
Agente de Cambio observancia Sobrescribir: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alerta Activado: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Filas De la Campaña:$NWB#vicidial_users-campaign_ranks$NWE
\n"; echo "\n"; echo "$RANKcampaigns_list"; @@ -8738,6 +12884,14 @@ if ($ADD==3) echo "$RANKgroups_list"; echo "
\n"; echo "
CC Activado:$NWB#vicidial_users-qc_enabled$NWE
CC Nivel de Usuario:$NWB#vicidial_users-qc_user_level$NWE
QC Pass:$NWB#vicidial_users-qc_pass$NWE
CC Acabado:$NWB#vicidial_users-qc_finish$NWE
CC Compro:$NWB#vicidial_users-qc_commit$NWE
La cancelación enumera: $NWB#vicidial_users-delete_lists$NWE
La carga conduce: $NWB#vicidial_users-load_leads$NWE
Modifique Los Plomos: $NWB#vicidial_users-modify_leads$NWE
Descargar Listas: $NWB#vicidial_users-modify_leads$NWE
Informes de exportación: $NWB#vicidial_users-export_reports$NWE
Modifique Las Campañas: $NWB#vicidial_users-modify_sections$NWE
Detalle de la campaña: $NWB#vicidial_users-campaign_detail$NWE
Modifique A En-Grupos: $NWB#vicidial_users-modify_sections$NWE
En-Grupos de la cancelación: $NWB#vicidial_users-delete_ingroups$NWE
Modificar DIDs:$NWB#vicidial_users-modify_sections$NWE
Eliminar DIDs:$NWB#vicidial_users-delete_ingroups$NWE
Modifique Los Agentes Alejados: $NWB#vicidial_users-modify_sections$NWE
Suprima los agentes alejados: $NWB#vicidial_users-delete_remote_agents$NWE
Modifique Las Escrituras: $NWB#vicidial_users-modify_sections$NWE
Escritura De la Cancelacións: $NWB#vicidial_users-delete_scripts$NWE
Modifique Los Filtros: $NWB#vicidial_users-modify_sections$NWE
Filtro De la Cancelacións: $NWB#vicidial_users-delete_filters$NWE
Modifique Los Filtros: $NWB#vicidial_users-modify_sections$NWE
Filtro De la Cancelacións: $NWB#vicidial_users-delete_filters$NWE
Acceso de AGC Admin: $NWB#vicidial_users-ast_admin_access$NWE
La cancelación de AGC telefona: $NWB#vicidial_users-ast_delete_phones$NWE
Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
Delete Tiempos De la Llamada: $NWB#vicidial_users-delete_call_times$NWE
BorrarTiempos De la Llamada: $NWB#vicidial_users-delete_call_times$NWE
Modifique Los Servidores: $NWB#vicidial_users-modify_sections$NWE
Agente de acceso a la API:$NWB#vicidial_users-vdc_agent_api_access$NWE
AñadirReloj de tiempo Registrarse Registro: $NWB#vicidial_users-add_timeclock_log$NWE
ModificarReloj de tiempo Registrarse Registro: $NWB#vicidial_users-modify_timeclock_log$NWE
EliminarReloj de tiempo Registrarse Registro: $NWB#vicidial_users-delete_timeclock_log$NWE
Gerente de Turno observancia Sobrescribir: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; if ($LOGdelete_users > 0) @@ -8792,7 +12960,12 @@ if ($ADD==3) echo "

Chasque aquí para la hoja de tiempo del usuario\n"; echo "

Chasque aquí para el estado del usuario\n"; echo "

Clique aquí para ver las estadísticas del usuario\n"; + echo "

Haga clic aquí para varios días de estado de usuario detalle informe\n"; echo "

Chasque aquí para los asimientos del servicio repetido del usuario\n"; + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver Admin chages a la presente acta
\n"; + } } } else @@ -8807,7 +12980,7 @@ if ($ADD==3) # ADD=31 modify campaign info in the system - Detail view ###################### -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed +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-CAMPAIGNS",$LOGallowed_campaigns)) ) ) {$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list @@ -8827,6 +13000,12 @@ if ($ADD==31) $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 * from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -8837,6 +13016,7 @@ if ($ADD==31) $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]; @@ -8863,7 +13043,7 @@ if ($ADD==31) $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; + $drop_action = $row[37]; $safe_harbor_exten = $row[38]; $display_dialable_count = $row[39]; $wrapup_seconds = $row[40]; @@ -8894,6 +13074,43 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -8926,21 +13143,61 @@ if ($ADD==31) } } + $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 * 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 .= "$rowx[0] - $rowx[1]\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 pulldown list menu + + ##### 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); @@ -9001,19 +13294,36 @@ if ($ADD==31) 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 ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; + 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]: Basic Detail StatusesHotKeysLead RecyclingAuto Alt DialPause CodesList Mix Real-TimeBásico Detalle EstadosTeclas rápidasLead RecyclingAuto Alt telefónicoMezcla listaEncuestaPausa CódigosQC Tiempo Real
\n"; echo "\n"; echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "QUITE\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + $n--; } + echo "% $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; } - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - 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"; - + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } echo "\n"; echo "\n"; @@ -9175,8 +13508,12 @@ if ($ADD==31) echo "\n"; - echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -9185,34 +13522,109 @@ if ($ADD==31) echo "\n"; - echo "\n"; - + if ($SSoutbound_autodial_active > 0) + { + 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"; 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"; + + 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"; + } + else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + if ($campaign_allow_inbound == 'Y') { echo "
\n"; @@ -9030,117 +13340,136 @@ if ($ADD==31) echo "
ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE
Campaña Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaña Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campaña Fecha de cambio: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Formulario web de destino: $NWB#vicidial_campaigns-web_form_target$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Permita de entrada y mezclado:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Permita de entrada y mezclado:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Estado Del Dial $o: \n"; - - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Estado Del Dial $o: \n"; + + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Estado:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mezcla lista: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPTE LA INVALIDACIÓN
Solamente Cuenta Disponible: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Límite Del Porcentaje De la Gota:
El Máximo Adapta El Nivel Del Dial: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
El Tiempo Más último Del Servidor: 4 Solamente dígitos $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapte El Modificante De la Intensidad: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Blanco Llana De la Diferencia Del Dial: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Cola de prioridad: $NWB#vicidial_campaigns-queue_priority$NWE
El Marcar Auto Del Alt-Nu'mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Add A Dial Estado:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPTE LA INVALIDACIÓN
Solamente Cuenta Disponible: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Límite Del Porcentaje De la Gota: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
El Máximo Adapta El Nivel Del Dial: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
El Tiempo Más último Del Servidor: 4 Solamente dígitos $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapte El Modificante De la Intensidad: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Blanco Llana De la Diferencia Del Dial: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
El Marcar Auto Del Alt-Nu'mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE
Tiempo de espera Del Dial: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Tiempo de espera Del Dial: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Prefijo al marcar: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omita El Código Del Teléfono: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID de la Campaña: $NWB#vicidial_campaigns-campaign_cid$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extensión de Rec de la campaña: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Grabación De la Campaña: $NWB#vicidial_campaigns-campaign_recording$NWE
Mensaje del contestador automático: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD envían a la VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
AMD envían a la VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
CPD AMD Acción: $NWB#vicidial_campaigns-cpd_amd_action$NWE
Transfiera -Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
El Marcar Del Número Del Alt: $NWB#vicidial_campaigns-alt_number_dialing$NWE
El Marcar Del Número Del Alt: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Caída de Acción:$NWB#vicidial_campaigns-drop_action$NWE
Utilice El Mensaje Seguro Del Puerto: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Puerto Seguro Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Puerto Seguro Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Grupo de Transferencia de caída:$NWB#vicidial_campaigns-drop_inbound_group$NWE
Segundos De Wrap Up: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Mensaje De Wrap Up: $NWB#vicidial_campaigns-wrapup_message$NWE
Utilice La Lista Interna de DNC: $NWB#vicidial_campaigns-use_internal_dnc$NWE
AgentCódigos De la PausaActivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campaña de uso Lista DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentCódigos De la PausaActivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campaña Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Inhabilite Alteran Datos Del Cliente:$NWB#vicidial_campaigns-disable_alter_custdata$NWE
Deshabilitar Modificar Cliente Teléfono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Permita Ninguno-Tolva-Conduce Conexiones: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Permita Ninguno-Tolva-Conduce Conexiones: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Agente Mostrar cola Cuenta:$NWB#vicidial_campaigns-display_queue_count$NWE
Identificación Manual De la Lista Del Dial:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manual de Acceso telefónico Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Agente de pantalla Portapapeles Copiar: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agente de pantalla ampliada Alt telefónico: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Vías de salida de llamadas CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Vías de llamadas Prefijo telefónico: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Grupo Alias permitidas: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Alias predeterminado Grupo: $NWB#vicidial_campaigns-default_group_alias$NWE
Vtiger Búsqueda Categoría: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Crear Vtiger Registro de llamadas: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Crear Vtiger plomo Record: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Vtiger pantalla inicio de sesión: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
Grupos De entrada Permitidos:
"; @@ -9237,33 +13649,88 @@ if ($ADD==31) echo "
\n"; echo "
\n"; - echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $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=''; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID DE LA LISTANOMBRE DE LA LISTAACTIVO
\n"; - } - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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=0; - while ($lists_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "
ID DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVOÚLTIMA FECHA DE CONVOCATORIAMODIFICAR
$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]MODIFICAR

\n"; - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; echo "
\n"; $filterSQL = $filtersql_list[$lead_filter_id]; @@ -9288,25 +13755,26 @@ if ($ADD==31) echo " - DEMOSTRACIÓN

"; } - - - - - $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]"; + $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 campaña tiene $hopper_leads Leads en el Hopper

\n"; echo "Chasque aquí para ver qué plomos están en la tolva ahora

\n"; - echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

\n"; - echo "Click here to see a VDAD report for this campaign

\n"; - echo "
\n"; + echo "Haga clic aquí para ver un informe VDAD para esta campaña

\n"; } + echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

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

Haga clic aquí para ver Admin chages a esta campaña
\n"; + } + echo "\n"; + } - + ##### CAMPAIGN CUSTOM STATUSES ##### if ($SUB==22) { @@ -9329,7 +13797,7 @@ if ($ADD==31) echo "
\n"; echo "
ESTADOS DE ENCARGO DENTRO DE ESTA CAMPAÚA:   $NWB#vicidial_campaign_statuses$NWE
\n"; echo "\n"; - echo "\n"; + echo "\n"; $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; $rslt=mysql_query($stmt, $link); @@ -9375,7 +13843,7 @@ if ($ADD==31) echo "Estado:   \n"; echo "Descripción:   \n"; echo "Seleccionable:   \n"; - echo "Human Answer:   \n"; + echo "Respuesta humana:   \n"; echo "Categoría:\n"; echo "
ESTADODESCRIPCIÓNSELECCIONABLERESPUESTA HUMANAELIMINAR
ESTADODESCRIPCIÓNSELECCIONABLERESPUESTA HUMANOSAELIMINAR
\n"; - echo "\n"; + ### 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 * 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); - $o++; + $stmt="SELECT * 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 "

PLOMO QUE RECICLA DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_lead_recycle$NWE
\n"; + echo "
ESTADOLA TENTATIVA RETRASAMÁXIMO DE LA TENTATIVAACTIVO ELIMINAR
\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"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + $o++; } echo "
ESTADOLA TENTATIVA RETRASAMÁXIMO DE LA TENTATIVALLEVA EN EL LÍMITEACTIVO ELIMINAR
$rowx[2]
\n"; - echo "\n"; + echo "
  $RECYCLE_status[$o]\n"; + echo "\n"; echo "\n"; echo "$recycle_limit   ELIMINAR
ELIMINAR
\n"; @@ -9481,9 +13999,11 @@ if ($ADD==31) echo "
\n"; echo "
\n"; + echo "
\n"; + echo "* Llevar cuenta de activos adoptadas listas sólo en la campaña.\n"; } - + ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### if ($SUB==26) { echo "

NÚMERO AUTO DEL ALT QUE MARCA PARA ESTA CAMPAÑA:   $NWB#vicidial_auto_alt_dial_statuses$NWE
\n"; @@ -9520,7 +14040,7 @@ if ($ADD==31) echo "
\n"; } - + ##### CAMPAIGN CÓDIGOS DE LA PAUSA ##### if ($SUB==27) { echo "

CÓDIGOS DE LA PAUSA DEL AGENTE PARA ESTA CAMPAÑA:   $NWB#vicidial_pause_codes$NWE
\n"; @@ -9563,6 +14083,114 @@ if ($ADD==31) echo "

\n"; } + ##### CAMPAIGN 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 "

AJUSTES CC para esta campaña:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +# echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + echo "CC Activado: $NWB#vicidial_campaigns-qc_enabled$NWE
CC estados:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
Formulario de Asistencia CC:$NWB#vicidial_campaigns-qc_web_form_address$NWE
Control de calidad de secuencias de comandos: $NWB#vicidial_campaigns-qc_script$NWE
CC Mayúsculas: $NWB#vicidial_campaigns-qc_shift_id$NWE
CC Obtener Registro de lanzamiento: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
Mostrar control de la calidad de grabación: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; + echo "

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

ENCUESTA SOBRE AJUSTES EN ESTA CAMPAÑA:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "
Primera encuesta de archivo de audio: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Encuesta dígitos DTMF: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
No encuesta interesadas dígitos: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Encuesta de Opt-in de archivos de audio: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
No encuesta interesadas archivo de audio: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Método de estudio: $NWB#vicidial_campaigns-survey_method$NWE
Estudio n-Respuesta de acción: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Estudio de estado no le interesa: $NWB#vicidial_campaigns-survey_ni_status$NWE
Respuesta encuesta dígitos Mapa: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Encuesta Encuesta Xfer Extensión: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Estudio de grabación Campaña Directorio: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; + echo "

\n"; + } + if ($SUB < 1) { @@ -9650,12 +14278,13 @@ if ($ADD==34) $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])) @@ -9672,6 +14301,7 @@ if ($ADD==34) { $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])) @@ -9727,9 +14357,16 @@ if ($ADD==34) echo "
$row[0]: Vista Básica Vista Detallada List Mix Mezcla lista Pantalla En tiempo real  
\n"; if ($SUB < 1) @@ -9743,80 +14380,82 @@ if ($ADD==34) echo "
ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Descripción De la Campaña: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campaña Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaña Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campaña Fecha de cambio: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Permita de entrada y mezclado:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Permita de entrada y mezclado:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Estado Del Dial $o: \n"; - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Estado Del Dial $o: \n"; + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Estado:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
Mezcla lista: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapte El Modificante De la Intensidad:
Add A Dial Estado:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Método Del Dial: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapte El Modificante De la Intensidad: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Consiga El Lanzamiento De la Llamada: $get_call_launch
\n"; echo "
\n"; - echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID DE LA LISTANOMBRE DE LA LISTAACTIVO
\n"; - - } - - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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); - $camp_lists=''; + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); + 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++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + echo "
ID DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVOÚLTIMA FECHA DE CONVOCATORIAMODIFICAR
$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]MODIFICAR

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} else - {$bgcolor='bgcolor="#9BB9FB"';} + {$fSQL = '';} - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $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 campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

\n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

\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,$fSQL); - echo " - PIEL

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - DEMOSTRACIÓ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,$fSQL); + echo " - PIEL

"; + } + else + { + echo "Popup Dialable Leads Count"; + echo " - DEMOSTRACIÓN

"; + } - $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]"; + $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 campaña tiene $hopper_leads Leads en el Hopper

\n"; - echo "Chasque aquí para ver qué plomos están en la tolva ahora

\n"; + echo "Esta campaña tiene $hopper_leads Leads en el Hopper

\n"; + echo "Chasque aquí para ver qué plomos están en la tolva ahora

\n"; + echo "Haga clic aquí para ver un informe VDAD para esta campaña

\n"; + } echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

\n"; - echo "Click here to see a VDAD report for this campaign

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

Haga clic aquí para ver Admin chages a esta campaña
\n"; + } + echo "
\n"; echo "
\n"; @@ -9947,6 +14644,7 @@ if ( ($ADD==34) or ($ADD==31) ) { if ($LOGmodify_campaigns==1) { + ##### CAMPAIGN LIST MIX SETTINGS ##### if ($SUB==29) { ##### get list_id listings for dynamic pulldown @@ -10013,7 +14711,7 @@ if ( ($ADD==34) or ($ADD==31) ) {echo "$rowx[5]
Method:\n"; echo "
ID DE LA LISTAPRIORITY% MIXSTATUSES
ID DE LA LISTAPRIORIDAD% MIXSTATUSES
Dial Estado:  
Activo: $NWB#vicidial_lists-active$NWE
Reiniciar el Lead-Called-Status para esta lista: $NWB#vicidial_lists-reset_list$NWE
Fecha Del Cambio De la Lista: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
Última Fecha de lista de llamadas: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; @@ -10872,12 +15569,17 @@ if ($ADD==311) echo "
\n"; - echo "

Click here to see all CallBack Holds in this list

\n"; + echo "

Haga clic aquí para ver todas las CallBack mantiene en esta lista

\n"; + echo "

Haga clic aquí para descargar esta lista

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

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

Haga clic aquí para ver Admin chages a esta lista
\n"; + } } else { @@ -10905,7 +15607,7 @@ if ($ADD==3111) $group_name = $row[1]; $group_color = $row[2]; $active = $row[3]; - $web_form_address = $row[4]; + $web_form_address = stripslashes($row[4]); $voicemail_ext = $row[5]; $next_agent_call = $row[6]; $fronter_display = $row[7]; @@ -10916,7 +15618,7 @@ if ($ADD==3111) $xferconf_b_dtmf = $row[12]; $xferconf_b_number = $row[13]; $drop_call_seconds = $row[14]; - $drop_message = $row[15]; + $drop_action = $row[15]; $drop_exten = $row[16]; $call_time_id = $row[17]; $after_hours_action = $row[18]; @@ -10930,30 +15632,113 @@ if ($ADD==3111) $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]; + ##### get in-groups listings for dynamic pulldown - $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); $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 "
MODIFICAR UN REGISTRO DE LOS GRUPOS: $row[0]
\n"; @@ -10962,10 +15747,26 @@ if ($ADD==3111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; @@ -11019,12 +15850,158 @@ if ($ADD==3111) echo "$Xgroups_menu"; echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\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 "
ID De Grupo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Activo: $NWB#vicidial_inbound_groups-active$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Cola de prioridad: $NWB#vicidial_inbound_groups-queue_priority$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script:
Transfiera -Conf El Número 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Caída de Acción:$NWB#vicidial_inbound_groups-drop_action$NWE
Utilice El Mensaje De la Gota: $NWB#vicidial_inbound_groups-drop_message$NWE
Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Grupo de Transferencia de caída:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Tiempo De la Llamada:$NWB#vicidial_inbound_groups-call_time_id$NWE
Después De la Acción De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Después De la Acción De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Después De Nombre de fichero Del Mensaje De las Horas:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Después De Nombre de fichero Del Mensaje De las Horas:$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Después De la Extensión De las Horas:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Después De la Extensión De las Horas:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Después De las Horas Buzón de Voz:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Después De las Horas Buzón de Voz:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Horas después de la transferencia del Grupo:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Nombre de fichero Agradable Del Mensaje:$NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Reproducir Mensaje de Bienvenida:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Música En Contexto Del Asimiento:$NWB#vicidial_inbound_groups-moh_context$NWE
En Nombre de fichero Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
Lugar jugar en línea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Juega Mantenga Tiempo estimado:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Mantenga la opción Hora:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Mantenga la opción Segundos Hora:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Mantenga Tiempo Opción Extensión:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Mantenga la opción Tiempo de voz:$NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Opción de Transferencia de celebrar Tiempo-Grupo A:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Mantenga la opción Tiempo de llamada de archivo:$NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Mantenga la opción Tiempo de llamada Lista ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Extensión Alerta Del Agente:$NWB#vicidial_inbound_groups-agent_alert_exten$NWE
La Alarma Del Agente Retrasa:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Alias predeterminado Grupo: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Recordatorio de Transferencia de celebrar en Grupo:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
N Retraso de llamada Ruta:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
-Grupo de grabación en Sobrescribir:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
En el Grupo de grabación de archivo:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Estadísticas Porcentaje de llamadas respondidas dentro de X segundos 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Estadísticas Porcentaje de llamadas respondidas dentro de X segundos 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
\n"; + + if ($SSqc_features_active > 0) + { + echo "
 
Grupo de Ajustes de entrada de CC:
CC Activado: $NWB#vicidial_inbound_groups-qc_enabled$NWE
CC estados:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
Formulario de Asistencia CC:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
Control de calidad de secuencias de comandos: $NWB#vicidial_inbound_groups-qc_script$NWE
CC Mayúsculas: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
CC Obtener Registro de lanzamiento: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
Mostrar control de la calidad de grabación: $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 INBOUND GROUP:
\n"; + echo "
AGENTE RANKS FOR THIS Entrantes GROUP:
\n"; echo "\n"; echo "\n"; @@ -11049,7 +16026,7 @@ if ($ADD==3111) echo "
USER     RANK     CALLS TODAY

\n"; - echo "Click here to see a report for this inbound group

\n"; + echo "Haga clic aquí para ver un informe de este grupo entrante

\n"; echo "
\n"; @@ -11058,6 +16035,163 @@ if ($ADD==3111) echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

SUPRIMA A ESTE EN-GRUPO\n"; } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver a esta Administración chages en Grupo
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +} + + + +###################### +# ADD=3311 modify did info in the system +###################### + +if ($ADD==3311) +{ + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from vicidial_inbound_dids where did_id='$did_id';"; + $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]; + + + $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 "
MODIFICAR UN REGISTRO DID:$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 "
DID Extensión:$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
Activo: $NWB#vicidial_inbound_dids-did_active$NWE
DID Ruta:$NWB#vicidial_inbound_dids-did_route$NWE
Extensión:$NWB#vicidial_inbound_dids-extension$NWE
Extensión Contexto:$NWB#vicidial_inbound_dids-exten_context$NWE
Caja de voz:$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Teléfono Extensión:$NWB#vicidial_inbound_dids-phone$NWE
IP Del Servidor: $NWB#vicidial_inbound_dids-server_ip$NWE
Agente de usuario:$NWB#vicidial_inbound_dids-user$NWE
Usuario no disponible Acción:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
En Configuración de usuario Ruta-Grupo:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-ID De Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
En Grupo Agente Método de búsqueda:$NWB#vicidial_inbound_dids-agent_search_method$NWE
-En la lista Grupo de Identificación:$NWB#vicidial_inbound_dids-list_id$NWE
En el Grupo de Campaña-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
En el Grupo-Teléfono Código:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; + echo "

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

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

Haga clic aquí para ver a esta Administración chages DID
\n"; + } } else { @@ -11118,6 +16252,10 @@ if ($ADD==31111) { echo "

SUPRIMA ESTE AGENTE ALEJADO\n"; } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver a esta Administración chages agente remoto\n"; + } } else { @@ -11141,8 +16279,12 @@ if ($ADD==311111) $stmt="SELECT * 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]; + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + echo ""; echo "
MODIFICAR UNA ENTRADA EN LOS GRUPOS DE USUARIOS
\n"; @@ -11151,9 +16293,51 @@ if ($ADD==311111) 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: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
Campañas Permitidas: \n"; - echo "$campaigns_list"; - echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE
FuerzaReloj de tiempo inicio de sesión: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Cambio de título ejecutivo: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campañas Permitidas:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Grupo de cambios:
$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 "
 
CC permitidas Campañas:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
CC permitidas entrantes Grupos:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
\n"; @@ -11161,14 +16345,14 @@ if ($ADD==311111) ### list of users in this user group $active_confs = 0; - $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; + $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 "
USUARIOS DENTRO DE ESTE GRUPO DE USUARIO: $users_to_print
\n"; echo "\n"; - echo "\n"; + echo "\n"; $o=0; while ($users_to_print > $o) @@ -11185,6 +16369,7 @@ if ($ADD==311111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } @@ -11192,12 +16377,17 @@ if ($ADD==311111) - echo "

Click here to see all CallBack Holds in this user group

\n"; + echo "

Haga clic aquí para ver todas las CallBack Posee en este grupo de usuarios

\n"; + echo "

Haga clic aquí para ver elReloj de tiempo Estado para este grupo de usuarios

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

SUPRIMA A ESTE GRUPO DE USUARIO\n"; } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver Admin chages a este grupo de usuarios\n"; + } } else { @@ -11285,6 +16475,10 @@ if ($ADD==3111111) { echo "

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

Haga clic aquí para ver Admin chages a este script\n"; + } } else { @@ -11351,6 +16545,10 @@ if ($ADD==31111111) { echo "

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

Haga clic aquí para ver chages al administrador de este filtro\n"; + } } else { @@ -11455,7 +16653,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11526,7 +16724,7 @@ echo "
USERFULL NAMELEVEL
USERNOMBRE COMPLETONIVELACTIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]
Comienzo De Domingo:Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Jueves Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
\n"; } echo "
\n"; -echo "INBOUND GROUPS USING THIS CALL TIME:
\n"; +echo "Entrantes 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';"; @@ -11546,6 +16744,10 @@ if ($LOGdelete_call_times > 0) { echo "

SUPRIMA ESTA DEFINICIÓN DEL TIEMPO DE LA LLAMADA\n"; } +if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver Admin chages a este tiempo de atención\n"; + } } else { @@ -11604,7 +16806,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; @@ -11640,6 +16842,120 @@ echo "Le no autorizan a visión esta página. Vaya por favor detrás."; } + +###################### +# ADD=331111111 modify shift definition info in the system +###################### + +if ($ADD==331111111) +{ + +if ($LOGmodify_call_times==1) +{ +echo "
Comienzo De Domingo:Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Jueves Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFICAR UN CAMBIO
\n"; +echo "\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Cambio ID:$shift_id
Cambio de nombre: (breve descripción del cambio)$NWB#vicidial_shifts-shift_name$NWE
Cambio Hora de inicio:\n"; +echo "   Cambio Hora de finalización:\n"; +echo " $NWB#vicidial_shifts-shift_start_time$NWE
Longitud cambio: $NWB#vicidial_shifts-shift_length$NWE
Cambio semana:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; +echo "Domingo
\n"; +echo "Lunes
\n"; +echo "Martes
\n"; +echo "Miércoles
\n"; +echo "Jueves
\n"; +echo "Viernes
\n"; +echo "Sábado
\n"; +echo "
\n"; + +echo "


\n"; +echo "GRUPOS DE USUARIOS DE UTILIZAR ESTE CAMBIO:
\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 "

ELIMINAR ESTA MAYÚS DEFINICIÓN\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver Admin chages a este cambio
\n"; + } +} +else +{ +echo "Le no autorizan a visión esta página. Vaya por favor detrás."; +} + +} + + ###################### # ADD=31111111111 modify phone record in the system ###################### @@ -11662,7 +16978,7 @@ if ($ADD==31111111111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11677,6 +16993,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -11731,6 +17048,25 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Buzón de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
Caja de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Correo electrónico: $NWB#phones-email$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
Usuario de DBY: (Secundario DB Login)$NWB#phones-DBY_user$NWE
Contraseña de DBY: (Secundario DB Secret)$NWB#phones-DBY_pass$NWE
Puerto de DBY: (Secundario DB Port)$NWB#phones-DBY_port$NWE
ID de plantilla: $NWB#phones-template_id$NWE
Conf. Sobrescribir: $NWB#phones-conf_override$NWE
\n"; @@ -11749,6 +17085,122 @@ if ($ADD==31111111111) } +###################### +# ADD=32111111111 modify phone alias record in the system +###################### + +if ($ADD==32111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
MODIFICAR UN TELÉFONO ALIAS REGISTRO: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias ID:$row[0] $NWB#phones-alias_id$NWE
Alias Nombre: $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 "
TELÉFONOS DENTRO DE ESTE PHONES 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 "
LOGINEXTENSIÓNSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

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

ELIMINAR ESTE TELÉFONO ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver Admin chages alias para este teléfono
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión 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 "
ALIAS MODIFICAR UN GRUPO DE REGISTRO: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias ID Grupo: $row[0] $NWB#phones-group_alias_id$NWE
Grupo Alias Nombre: $NWB#phones-group_alias_name$NWE
Número CallerID: $NWB#phones-caller_id_number$NWE
Nombre CallerID: $NWB#phones-caller_id_name$NWE
Activo:
\n"; + + + if ($LOGast_delete_phones > 0) + { + echo "

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

Haga clic aquí para ver Admin chages a este grupo, alias
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +} + + ###################### # ADD=311111111111 modify server record in the system ###################### @@ -11760,39 +17212,86 @@ if ($ADD==311111111111) echo "
\n"; echo ""; - $stmt="SELECT * from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 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_ip = $row[2]; + $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]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); echo "
MODIFICAR UN REGISTRO DEL 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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\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 Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
El Marcar Del Balance de VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Balance Offlimits de VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Host Del Telnet: $NWB#servers-telnet_host$NWE
Puerto Del Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
Funcionamiento Del Sistema: $NWB#servers-sys_perf_log$NWE
Registros Del Servidor: $NWB#servers-vd_server_logs$NWE
Salida de AGI: $NWB#servers-agi_output$NWE
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Sistema de carga: $sysload - $cpu%   $NWB#servers-sysload$NWE
Canales en vivo: $channels_total   $NWB#servers-channels_total$NWE
Uso del disco: $disk_usage   $NWB#servers-disk_usage$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Pide máximo por segundo: $NWB#servers-outbound_calls_per_second$NWE
El Marcar Del Balance de VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Balance Offlimits de VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Host Del Telnet: $NWB#servers-telnet_host$NWE
Puerto Del Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
Funcionamiento Del Sistema: $NWB#servers-sys_perf_log$NWE
Registros Del Servidor: $NWB#servers-vd_server_logs$NWE
Salida de AGI: $NWB#servers-agi_output$NWE
Grabación de Enlace Web: $NWB#servers-recording_web_link$NWE
Alternate Recording IP Del Servidor: $NWB#servers-alt_server_ip$NWE
Activa del servidor de Asterisk: $NWB#servers-active_asterisk_server$NWE
Generar los archivos de configuración: $NWB#servers-generate_vicidial_conf$NWE
Reconstruir los archivos de configuración: $NWB#servers-rebuild_conf_files$NWE
\n"; @@ -11830,7 +17329,7 @@ if ($ADD==311111111111) echo "
AGREGUE EL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL
\n"; echo "\n"; echo "\n"; - echo "TRUNKS:
\n"; + echo "TRONCOS:
\n"; echo "CAMPAÑA:
\n"; @@ -11840,23 +17339,56 @@ if ($ADD==311111111111) echo "

\n"; + ### list of carriers on this server + echo "
\n"; + echo "
TRANSPORTISTAS EN ESTE 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 IDNOMBREREGISTRATIONACTIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + ### list of phones on this server echo "
\n"; echo "
TELÉFONOS DENTRO DE ESTE 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=''; + $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++; + $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++;} @@ -11877,17 +17409,18 @@ if ($ADD==311111111111) echo "
EXTENSIÓNNOMBREACTIVO
\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=''; + $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++; + $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"';} @@ -11906,17 +17439,18 @@ if ($ADD==311111111111) echo "
CONFERENCEEXTENSIÓN
\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=''; + $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++; + $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"';} @@ -11932,13 +17466,226 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Este servidor tiene $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "Este servidor tiene $active_phones Teléfonos activos y $inactive_phones Teléfonos inactivos

\n"; echo "Este servidor tiene $active_confs active conferences

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

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

DELETE THIS SERVER\n"; + echo "

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

Haga clic aquí para ver Admin chages a este servidor\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +} + + +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
VD CONFERENCEEXTENSIÓN
\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 "
MODIFICAR UN REGISTRO CONF PLANTILLA: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Plantilla ID: $template_id
Nombre de plantilla: $NWB#vicidial_conf_templates-template_name$NWE
Plantilla de contenidos: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
TELÉFONOS DE UTILIZAR ESTE CONF PLANTILLA:
\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 "
EXTENSIÓNNOMBRESERVERACTIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
TRANSPORTISTAS DE UTILIZAR ESTE CONF PLANTILLA:
\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 "
CARRIERNOMBRESERVERACTIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

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

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

Haga clic aquí para ver a esta Administración chages conf plantilla
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión 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 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]; + + echo "
MODIFICAR UN REGISTRO DE TRANSPORTISTA: $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 "
Portador de Identificación: $carrier_id
Transportista Nombre: $NWB#vicidial_server_carriers-carrier_name$NWE
Cadena de registro: $NWB#vicidial_server_carriers-registration_string$NWE
ID de plantilla: $NWB#vicidial_server_carriers-template_id$NWE
Cuenta Entrada: $NWB#vicidial_server_carriers-account_entry$NWE
Protocolo: $NWB#vicidial_server_carriers-protocol$NWE
Globals Serie de caracteres: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entrada: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Del Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
Activo: $NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

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

Haga clic aquí para ver Admin chages a esta compañía aérea
\n"; } } else @@ -11984,7 +17731,7 @@ if ($ADD==3111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS CONFERENCE\n"; + echo "

ELIMINAR ESTA CONFERENCIA\n"; } } else @@ -12030,7 +17777,7 @@ if ($ADD==31111111111111) echo "
\n"; if ($LOGast_delete_phones > 0) { - echo "

DELETE THIS VICIDIAL CONFERENCE\n"; + echo "

ELIMINAR ESTA CONFERENCIA VICIDIAL\n"; } } else @@ -12053,7 +17800,7 @@ if ($ADD==311111111111111) 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 from system_settings;"; + $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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -12072,32 +17819,34 @@ if ($ADD==311111111111111) $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]; echo "
MODIFIQUE LOS AJUSTES DEL SISTEMA DE 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 "
Versión: $version
Install Date: $install_date
DB Schema Versión: $db_schema_version
Auto Usuario-add Value: $auto_user_add_value
Fecha de instalación: $install_date
Uso No-Latino: $NWB#settings-use_non_latin$NWE
Webroot Escribible: $NWB#settings-webroot_writable$NWE
Permita La Registración De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
Conexión del DB De QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Contraseña del DB De QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
Identificación Del Registro De QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
El Agente de VICIDIAL Inhabilita La Exhibición:
Permita Los Mensajes de SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
URL Casero Del Admin: $NWB#settings-admin_home_url$NWE
Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
Reloj de tiempo Fin de Día:$NWB#settings-timeclock_end_of_day$NWE
ÚltimaReloj de tiempo Auto Desconexión: $timeclock_last_reset_date
Tire de CC Última Hora: $qc_last_pull_time
Agente de la pantalla de encabezado Formato de fecha: $NWB#settings-vdc_header_date_format$NWE
Agente del cliente Fecha Formato de pantalla: $NWB#settings-vdc_customer_date_format$NWE
Agente Cliente Teléfono Formato de pantalla: $NWB#settings-vdc_header_phone_format$NWE
Agente activo de API:$NWB#settings-vdc_agent_api_active$NWE
CC Características Activo: $NWB#settings-qc_features_active$NWE
Salida activa de marcación automática: $NWB#settings-outbound_autodial_active$NWE
Max LLENAR Pide por segundo: $NWB#settings-outbound_calls_per_second$NWE
Permita La Registración De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
Conexión del DB De QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Contraseña del DB De QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
Identificación Del Registro De QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
Habilitar Vtiger Integración: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Haga clic aquí para sincronizar los usuarios con Vtiger\n"; + echo "
PP Vtiger IP del servidor: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Contraseña: $NWB#settings-vtiger_pass$NWE
Vtiger URL: $NWB#settings-vtiger_url$NWE
\n"; echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Haga clic aquí para ver chages a la administración de la configuración del sistema
\n"; + } + } else { @@ -12140,7 +17961,7 @@ if ($ADD==321111111111111) echo "
\n"; echo "ESTADOS DE VICIDIAL DENTRO DE ESTE SISTEMA:  $NWB#vicidial_statuses$NWE
\n"; echo "\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"; @@ -12208,7 +18029,7 @@ if ($ADD==321111111111111) echo "Estado:   \n"; echo "Descripción:
\n"; echo "Seleccionable:   \n"; - echo "Human Answer:   \n"; + echo "Respuesta humana:   \n"; echo "Categoría:\n"; echo "
ESTADODESCRIPCIÓNSELECT-
ABLE
HUMAN
ANSWER
CATEGORYMODIFY/DELETE
ESTADODESCRIPCIÓNSELECT-
ABLE
HUMANOS
RESPUESTA
CATEGORÍAMODIFY/DELETE
\n"; - echo "\n"; + echo "\n"; $stmt="SELECT * from vicidial_status_categories order by vsc_id;"; $rslt=mysql_query($stmt, $link); @@ -12253,12 +18074,12 @@ if ($ADD==331111111111111) 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]; - + $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; @@ -12297,12 +18118,13 @@ if ($ADD==331111111111111) echo "\n"; echo "$Avsc_id[$p]\n"; echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -12314,8 +18136,10 @@ if ($ADD==331111111111111) echo "
AGREGUE LA NUEVA CATEGORÍA DEL ESTADO
\n"; echo "\n"; echo "Category ID:   \n"; - echo "Name:   \n"; - echo "TimeOnVDAD Display:  
\n"; + echo "Name:  
\n"; + echo "TimeOnVDAD Exponer:   \n"; + echo "Categoría de venta:   \n"; + echo "Muerto líder Categoría:  
\n"; echo "Descripción:   \n"; echo "
\n"; @@ -12333,6 +18157,84 @@ if ($ADD==331111111111111) +###################### +# ADD=341111111111111 modify vicidial QC status code +###################### + +if ($ADD==341111111111111) +{ + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) + { + echo "
CATEGORYNOMBRETOVDADSTATUSES IN THIS CATEGORY
CATEGORÍANOMBREESTATUTOS EN ESTA CATEGORÍA
\n"; echo "$CATstatuses"; echo "
Descripción:
        \n"; + echo "
TO VDAD Exponer:     Categoría de venta:     Muerto líder Categoría:  
Descripción:
        \n"; echo "   ELIMINAR
 
\n"; + echo ""; + + echo "
\n"; + echo "CC CÓDIGOS VICIDIAL ESTADO DENTRO DE ESTE SISTEMA:  $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 CODEDESCRIPCIÓNMODIFY/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 "ELIMINAR\n"; + } + else + { + echo "ELIMINAR\n"; + } + echo "
\n"; + + echo "
Añadir CC NUEVO CÓDIGO ESTADO
\n"; + echo "\n"; + echo "Estado:   \n"; + echo "Descripción:
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } +} + + + + + ###################### # ADD=550 search form @@ -12427,13 +18329,13 @@ if ($ADD==8) { $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status='LIVE' and callback_time < '$past_month_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one month have been made INACTIVE\n"; + echo "
Usuario($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='LIVE' and callback_time < '$past_week_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one week have been made INACTIVE\n"; + echo "
Usuario($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
"; @@ -12535,7 +18437,7 @@ if ($ADD==8111) $CBquerySQLwhere = "and user_group='$user_group'"; -echo "
USER GROUP CALLBACK HOLD LISTINGS: $list_id\n"; +echo "
GRUPO DE USUARIOS CALLBACK HOLD LISTINGS: $list_id\n"; $oldADD = "ADD=8111&user_group=$user_group"; $ADD='82'; } @@ -12552,7 +18454,7 @@ $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,'; $LEVELlink='stage=LEVELUP';} +if (eregi("ENDATEDOWN",$stage)) {$SQLorder='order by entry_time desc,'; $NIVELlink='stage=NIVELUP';} $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') $CBquerySQLwhere $SQLorder recipient,status desc,callback_time"; $rslt=mysql_query($stmt, $link); @@ -12608,103 +18510,165 @@ echo "$CBinactiveLINK"; # ADD=0 display all active users ###################### if ($ADD==0) -{ -echo "
\n"; -echo ""; + { + echo "
\n"; + echo ""; + echo "
USUARIOS: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   mostrar sólo los usuarios activos\n"; + } + else + { + $SQLstatus = "where active='Y'"; + echo "   mostrar todos los usuarios\n"; + } -$USERlink='stage=USERIDDOWN'; -$NAMElink='stage=NAMEDOWN'; -$LEVELlink='stage=LEVELDOWN'; -$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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} -if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} -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 * from vicidial_users $SQLorder"; + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $NIVELlink='stage=NIVELDOWN'; + $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("NIVELUP",$stage)) {$SQLorder='order by user_level asc'; $NIVELlink='stage=NIVELDOWN';} + if (eregi("NIVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $NIVELlink='stage=NIVELUP';} + 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 $SQLstatus $SQLorder"; $rslt=mysql_query($stmt, $link); $people_to_print = mysql_num_rows($rslt); -echo "
USUARIOS:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
USER IDFULL NAMELEVELGROUPLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
ID USUARIONOMBRE COMPLETONIVELGROUPACTIVOENLACES
$row[1]$row[3]$row[4]$row[5]MODIFICAR | ESTADÍSTICAS | ESTADO | TIME
$row[0]$row[1]$row[2]$row[3]$row[4]
MODIFICAR | ESTADÍSTICAS | ESTADO | TIME
\n"; -} + echo "
\n"; + } ###################### # ADD=10 display all campaigns ###################### if ($ADD==10) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $campaigns_to_print = mysql_num_rows($rslt); -echo "
CAMPAÑAS:\n"; -echo "
\n"; + echo "
CAMPAÑAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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 ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo "\n"; $o++; - } + } -echo "
ID de campaña
NOMBRE
ACTIVE   DIAL MÉTODO   NIVEL   ORDEN DE PLOMO   DIAL ESTATUTOS   MODIFICAR
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=100 display all lists ###################### if ($ADD==100) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lists order by list_id"; + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $lists_to_print = mysql_num_rows($rslt); -echo "
LISTAS:\n"; -echo "
\n"; + echo "
LISTAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + $lists_printed = ''; $o=0; - while ($people_to_print > $o) { + while ($lists_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12712,14 +18676,40 @@ echo "
ID DE LA LISTANOMBRE DE LA LISTADESCRIPCIÓNENCABEZA COUNTACTIVOÚLTIMA FECHA DE CONVOCATORIACAMPAIGNMODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; 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 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 "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]   $row[2] $row[3] $row[4] $row[5] $row[6]MODIFICAR
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFICAR
\n"; -} + echo "
\n"; + } @@ -12727,19 +18717,29 @@ echo "
\n"; # ADD=1000 display all inbound groups ###################### if ($ADD==1000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $ingroups_to_print = mysql_num_rows($rslt); -echo "
GRUPOS DE ENTRADA :\n"; -echo "
\n"; + echo "
GRUPOS DE ENTRADA :\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($ingroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12747,34 +18747,88 @@ echo "
IN-GROUPNOMBREPRIORIDADACTIVOTIMECOLORMODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2] $row[3] $row[5]   $row[4]  MODIFICAR
\n"; } -echo "
\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 "
GRUPOS DE ENTRADA :\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 "
#DIDDESCRIPCIÓNACTIVOROUTEMODIFICAR
$row[0] $row[1] $row[2] $row[3] $row[4]MODIFICAR
\n"; + } ###################### # ADD=10000 display all remote agents ###################### if ($ADD==10000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $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); - $people_to_print = mysql_num_rows($rslt); + $remoteagents_to_print = mysql_num_rows($rslt); -echo "
AGENTES REMOTOS:\n"; -echo "
\n"; + echo "
AGENTES REMOTOS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($remoteagents_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12786,31 +18840,37 @@ echo "
USERLINESSERVIDOR   CONF-EXTEN   STATUS   CAMPAIGN   MODIFICAR
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[4] $row[5] $row[6]MODIFICAR
MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=100000 display all user groups ###################### if ($ADD==100000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $usergroups_to_print = mysql_num_rows($rslt); -echo "
GRUPOS DE USUARIO :\n"; -echo "
\n"; + echo "
GRUPOS DE USUARIO :\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($usergroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12818,31 +18878,38 @@ echo "
GRUPO DE USUARIOSNOMBRE DEL GRUPOFUERZA TIMECLOCK   MODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICAR
$row[2]MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000 display all scripts ###################### if ($ADD==1000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $scripts_to_print = mysql_num_rows($rslt); -echo "
ESCRITURAS DE LA VISIÓN:\n"; -echo "
\n"; + echo "
ESCRITURAS DE LA VISIÓN:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($scripts_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12850,32 +18917,37 @@ echo "
GUIÓN IDGUIÓN NOMBREACTIVE   MODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICAR
$row[2]MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000 display all filters ###################### if ($ADD==10000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; + $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 "
LISTADOS DEL FILTRO DEL PLOMO:\n"; -echo "
\n"; + echo "
LISTADOS DEL FILTRO DEL PLOMO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($filters_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12883,32 +18955,38 @@ echo "
FILTER IDFILTER NAMEMODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICAR
MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=100000000 display all call times ###################### if ($ADD==100000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_call_times order by call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $calltimes_to_print = mysql_num_rows($rslt); -echo "
LISTADOS DEL TIEMPO DE LA LLAMADA:\n"; -echo "
\n"; + echo "
LISTADOS DEL TIEMPO DE LA LLAMADA:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($calltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12916,33 +18994,41 @@ echo "
CALLTIME IDCALLTIME NOMBREPREDETERM PRINCIPIOPREDETERM STOPMODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFICAR
MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000000 display all state call times ###################### if ($ADD==1000000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $statecalltimes_to_print = mysql_num_rows($rslt); + + echo "
LISTADOS DEL TIEMPO DE LA LLAMADA DEL ESTADO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; -echo "
LISTADOS DEL TIEMPO DE LA LLAMADA DEL ESTADO:\n"; -echo "
CALLTIME IDCALLTIME STATECALLTIME NOMBREPREDETERM PRINCIPIOPREDETERM STOPMODIFICAR
\n"; $o=0; - while ($filters_to_print > $o) { + while ($statecalltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -12953,147 +19039,383 @@ echo "
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; + } + + echo "
$row[2] $row[3] $row[4] MODIFICAR
MODIFICAR
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000 display all shifts +###################### +if ($ADD==130000000) + { + 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 "
MAYÚS LISTADOS:\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 "
MAYÚS IDMAYÚS NOMBREMAYÚS PRINCIPIODURACIÓN SHIFTSEMANALMODIFICAR
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFICAR
\n"; + } ###################### # ADD=10000000000 display all phones ###################### if ($ADD==10000000000) -{ -echo "
\n"; -echo ""; + { + 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 * from phones $SQLorder"; + $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 "
LISTADOS DE TELÉFONOS:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
LISTADOS DE TELÉFONOS:\n"; + echo "
EXTENPROTOSERVERDIAL PLANESTADONOMBREVMAILLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo " + + + + + + + + "; + echo "\n"; $o++; + } + + echo "
EXTENPROTOSERVERPLAN DE DIALESTADONOMBREVMAILENLACES
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFICAR | ESTADÍSTICAS
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFICAR | ESTADÍSTICAS
\n"; } -echo "
\n"; -} +###################### +# ADD=12000000000 display all phones alias +###################### +if ($ADD==12000000000) + { + 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 "
TELÉFONO ALIAS LISTADOS:\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 "
ALIAS IDNOMBRE ALIASTELÉFONO LISTA LoginsMODIFICAR
$row[0]$row[1]$row[2]MODIFICAR
\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 "
GRUPO DE ALIAS LISTADOS:\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 "
GRUPO DE ALIAS IDALIAS GRUPO NOMBRECID NÚMERONOMBRE DEL CIDACTIVOMODIFICAR
$row[0]$row[1]$row[2]$row[3]$row[4]MODIFICAR
\n"; + } ###################### # ADD=100000000000 display all servers ###################### if ($ADD==100000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from servers order by server_id"; + $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); - $phones_to_print = mysql_num_rows($rslt); + $servers_to_print = mysql_num_rows($rslt); -echo "
LISTADOS DEL SERVIDOR:\n"; -echo "
\n"; + echo "
LISTADOS DEL SERVIDOR:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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 "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; + } + + echo "
SERVIDOR IDNOMBRESERVIDOR IPACTIVOASTERISKTRONCOSGMTMODIFICAR
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFICAR
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFICAR
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + 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 "
CONF PLANTILLA LISTADOS:\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 de plantillaNombre de plantillaMODIFICAR
$row[0]$row[1]MODIFICAR
\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 DE TRANSPORTISTA:\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 "
Portador de IdentificaciónNombre del transportistaIP Del ServidorProtocolRegistroActivoMODIFICAR
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]MODIFICAR
\n"; + } ###################### # ADD=1000000000000 display all conferences ###################### if ($ADD==1000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $conferences_to_print = mysql_num_rows($rslt); -echo "
LISTADOS DE CONFERENCIAS:\n"; -echo "
\n"; + echo "
LISTADOS DE CONFERENCIAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
CONFERENCESERVIDOR IPEXTENSIÓNMODIFICAR
$row[0] $row[1] $row[2]$row[4]  MODIFICAR
$row[1]$row[2]MODIFICAR
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000000000 display all vicidial conferences ###################### if ($ADD==10000000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $vicidialconf_to_print = mysql_num_rows($rslt); -echo "
LISTADOS DE CONFERENCIAS:\n"; -echo "
\n"; + echo "
VICIDIAL LISTADOS DE CONFERENCIAS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + while ($vicidialconf_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -13101,120 +19423,466 @@ echo "
CONFERENCESERVIDOR IPEXTENSIÓNMODIFICAR
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2]$row[4]  MODIFICAR
$row[2]MODIFICAR
\n"; + } + + + + + +###################### +# ADD=700000000000000 view all activity in the admin log +###################### + +if ($ADD==700000000000000) + { + echo "\n";echo "\n"; +$stmt="SELECT admin_home_url from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; + +?> +
+ + +
\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 "
ADMIN Change Log: (Última 10.000 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('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 "NEXT\n"; + echo "
\n"; + } + + +###################### +# ADD=710000000000000 view all activity in the admin log made by one user +###################### + +if ($ADD==710000000000000) + { + echo "\n"; +echo "
\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 "
ADMIN Change Log: Los cambios efectuados 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('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"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +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) + { + $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"; + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + 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]); + 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"; -} ###################### # ADD=999999 display reports section ###################### if ($ADD==999999) -{ - if ($LOGview_reports==1) { - echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - - $stmt="select * from servers;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $servers_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $servers_to_print) + 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;"; + $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); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; - $stmt="SELECT enable_queuemetrics_logging,queuemetrics_url from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging_LU = $row[0]; - $queuemetrics_url_LU = $row[1]; + ?> + + + + + VICIDIAL: Estadísticas e Informes servidor + VICIDIAL: Estadísticas e Informes servidor

+
\n"; + } else - { - echo "Usted no tiene permiso de visión esta página\n"; - exit; + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } } -} +echo "
\n"; echo "
\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n


\n
\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds"; -echo "                   VERSIÓN: $admin_version"; -echo "                   CONSTRUCCION: $build
\n"; - +echo "
\n"; +echo "

"; +echo "VERSIÓN: $admin_version
"; +echo "CONSTRUCCION: $build
\n"; ?> - +
@@ -13318,7 +19986,7 @@ if (isset($camp_lists)) $state_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday tiempo local + if ($GMT_day[$r]==0) #### Domingo tiempo local { if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) { @@ -13331,7 +19999,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday tiempo local + if ($GMT_day[$r]==1) #### Lunes tiempo local { if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) { @@ -13344,7 +20012,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday tiempo local + if ($GMT_day[$r]==2) #### Martes tiempo local { if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) { @@ -13357,7 +20025,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday tiempo local + if ($GMT_day[$r]==3) #### Miércoles tiempo local { if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) { @@ -13370,7 +20038,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday tiempo local + if ($GMT_day[$r]==4) #### Jueves tiempo local { if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) { @@ -13383,7 +20051,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday tiempo local + if ($GMT_day[$r]==5) #### Viernes tiempo local { if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) { @@ -13396,7 +20064,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday tiempo local + if ($GMT_day[$r]==6) #### Sábado tiempo local { if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) { @@ -13431,7 +20099,7 @@ if (isset($camp_lists)) $default_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday tiempo local + if ($GMT_day[$r]==0) #### Domingo tiempo local { if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) { @@ -13444,7 +20112,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday tiempo local + if ($GMT_day[$r]==1) #### Lunes tiempo local { if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) { @@ -13457,7 +20125,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday tiempo local + if ($GMT_day[$r]==2) #### Martes tiempo local { if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) { @@ -13470,7 +20138,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday tiempo local + if ($GMT_day[$r]==3) #### Miércoles tiempo local { if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) { @@ -13483,7 +20151,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday tiempo local + if ($GMT_day[$r]==4) #### Jueves tiempo local { if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) { @@ -13496,7 +20164,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday tiempo local + if ($GMT_day[$r]==5) #### Viernes tiempo local { if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) { @@ -13509,7 +20177,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday tiempo local + if ($GMT_day[$r]==6) #### Sábado tiempo local { if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) { diff --git a/LANG_www/vicidial_es/admin_header.php b/LANG_www/vicidial_es/admin_header.php new file mode 100644 index 00000000..1f8f46b5 --- /dev/null +++ b/LANG_www/vicidial_es/admin_header.php @@ -0,0 +1,932 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Usuarios     Campañas     Listas     Escrituras     Filtros     In-Groups     Grupos De Usuario     Agentes Remotos     Admin     Informes  
+ 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 Español
+ +
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + + + + 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) { + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # pink + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} # pink + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} # pink + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} # pink + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink + else {$status_sh=''; $status_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + + + + +
WIDTH=160> + SIZE=>Usuarios +
+   >Mostrar Usuarios +
+   >Añadir un nuevo usuario +
+   >Usuario Del Copiar +
+   >Búsqueda de un usuario +
+   >Estadísticas de usuario +
+   >Condición de Usuario +
+   >Hoja de tiempo
> + SIZE=>Campañas +
>   SIZE=>Principales Campañas
>   SIZE=>Estados
>   SIZE=>Teclas rápidas
>   SIZE=>Plomo Reciclado
>   SIZE=>Auto-Alt Dial
>   SIZE=>Mezcla lista
>   SIZE=>Pausa Códigos
> SIZE=>Listas
  + > Demuestre Las Listas +
  + > Agregue Una Nueva Lista +
  + > Búsqueda Para Un Plomo +
  + > Agregue El Número a DNC +
  + > Nuevos Plomos De la Carga +
> + SIZE=> Escrituras +
  + > Demuestre Las Escrituras +
  + > Agregue Una Nueva Escritura +
> SIZE=> Filtros
  + > Demuestre Los Filtros +
  + > Agregue Un Filtro Nuevo +
> + SIZE=> En-Grupos +
  + > Demuestre A En-Grupos +
  + > Agregue A Nuevo En-Grupo +
  + > En-Grupo Del Copiar +
  + > Mostrar DIDs +
  + > Añadir un nuevo DID +
  + > CopiarDID +
> + SIZE=> Grupos De Usuario +
  + > Demuestre A Grupos De Usuario +
  + > Agregue A Nuevo Grupo De Usuario +
  + > Informe Cada hora Del Grupo +
  + > Basura Grupo Cambio +
> + SIZE=> Agentes Alejados +
  + > Demuestre Los Agentes Alejados +
  + > Agregue Los Agentes Alejados Nuevos +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Tiempos De la Llamada
>   + SIZE=> Turnos
>   + SIZE=> Teléfonos
>   + SIZE=> Plantillas
>   + SIZE=> Transportistas
>   + SIZE=> Servidores
>   + SIZE=> Conferencias
>   + SIZE=> Ajustes Del Sistema
>   + SIZE=>Estados De Sistema
> + SIZE=> Informes +
+
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) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + \n"; + echo "Le no autorizan a visión esta página. Vaya por favor detrás.\n"; + } + +if (strlen($reports_hh) > 1) { + ?> +> + + + + +\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 * 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 * 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); @@ -336,10 +429,13 @@ else $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 * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -349,7 +445,7 @@ else $tsr = "$row[4]"; $vendor_id = "$row[5]"; $list_id = "$row[7]"; - $campaign_id = "$row[8]"; + $gmt_offset_now = "$row[8]"; $phone_code = "$row[10]"; $phone_number = "$row[11]"; $title = "$row[12]"; @@ -379,7 +475,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -399,10 +495,11 @@ 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 "
CASERO | Reloj de tiempo | Salir  
>   > Demuestre Las Campañas     |     > Agregue Una Nueva Campaña     |     > Campaña Del Copiar     |     > Campañas En tiempo real Sumarias
  > Demuestre Los Tiempos De la Llamada  | > Agregue Un Nuevo Rato De la Llamada  | > Demuestre Los Tiempos De la Llamada Del Estado  | > Agregue Un Nuevo Rato De la Llamada Del Estado
  > Mostrar cambios  | > Añadir un nuevo cambio
  > Demuestre Los Teléfonos  | > Agregue Un Teléfono Nuevo  | > Teléfono Alias Lista  | > Añadir un nuevo teléfono Alias  | > Grupo Alias Lista  | > Añadir un nuevo grupo de alias
  > Demuestre Las Conferencias   |   > Agregue Una Nueva Conferencia   |   > Demuestre Las Conferencias de VICIDIAL   |   > Agregue Una Nueva Conferencia de VICIDIAL
  > Demuestre Los Servidores   |   > Agregue Un Servidor Nuevo
  > Mostrar plantillas   |   > Añadir una nueva plantilla
  > Show Transportistas   |   > Add A New Carrier
  > Ajustes Del Sistema
  >Estados De Sistema   |   >Categorías Del Estado   |   >Códigos de estado de CC
  >Estadísticas de usuario   |   >Condición de Usuario   |   >Hoja de tiempo   |   >Situación días
>  
+ LICENSE: GPLv2 +# AST GUI database administration modify lead in vicidial_list +# admin_modify_lead.php +# +# this is the administration lead information modifier screen, the administrator +# 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 # - # 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 # require("dbconnect.php"); @@ -19,6 +40,8 @@ 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"];} @@ -93,40 +116,50 @@ 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); - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier 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 -# -# 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 -# - $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); - - $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); +############################################# +##### 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); - $auth=$row[0]; + $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");} @@ -183,21 +216,22 @@ echo "VICIDIAL ADMIN: Registro del Lead modi if ($end_call > 0) { -$call_length = ($STARTtime - $call_began); - - ### 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) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . 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); - ### 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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); echo "Información modificada

\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 @@ -226,18 +260,39 @@ $call_length = ($STARTtime - $call_began); echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; } - ### update last record in vicidial_agent_log and vicidial_log tables + ### 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 { @@ -281,6 +336,7 @@ else if ($lead_count > 0) { + ##### grab vicidial_log records ##### $stmt="select * 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); @@ -306,10 +362,47 @@ else $call_log .= "
$row[11] $row[3] $row[2] $row[1]
$row[1] $row[15]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$row[3] $row[2] $row[1]   $row[14]
  $row[14]   $row[17]
Provincia:
País :
Alt Phone :
Main Phone :
Alt Phone :
Email :
Seguridad:
Comentarios :
Comentarios :
Disposición: (with $log_campaign statuses)
Modify agent and vicidial logs
Modificarvicidial log
Modificaragent log
Modificarcloser log
Add closer log record
\n"; @@ -474,7 +575,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UsuarioID: \n"; echo "
\n"; } else @@ -484,7 +585,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UsuarioID: \n"; echo "
\n"; } } @@ -513,8 +614,8 @@ echo "

\n"; echo "
\n"; echo "LLAMADAS A ESTE LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD
\n"; +echo "\n"; echo "$call_log\n"; @@ -522,8 +623,8 @@ echo "
# DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD HANGUP REASON
\n"; echo "

\n"; echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD WAIT
\n"; +echo "\n"; echo "$closer_log\n"; @@ -531,13 +632,23 @@ echo "
# DATE/TIME LENGTH STATUS TSR CAMPAÑA 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 CAMPAIGN TSR PAUSE WAIT TALK DISPO STATUS GROUP SUB
\n"; +echo "

\n"; + + echo "RECORDINGS FOR THIS LEAD:\n"; echo "\n"; echo "\n"; - $stmt="select * 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); +$stmt="select * 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); $u=0; while ($logs_to_print > $u) @@ -549,6 +660,30 @@ echo " - + @@ -514,7 +553,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -522,13 +561,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -729,7 +768,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -737,13 +776,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -764,8 +803,14 @@ function ParseFileName() { print ""; } -if ($leadfile && filesize($LF_path)<=8388608) { +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 ""; @@ -953,7 +998,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -961,13 +1006,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1179,7 +1224,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1187,13 +1232,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1267,54 +1312,23 @@ if ($leadfile && filesize($LF_path)<=8388608) { for ($i=0; $i\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"; } } else if (!eregi(".csv", $leadfile_name)) @@ -1369,54 +1383,22 @@ if ($leadfile && filesize($LF_path)<=8388608) { $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); for ($i=0; $i\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 " \r\n"; @@ -1431,8 +1413,8 @@ if ($leadfile && filesize($LF_path)<=8388608) { # } print ""; } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: El archivo excede el límite 8MB.
"; +#} else if (filesize($leadfile)>8388608) { +# print "
ERROR: File exceeds the 8MB limit.
"; } ?> @@ -1554,17 +1536,17 @@ $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";} + 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 Sunday March to First Sunday November at 2 am. + # 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=Sunday, to 6=Saturday) + # dow INTEGER Day of week (0=Domingo, to 6=Sábado) # OPTIONAL INPUT: # timezone INTEGER hour difference UTC - local standard time # (DEFAULT is blank) @@ -1650,12 +1632,12 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} + 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 Sunday in April and last Sunday in October at 2 am. + # Based on first Domingo in April and last Domingo in October at 2 am. #********************************************************************** $USA_DST=0; @@ -1719,11 +1701,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + 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 Sunday in March and last Sunday in October at 1 am. + # Based on last Domingo in March and last Domingo in October at 1 am. #********************************************************************** $GBR_DST=0; @@ -1787,11 +1769,11 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + 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 Sunday in October and last Sunday in March at 1 am. + # Based on last Domingo in October and last Domingo in March at 1 am. #********************************************************************** $AUS_DST=0; @@ -1856,12 +1838,12 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} + 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 Sunday in October and last Sunday in March at 1 am. + # Based on first Domingo in October and last Domingo in March at 1 am. #********************************************************************** $AUST_DST=0; @@ -1923,11 +1905,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} + 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 Sunday in October and third Sunday in March at 1 am. + # Based on first Domingo in October and third Domingo in March at 1 am. #********************************************************************** $NZL_DST=0; @@ -1990,12 +1972,12 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + 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 Sunday October to Last Sunday February at 1 am. + # Based on Third Domingo October to Last Domingo February at 1 am. #********************************************************************** $BZL_DST=0; @@ -2066,4 +2048,7 @@ if (!$AC_processed) } return $gmt_offset; -} \ No newline at end of file +} + +?> +
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD2) + { + $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 diff --git a/LANG_www/vicidial_es/admin_search_lead.php b/LANG_www/vicidial_es/admin_search_lead.php index 536853f5..01229408 100644 --- a/LANG_www/vicidial_es/admin_search_lead.php +++ b/LANG_www/vicidial_es/admin_search_lead.php @@ -1,17 +1,23 @@ LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php +# admin_search_lead.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead +# AST GUI database administration search for lead info +# admin_modify_lead.php +# +# this is the administration lead information modifier 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 # require("dbconnect.php"); @@ -31,9 +37,16 @@ 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"];} $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); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -93,24 +106,49 @@ $browser = getenv("HTTP_USER_AGENT"); -VICIDIAL ADMIN: Buscar Lead - -Operaciones de búsqueda del Lead - - +VICIDIAL ADMIN: Buscar Lead <? -echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Lead search<BR>\n"; + +##### 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"); -if ( (!$vendor_id) and (!$phone) and (!$lead_id) ) + + + +echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user<BR>\n"; + + +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) { echo date("l F j, Y G:i:s A"); echo "\n<br><br><center>\n"; echo "<form method=post name=search action=\"$PHP_SELF\">\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<b>Por favor, Introduzca un:<br> Vendor ID(código del vendedor del Lead): <input type=text name=vendor_id size=10 maxlength=10> or \n"; - echo "<br><b>un número de teléfono de casa: <input type=text name=phone size=10 maxlength=10> or\n"; - echo "<br><b>ID del Lead: <input type=text name=lead_id size=10 maxlength=10> <br><br>\n"; + echo "<br><b>un número de teléfono de casa: <input type=text name=phone size=20 maxlength=16> or\n"; + echo "<br><b>ID del Lead: <input type=text name=lead_id size=10 maxlength=10> or\n"; + echo "<br><b>status: <input type=text name=status size=7 maxlength=6>   \n"; + echo "<b>list ID: <input type=text name=list_id size=15 maxlength=14>   \n"; + echo "<b>user: <input type=text name=user size=15 maxlength=20> <br><br>\n"; echo "<input type=submit name=submit value=ENVIAR></b>\n"; echo "</form>\n</center>\n"; echo "</body></html>\n"; @@ -138,8 +176,32 @@ else } else { - print "ERROR: you must search for something! Go back and search for something"; - exit; + 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 * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000"; + } + else + { + print "ERROR: you must search for something! Go back and search for something"; + exit; + } } } } @@ -182,13 +244,14 @@ else { $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]\">$row[0]</a></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"; @@ -197,11 +260,19 @@ else 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[2]</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 MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } diff --git a/LANG_www/vicidial_es/call_report_export.php b/LANG_www/vicidial_es/call_report_export.php new file mode 100644 index 00000000..b5c04d72 --- /dev/null +++ b/LANG_www/vicidial_es/call_report_export.php @@ -0,0 +1,513 @@ +<? +# 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) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# + +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["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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Nombre y contraseña inválidos del usuario 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"; + exit; + } + + + if ($RUNcampaign > 0) + { + $export_campaign_rows=''; + $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 from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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); + + $export_campaign_rows .= "$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]\r\n"; + $i++; + } + } + } + + if ($RUNgroup > 0) + { + $export_group_rows=''; + $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 from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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) + { + 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); + + $export_group_rows .= "$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]\r\n"; + $i++; + } + } + } + + + 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 PIDE INFORME DE EXPORTACIÓN', 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(); + + echo "$export_campaign_rows$export_group_rows"; + } + 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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>VICIDIAL: Pide Informe exportación"; + + ##### 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>Pide Informe exportación</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\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>Rango de Fecha:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campañas:</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>Grupos De entrada:</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>Listas:</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>Estados:</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>Grupos De Usuario:</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=ENVIAR VALUE=ENVIAR>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_es/dbconnect.php b/LANG_www/vicidial_es/dbconnect.php index 5247e166..dae8cc7a 100644 --- a/LANG_www/vicidial_es/dbconnect.php +++ b/LANG_www/vicidial_es/dbconnect.php @@ -1,6 +1,10 @@ <? # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# dbconnect.php version 2.0.5 +# +# database connection settings and some global web settings +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # if ( file_exists("/etc/astguiclient.conf") ) { @@ -36,6 +40,9 @@ $WeBServeRRooT = '/usr/local/apache2/htdocs'; } $link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +if (!$link) { + die('MySQL connect ERROR: ' . mysql_error()); +} mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; @@ -45,5 +52,9 @@ $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/LANG_www/vicidial_es/fcstats.php b/LANG_www/vicidial_es/fcstats.php new file mode 100644 index 00000000..c51f9c9e --- /dev/null +++ b/LANG_www/vicidial_es/fcstats.php @@ -0,0 +1,600 @@ +<? +# fcstats.php +# +# Copyright (C) 2009 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 +# + +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 "Nombre y contraseña inválidos del usuario: |$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;"; +$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> + +<? +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>VICIDIAL: In-Group Fronter-Closer Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFICAR | INFORMES \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 "VICIDIAL: In-Group Fronter-Closer Stats                      $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/LANG_www/vicidial_es/group_hourly_stats.php b/LANG_www/vicidial_es/group_hourly_stats.php index dce46183..6d90be87 100644 --- a/LANG_www/vicidial_es/group_hourly_stats.php +++ b/LANG_www/vicidial_es/group_hourly_stats.php @@ -1,12 +1,13 @@ LICENSE: GPLv2 -### +# group_hourly_stats.php +# +# Copyright (C) 2009 Matt Florell 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 # require("dbconnect.php"); @@ -104,14 +105,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL ADMIN: Stats Cada hora Del Grupo + +VICIDIAL ADMIN: Stats Cada hora Del Grupo <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + +##### 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"); + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> + + <CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: Stats Cada hora Del Grupo <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Stats Cada hora Del Grupo <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> @@ -234,7 +256,7 @@ echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; ?> -</TD></TR><TABLE> +</TD></TR></TABLE> </body> </html> diff --git a/LANG_www/vicidial_es/list_download.php b/LANG_www/vicidial_es/list_download.php new file mode 100644 index 00000000..f53e1a36 --- /dev/null +++ b/LANG_www/vicidial_es/list_download.php @@ -0,0 +1,130 @@ +<? +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Nombre y contraseña inválidos del usuario 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 * 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); + + 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]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_es/listloader.pl b/LANG_www/vicidial_es/listloader.pl index d926368b..b8f9e064 100644 --- a/LANG_www/vicidial_es/listloader.pl +++ b/LANG_www/vicidial_es/listloader.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -18,6 +17,8 @@ # 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 # ### begin parsing run-time options ### @@ -148,6 +149,23 @@ $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';"; @@ -547,14 +565,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_es/listloaderMAIN.php b/LANG_www/vicidial_es/listloaderMAIN.php index ab67fd40..c247c957 100644 --- a/LANG_www/vicidial_es/listloaderMAIN.php +++ b/LANG_www/vicidial_es/listloaderMAIN.php @@ -1,7 +1,7 @@ <? # listloaderMAIN.php # -# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2008 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 diff --git a/LANG_www/vicidial_es/listloader_rowdisplay.pl b/LANG_www/vicidial_es/listloader_rowdisplay.pl index 3f8695c0..bbfc8170 100644 --- a/LANG_www/vicidial_es/listloader_rowdisplay.pl +++ b/LANG_www/vicidial_es/listloader_rowdisplay.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl - -### listloader_rowdisplay.pl version 0.2 *DBI-version* -### -### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_rowdisplay.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# # # CHANGES # diff --git a/LANG_www/vicidial_es/listloader_super.pl b/LANG_www/vicidial_es/listloader_super.pl index 167fff5e..3af97f37 100644 --- a/LANG_www/vicidial_es/listloader_super.pl +++ b/LANG_www/vicidial_es/listloader_super.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader_super.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader_super.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -17,6 +16,8 @@ # 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 # ### begin parsing run-time options ### @@ -149,21 +150,38 @@ $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 ##### +########################################### - ### 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(); + +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; @@ -549,14 +567,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial_es/new_listloader_superL.php b/LANG_www/vicidial_es/new_listloader_superL.php index 2c481864..fcb7a70a 100644 --- a/LANG_www/vicidial_es/new_listloader_superL.php +++ b/LANG_www/vicidial_es/new_listloader_superL.php @@ -1,7 +1,7 @@ <? # new_listloader_superL.php # -# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -19,11 +19,17 @@ # 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 # # 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.0.4'; -$build = '70510-1518'; +$version = '2.0.5-29'; +$build = '90310-2128'; require("dbconnect.php"); @@ -47,6 +53,7 @@ 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"];} @@ -113,10 +120,28 @@ if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_co # $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); - +} $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -125,6 +150,7 @@ $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]; @@ -144,6 +170,9 @@ $browser = getenv("HTTP_USER_AGENT"); 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); @@ -290,7 +319,17 @@ function ParseFileName() { </script> <title>VICIDIAL ADMIN: Lead Loader - + + +
"; +?> + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> @@ -304,7 +343,7 @@ function ParseFileName() {
(Solamente números or leave blank for values in the file)
Phone Code Override: Teléfono Código Sobrescribir: (Solamente números or leave blank for values in the file)
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
diff --git a/LANG_www/vicidial_es/non_agent_api.php b/LANG_www/vicidial_es/non_agent_api.php new file mode 100644 index 00000000..2d525f39 --- /dev/null +++ b/LANG_www/vicidial_es/non_agent_api.php @@ -0,0 +1,1419 @@ + 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 +# + +$version = '2.0.5-5'; +$build = '90118-1056'; + +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"];} + + +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); +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) + { + $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); + } + +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';} + +$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; + } + + + + +################################################################################ +### 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';"; + if ($DB) {echo "|$stmt|\n";} + $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 + { + if ($dnc_check == 'Y') + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + if ($DB) {echo "|$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') + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';"; + if ($DB) {echo "|$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; + } + } + + ### 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';"; + if ($DB) {echo "$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) {echo "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) {echo "$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;"; + if ($DB) {echo "|$stmt|\n";} + $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) {echo "$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; + } + } + + + +$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 * 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 * 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 * 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 * 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 * 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-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 == '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 * 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 * 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/LANG_www/vicidial_es/remote_dispo.php b/LANG_www/vicidial_es/remote_dispo.php index 79c582c2..8483cc61 100644 --- a/LANG_www/vicidial_es/remote_dispo.php +++ b/LANG_www/vicidial_es/remote_dispo.php @@ -1,10 +1,12 @@ LICENSE: GPLv2 -### -# 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 - +# remote_dispo.php +# +# Copyright (C) 2008 Matt Florell 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 diff --git a/LANG_www/vicidial_es/timeclock_edit.php b/LANG_www/vicidial_es/timeclock_edit.php new file mode 100644 index 00000000..2fb25036 --- /dev/null +++ b/LANG_www/vicidial_es/timeclock_edit.php @@ -0,0 +1,478 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80624-1342 - First build +# 80701-1323 - functional beta version done +# 90310-2109 - Added admin header +# + +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 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]; + $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 "Nombre y contraseña inválidos del usuario: |$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; + } + } + + + +?> + + + +VICIDIAL ADMIN:Reloj de tiempo Record Edit +<? + +##### 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>Reloj de tiempo Record Edit for <? echo $user ?></TD><TD ALIGN=RIGHT>   </TD></TR> + +<? + +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 "ERROR-Hay un problema con los datos que ha introducido, por favor, volver<BR>\n"; + echo "Un período de sesiones timeclock no puede superponerse timeclock otro período de sesiones<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 "ERROR-Hay un problema con los datos que ha introducido, por favor, volver<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 USUARIOS: </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 USUARIOS: </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\">VICIDIAL Hoja de tiempo</a>\n"; +echo " - <a href=\"./user_stats.php?user=$user\">Estadísticas de usuario</a>\n"; +echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</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> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_es/timeclock_report.php b/LANG_www/vicidial_es/timeclock_report.php new file mode 100644 index 00000000..b47faac3 --- /dev/null +++ b/LANG_www/vicidial_es/timeclock_report.php @@ -0,0 +1,359 @@ +<? +# timeclock_report.php +# +# Copyright (C) 2009 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 +# + +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 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]; + $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 "Nombre y contraseña inválidos del usuario: |$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;"; +$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> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<TITLE>VICIDIAL: UsuarioReloj de tiempo Report + +<? + +##### 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>\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>Rango de Fecha:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Grupos De Usuario:</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>Usuario:</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\">INFORMES</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "VICIDIAL: UsuarioReloj de tiempo 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/LANG_www/vicidial_es/timeclock_status.php b/LANG_www/vicidial_es/timeclock_status.php new file mode 100644 index 00000000..b67b6d0d --- /dev/null +++ b/LANG_www/vicidial_es/timeclock_status.php @@ -0,0 +1,548 @@ +<? +# timeclock_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# + +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 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]; + $timeclock_end_of_day = $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"); +$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 "Nombre y contraseña inválidos del usuario: |$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;"; +$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>VICIDIAL ADMIN:Reloj de tiempo Status +<? + +##### 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>Reloj de tiempo Status for <? echo $user_group ?></TD><TD ALIGN=RIGHT>             +<? +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 USUARIOS</a>\n"; +?> +</TD></TR> + + + + +<? + +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 USUARIOS: $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 CAMPAIGN</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 + } + + 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]);} + + $s++; + } + $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> + +<? +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 TIEMPO 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> FECHA</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> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_es/user_group_bulk_change.php b/LANG_www/vicidial_es/user_group_bulk_change.php new file mode 100644 index 00000000..e078a740 --- /dev/null +++ b/LANG_www/vicidial_es/user_group_bulk_change.php @@ -0,0 +1,269 @@ +<? +# 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 +# + +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 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]; + $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 "Nombre y contraseña inválidos del usuario: |$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 * 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>VICIDIAL ADMIN: Grupo de Usuarios de Basura Cambio +<? + +##### 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>   Grupo de Usuarios de Basura Cambio</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<? + +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 Del Usuario $old_group Usuarios changed to the $group Grupo Del Usuario<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 USUARIOS 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 Usuarios changed to the $group Grupo Del Usuario<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 USUARIOS 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 Usuarios 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 Usuarios 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> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_es/user_stats.php b/LANG_www/vicidial_es/user_stats.php index f4351011..c4d0ca10 100644 --- a/LANG_www/vicidial_es/user_stats.php +++ b/LANG_www/vicidial_es/user_stats.php @@ -1,14 +1,22 @@ <? -### user_stats.php -### -### Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# user_stats.php +# +# Copyright (C) 2009 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 # header ("Content-type: text/html; charset=utf-8"); @@ -19,16 +27,18 @@ $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"];} + 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"])) {$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["submit"])) {$submit=$_GET["submit"];} +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"];} +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); @@ -66,6 +76,7 @@ $browser = getenv("HTTP_USER_AGENT"); $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); } @@ -73,6 +84,8 @@ $browser = getenv("HTTP_USER_AGENT"); { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -88,14 +101,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> <html> <head> -<title>VICIDIAL ADMIN: User Stats + +VICIDIAL ADMIN: Estadísticas de usuario <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Estadísticas de usuario for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> @@ -105,81 +139,130 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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=user value=\"$user\">\n"; +echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n"; echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>  \n"; +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\n"; +echo "           $user - $full_name<BR><BR>\n"; -echo " - <a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_status.php?user=$user\">User Status</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Hoja de tiempo</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">Condición de Usuario</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\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); - $statuses_to_print = mysql_num_rows($rslt); - echo "<br><center>\n"; -echo "<B>TIEMPO Y ESTADO DE CONVERSACIÓN:</B>\n"; +##### vicidial agent talk time and status ##### + +echo "<B>VICIDIAL TIEMPO Y ESTADO DE CONVERSACIÓN:</B>\n"; echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=2>ESTADO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo "<tr $bgcolor><td><font size=2>$row[1]</td>"; - echo "<td align=right><font size=2> $row[0]</td>\n"; - echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; +$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 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'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; +$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_seconds = $call_sec[$o]; $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); + $call_hours_int = round($call_hours, 2); + $call_hours_int = intval("$call_hours_int"); $call_minutes = ($call_hours - $call_hours_int); $call_minutes = ($call_minutes * 60); $call_minutes_int = round($call_minutes, 0); if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + 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_int:$call_minutes_int</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_seconds = $total_sec; +$call_hours = ($call_seconds / 3600); +$call_hours_int = round($call_hours, 2); +$call_hours_int = intval("$call_hours_int"); +$call_minutes = ($call_hours - $call_hours_int); +$call_minutes = ($call_minutes * 60); +$call_minutes_int = round($call_minutes, 0); +if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + echo "<tr><td><font size=2>LLAMADAS TOTALES </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; echo "</TABLE></center>\n"; + + +##### Login and Logout time from vicidial agent interface ##### + echo "<br><br>\n"; echo "<center>\n"; -echo "<B>TIEMPO LOGIN/LOGOUT:</B>\n"; +echo "<B>VICIDIAL AGENTE TIEMPO 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> FECHA</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HORAS:MINUTOS</td></tr>\n"; @@ -215,8 +298,8 @@ echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><t $event_seconds = ($event_stop_seconds - $event_start_seconds); $total_login_time = ($total_login_time + $event_seconds); $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); + $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); @@ -245,8 +328,8 @@ echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><t } $total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); $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); @@ -255,18 +338,152 @@ if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_mi 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_int:$total_login_minutes_int</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>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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> CAMPAÑA</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></tr>\n"; +echo "<B>TIMECLOCK TIEMPO 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> FECHA</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><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 = ($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><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_int:$event_minutes_int"; + 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 = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); +$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";} + + 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_int:$total_login_minutes_int </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> CAMPAÑA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n"; + + $stmt="select * 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 "</tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound calls for this time period ##### + +echo "<B>SALIENTE 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> CAMPAÑA</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 * 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); @@ -290,18 +507,20 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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></center><BR><BR>\n"; +echo "</TABLE><BR><BR>\n"; +##### vicidial agent inbound calls for this time period ##### -echo "<B>CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=650 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> CAMPAÑA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\n"; +echo "<B>Entrantes/CLOSER 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> CAMPAÑA</td><td align=right><font size=2> WAIT (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 * 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); @@ -325,7 +544,8 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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></tr>\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[17] </td></tr>\n"; } @@ -333,7 +553,7 @@ echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left 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"; @@ -353,6 +573,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$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 @@ -375,7 +619,45 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon } -echo "</TABLE></center>\n"; +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound user manual calls for this time period ##### + +echo "<B>MANUAL SALIENTE 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"); diff --git a/LANG_www/vicidial_es/user_status.php b/LANG_www/vicidial_es/user_status.php index 0bc09f99..847576e2 100644 --- a/LANG_www/vicidial_es/user_status.php +++ b/LANG_www/vicidial_es/user_status.php @@ -1,11 +1,15 @@ <? -### user_status.php -### -### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 -### +# 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 # header ("Content-type: text/html; charset=utf-8"); @@ -16,7 +20,7 @@ $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"];} + 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"];} @@ -25,21 +29,43 @@ 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"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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"); +$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]; @@ -61,18 +87,27 @@ $browser = getenv("HTTP_USER_AGENT"); if($auth>0) { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; + $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]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + $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 { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($webroot_writable > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } } $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; @@ -99,6 +134,19 @@ $browser = getenv("HTTP_USER_AGENT"); $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 * from vicidial_campaigns;"; @@ -118,14 +166,35 @@ while ($i < $groups_to_print) ?> <html> <head> -<title>VICIDIAL ADMIN: User Status + +VICIDIAL ADMIN: Condición de Usuario <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=<? echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Condición de Usuario for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> @@ -134,43 +203,216 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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") -{ + { $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; $rslt=mysql_query($stmt, $link); echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<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='Reloj de tiempo 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='Usuario login time: $last_action_sec|Reloj de tiempo 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 "<PRE>"; - echo "Agent Logged in at server: $Aserver_ip\n"; - echo " in session: $Asession_id\n"; - echo " from phone: $Aextension\n"; - echo "Agent is in campaign: $Acampaign\n"; - echo " status: $Astatus\n"; - echo " hungup last call at: $Alast_call\n"; - echo " Closer groups: $Acl_campaigns\n\n"; + { + echo "<BR>\n"; + echo "$user - $full_name \n"; + echo "       GROUP: $user_group <BR>\n"; - echo "</PRE>"; + 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"; + 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 Campaña: <SELECT SIZE=1 NAME=group>\n"; @@ -182,29 +424,56 @@ if ($agents_to_print > 0) $o++; } echo "</SELECT>\n"; - echo "<input type=submit name=submit value=CHANGE><BR></form>\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 "Agent is not logged in to VICIDIAL\n<BR>"; + } -} +echo "\n<BR>"; + +if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) + { + echo "Usuario $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 "Usuario $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"; + } -echo "           $user - $full_name \n"; -echo "       GROUP: $user_group <BR><BR>\n"; - -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; +$REPORTdate = date("Y-m-d"); +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Hoja de tiempo</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">Estadísticas de usuario</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; @@ -212,7 +481,7 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; $ENDtime = date("U"); -$RUNtime = ($ENDtime - $STARTtime); +$RUNtime = ($ENDtime - $StarTtimE); echo "\n\n\n<br><br><br>\n\n"; @@ -236,7 +505,3 @@ exit; ?> - - - - diff --git a/LANG_www/vicidial_es/vdremote.php b/LANG_www/vicidial_es/vdremote.php index b0eef2f5..75559792 100644 --- a/LANG_www/vicidial_es/vdremote.php +++ b/LANG_www/vicidial_es/vdremote.php @@ -1,7 +1,10 @@ <? # vdremote.php # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# make sure you have added a user to the vicidial_users MySQL table with at +# least user_level 4 to access this page the first time +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -9,7 +12,6 @@ # 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 # -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time $version = '1.1.12'; $build = '60619-1603'; diff --git a/LANG_www/vicidial_es/vicidial_admin_web_logo.gif b/LANG_www/vicidial_es/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/LANG_www/vicidial_es/vicidial_admin_web_logo.gif differ diff --git a/LANG_www/vicidial_es/vicidial_admin_web_logo_small.gif b/LANG_www/vicidial_es/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/LANG_www/vicidial_es/vicidial_admin_web_logo_small.gif differ diff --git a/LANG_www/vicidial_es/vicidial_sales_viewer.php b/LANG_www/vicidial_es/vicidial_sales_viewer.php new file mode 100644 index 00000000..6d9608c9 --- /dev/null +++ b/LANG_www/vicidial_es/vicidial_sales_viewer.php @@ -0,0 +1,236 @@ +<? header("Pragma: no-cache"); +# +# vicidial_sales_viewer.php - VICIDIAL administration page +# +# +# Copyright (C) 2009 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# + +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"];} + +?> +<html> +<head> +<title>VICIDIAL recent sales lookup + + + + + +
"; +?> + +
+ + + + + + + + + + + + + + + + + + + + + +
Vicidial SALIENTE recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a VICIDIAL 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)
Campaña 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/LANG_www/vicidial_es/vtiger_search.php b/LANG_www/vicidial_es/vtiger_search.php new file mode 100644 index 00000000..5e9c9761 --- /dev/null +++ b/LANG_www/vicidial_es/vtiger_search.php @@ -0,0 +1,788 @@ + 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 +# +# 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 +# + +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 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]; + } +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; + +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;} + + + + + +########################################################################## +##### 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 + { + 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) + { + 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]; + + 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/LANG_www/vicidial_es/vtiger_user.php b/LANG_www/vicidial_es/vtiger_user.php new file mode 100644 index 00000000..695c1622 --- /dev/null +++ b/LANG_www/vicidial_es/vtiger_user.php @@ -0,0 +1,316 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# + +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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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/LANG_www/vicidial_es/welcome.php b/LANG_www/vicidial_es/welcome.php index f43e47b1..4c2e644f 100644 --- a/LANG_www/vicidial_es/welcome.php +++ b/LANG_www/vicidial_es/welcome.php @@ -1,20 +1,21 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # echo "VICIDIAL Bienvenido\n"; echo "\n"; echo "\n"; -echo "




"; +echo "




"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "
Recepción
 
Agent Login
 
Reloj de tiempo
 
Administration
 
\n"; diff --git a/LANG_www/vicidial_es/welcome_demo.php b/LANG_www/vicidial_es/welcome_demo.php new file mode 100644 index 00000000..49c0e470 --- /dev/null +++ b/LANG_www/vicidial_es/welcome_demo.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_es/welcome_languages.php b/LANG_www/vicidial_es/welcome_languages.php new file mode 100644 index 00000000..a89bbfcb --- /dev/null +++ b/LANG_www/vicidial_es/welcome_languages.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_fr/AST_CLOSER_service_level.php b/LANG_www/vicidial_fr/AST_CLOSER_service_level.php new file mode 100644 index 00000000..f85af0cc --- /dev/null +++ b/LANG_www/vicidial_fr/AST_CLOSER_service_level.php @@ -0,0 +1,956 @@ + 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$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); +$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 "Login ou mot de passe invalide: |$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 from vicidial_inbound_groups;"; +$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++; + } +?> + + + + + +\n"; +echo "VICIDIAL: VDAD Closer Service Level Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFIER | RAPPORTS \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\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 "VICIDIAL: Closer Service-Level Stats                      $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 "---------- CALL TIME HOLD RÉPARTITION EN SECONDES\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE REPONSE (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/LANG_www/vicidial_fr/AST_CLOSERstats.php b/LANG_www/vicidial_fr/AST_CLOSERstats.php new file mode 100644 index 00000000..a2ed1a76 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_CLOSERstats.php @@ -0,0 +1,1508 @@ + 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### 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); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = ($local_gmt * 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 "Login ou mot de passe invalide: |$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 from vicidial_inbound_groups;"; +$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++; + } + +$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 "VICIDIAL: Statistiques VDAD Closer\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 "Date Range:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "Groupes entrants: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "MODIFIER | "; +echo "RAPPORTS | "; +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 "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\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 "VICIDIAL: Statistiques appel-automatique CLOSER: $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');";
+$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);
+	}
+$REPONSEEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($REPONSEEDcalls < 1) or ($TOTALcalls < 1) )
+	{$REPONSEEDpercent = '0';}
+else
+	{
+	$REPONSEEDpercent = (($REPONSEEDcalls / $TOTALcalls) * 100);
+	$REPONSEEDpercent = round($REPONSEEDpercent, 0);
+	}
+if ( ($rowy[0] < 1) or ($REPONSEEDcalls < 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 des appels pris en Dans ce groupe:        $TOTALcalls\n";
+echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
+echo "Answered Calls:                               $REPONSEEDcalls  $REPONSEEDpercent%\n";
+echo "Average queue time for Answered Calls:        $average_answer_seconds seconds\n";
+echo "Calls taken into the IVR for this In-Groupe:   $IVRcalls\n";
+
+
+echo "\n";
+echo "---------- ABANDONNES\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 ( ($REPONSEEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_REPONSEEDpercent = '0';}
+else
+	{
+	$DROP_REPONSEEDpercent = (($DROPcalls / $REPONSEEDcalls) * 100);
+	$DROP_REPONSEEDpercent = round($DROP_REPONSEEDpercent, 0);
+	}
+
+echo "Total des appels abandonnés: $DROPcalls  $DROPpercent%               drop/answered: $DROP_REPONSEEDpercent%\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;";
+	$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;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$row=mysql_fetch_row($rslt);
+	$answer_sec_pct_rt_stat_two = $row[0];
+
+	if ( ($REPONSEEDcalls > 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 / $REPONSEEDcalls) * 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 / $REPONSEEDcalls) * 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/Total des appels pris in to this In-Group):  $REPONSEEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_REPONSEEDpercent%\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 "---------- CALL TIME HOLD RÉPARTITION EN SECONDES\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 REPONSEED 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') 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 "---------- FAIT APPEL Hangup STATS\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          | CATÉGORIE             | 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_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
+
+	$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_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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 CATÉGORIE STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| CATÉGORIE             | 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";
+
+
+##############################
+#########  USER STATS
+
+$TOTagents=0;
+$TOTcalls=0;
+$TOTtime=0;
+$TOTavg=0;
+
+echo "\n";
+echo "---------- AGENT STATS\n";
+echo "+--------------------------+------------+----------+--------+\n";
+echo "| AGENT                    | CALLS      | TIME M   | AVRG M |\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]);
+	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
+	$USERcalls =	sprintf("%10s", $row[2]);
+	$USERtotTALK =	$row[3];
+	$USERavgTALK =	$row[4];
+
+	$USERtotTALK_M = ($USERtotTALK / 60);
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
+	$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";
+	$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
+	$USERtotTALK_MS =		sprintf("%8s", $USERtotTALK_MS);
+
+	$USERavgTALK_M = ($USERavgTALK / 60);
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
+	$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 = eregi_replace('-','',$USERavgTALK_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 = round($TOTavg, 0);
+	$TOTavg_M = ($TOTavg / 60);
+	$TOTavg_M_int = round($TOTavg_M, 2);
+	$TOTavg_M_int = intval("$TOTavg_M_int");
+	$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
+	$TOTavg_S = ($TOTavg_S * 60);
+	$TOTavg_S = round($TOTavg_S, 0);
+	if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
+	$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
+	$TOTavg =		sprintf("%6s", $TOTavg_MS);
+	}
+
+$TOTtime_M = ($TOTtime / 60);
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
+$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 =		sprintf("%6s", $TOTtime_MS);
+
+$TOTagents =		sprintf("%10s", $i);
+$TOTcalls =			sprintf("%10s", $TOTcalls);
+$TOTtime =			sprintf("%8s", $TOTtime);
+$TOTavg =			sprintf("%6s", $TOTavg);
+
+echo "+--------------------------+------------+----------+--------+\n";
+echo "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
+echo "+--------------------------+------------+----------+--------+\n";
+
+
+##############################
+#########  TIME STATS
+
+echo "\n";
+echo "---------- STATISTIQUE TEMPORELLES\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",$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 "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS 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 REPONSEED 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/LANG_www/vicidial_fr/AST_IVRfilter.php b/LANG_www/vicidial_fr/AST_IVRfilter.php new file mode 100644 index 00000000..5ffad7c5 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_IVRfilter.php @@ -0,0 +1,248 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +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 "Login ou mot de passe invalide: |$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 "Date Range:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "RAPPORTS\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 "| CATÉGORIE             | 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='ENTRANT_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='ENTRANT_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='ENTRANT_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='ENTRANT_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='ENTRANT_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 AGENT   | $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/LANG_www/vicidial_fr/AST_IVRstats.php b/LANG_www/vicidial_fr/AST_IVRstats.php new file mode 100644 index 00000000..c161c8f0 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_IVRstats.php @@ -0,0 +1,684 @@ + 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +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); +$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 "Login ou mot de passe invalide: |$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 from vicidial_inbound_groups;"; +$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++; + } + +$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 "VICIDIAL: IVR 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 "Date Range:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "Groupes entrants: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "MODIFIER | "; +echo "RAPPORTS | "; +echo "RAPPORT SUR LES CLOSERS \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 "S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre\n";
+}
+
+else
+{
+
+
+echo "VICIDIAL: IVR Stats: $group_string          $NOW_TIME\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 CALLS 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 "---------- STATISTIQUE TEMPORELLES\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 "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS 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/LANG_www/vicidial_fr/AST_VDADstats.php b/LANG_www/vicidial_fr/AST_VDADstats.php new file mode 100644 index 00000000..03ec4015 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_VDADstats.php @@ -0,0 +1,1011 @@ + 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 +# + +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["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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$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); +$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 "Login ou mot de passe invalide: |$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 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_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_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 "VICIDIAL: VDAD Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "
Dates:
"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campagnes:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " MODIFIER | \n"; + echo " RAPPORTS \n"; + } +else + { + echo " CAMPAGNES | \n"; + echo " RAPPORTS \n"; + } +echo "
"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (strlen($group[0]) < 1)
+{
+echo "\n\n";
+echo "VEUILLEZ SELECTIONNER UNE CAMPAGNE ET UNE DATE CI-DESSUS ET CLIQUEZ SUR VALIDER\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 "VICIDIAL: Auto-dial Stats                             $NOW_TIME\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_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$TOTALcalls =	sprintf("%10s", $row[0]);
+$TOTALsec =		$row[1];
+if ( ($row[0] < 1) or ($TOTALsec < 1) )
+	{$average_hold_seconds = '         0';}
+else
+	{
+	$average_hold_seconds = ($TOTALsec / $row[0]);
+	$average_hold_seconds = round($average_hold_seconds, 2);
+	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
+	}
+echo "Total des appels placés dans cette campagne: $TOTALcalls\n";
+echo "Durée moyenne des appels pour tous les appels en secondes: $average_hold_seconds\n";
+
+
+echo "\n";
+echo "---------- ABANDONNES\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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$DROPcalls =	sprintf("%10s", $row[0]);
+$DROPcallsRAW =	$row[0];
+$DROPseconds =	$row[1];
+
+
+# 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]";
+	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) {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]";
+	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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$REPONSEcalls =	$row[0];
+
+if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
+	{$DROPpercent = '0';}
+else
+	{
+	$DROPpercent = (($DROPcallsRAW / $TOTALcalls) * 100);
+	$DROPpercent = round($DROPpercent, 2);
+	}
+
+if ( ($DROPcalls < 1) or ($REPONSEcalls < 1) )
+	{$DROPREPONSEpercent = '0';}
+else
+	{
+	$DROPREPONSEpercent = (($DROPcallsRAW / $REPONSEcalls) * 100);
+	$DROPREPONSEpercent = round($DROPREPONSEpercent, 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);
+	}
+
+echo "Total des appels abandonnés: $DROPcalls  $DROPpercent%\n";
+echo "Percent of DROP Calls taken out of Answers:   $DROPcalls / $REPONSEcalls  $DROPREPONSEpercent%\n";
+echo "Durée moyenne pour les appels abandonnés en secondes:    $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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$TOTALanswers = ($row[0] + $REPONSEcalls);
+
+
+$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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+$agent_non_pause_sec = $row[0];
+
+if ($agent_non_pause_sec > 0)
+	{
+	$AVG_REPONSEagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+	$AVG_REPONSEagent_non_pause_sec = round($AVG_REPONSEagent_non_pause_sec, 2);
+	}
+else
+	{$AVG_REPONSEagent_non_pause_sec=0;}
+$AVG_REPONSEagent_non_pause_sec = sprintf("%10s", $AVG_REPONSEagent_non_pause_sec);
+
+echo "Productivity Rating:                          $AVG_REPONSEagent_non_pause_sec\n";
+
+
+
+
+echo "\n";
+echo "---------- APPELS AUTOMATIQUES SANS REPONSES\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','B') and (length_in_sec <= 60 or length_in_sec is null);";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$NAcalls =	sprintf("%10s", $row[0]);
+if ( ($NAcalls < 1) or ($TOTALcalls < 1) )
+	{$NApercent = '0';}
+else
+	{
+	$NApercent = (($NAcalls / $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);
+	}
+
+echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls  $NApercent%\n";
+echo "Durée moyenne des appels pour les appels NA en secondes:  $average_na_seconds\n";
+
+
+##############################
+#########  CALL HANGUP REASON STATS
+
+$TOTALcalls = 0;
+
+echo "\n";
+echo "---------- FAIT APPEL Hangup STATS\n";
+echo "+----------------------+------------+\n";
+echo "| HANGUP REASON        | CALLS      |\n";
+echo "+----------------------+------------+\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) {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 REPONSE           ';}
+	if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
+
+	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 "|        |                      |                      |            |      CALL TIME                   |AGENT TIME|\n";
+echo "| STATUS | DESCRIPTION          | CATÉGORIE             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+
+
+## 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' $group_SQLand 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]";
+	}
+
+
+## get counts and time totals for all statuses in this campaign
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END'  $group_SQLand group by status;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$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;
+	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 + $row[0]);
+	$STATUSrate =	($STATUScount / ($TOTALsec / 3600) );
+		$STATUSrate =	sprintf("%.2f", $STATUSrate);
+	$AGENTrate =	($STATUScount / ($AGENTsec / 3600) );
+		$AGENTrate =	sprintf("%.2f", $AGENTrate);
+
+	$STATUShours_H =	($row[2] / 3600);
+	$STATUShours_H_int = round($STATUShours_H, 2);
+	$STATUShours_H_int = intval("$STATUShours_H_int");
+	$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
+	$STATUShours_M = ($STATUShours_M * 60);
+	$STATUShours_M_int = round($STATUShours_M, 2);
+	$STATUShours_M_int = intval("$STATUShours_M_int");
+	$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
+	$STATUShours_S = ($STATUShours_S * 60);
+	$STATUShours_S = round($STATUShours_S, 0);
+	if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
+	if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
+	$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
+
+	$STATUSavg_H =	(($row[2] / 3600) / $STATUScount);
+	$STATUSavg_H_int = round($STATUSavg_H, 2);
+	$STATUSavg_H_int = intval("$STATUSavg_H_int");
+	$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
+	$STATUSavg_M = ($STATUSavg_M * 60);
+	$STATUSavg_M_int = round($STATUSavg_M, 2);
+	$STATUSavg_M_int = intval("$STATUSavg_M_int");
+	$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
+	$STATUSavg_S = ($STATUSavg_S * 60);
+	$STATUSavg_S = round($STATUSavg_S, 0);
+	if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
+	if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
+	$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
+
+	$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);}
+	$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');}	
+		}
+
+	echo "| $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_H =	($AGENTsec / 3600);
+	$aTOTALhours_H_int = round($aTOTALhours_H, 2);
+	$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
+	$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
+	$aTOTALhours_M = ($aTOTALhours_M * 60);
+	$aTOTALhours_M_int = round($aTOTALhours_M, 2);
+	$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
+	$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
+	$aTOTALhours_S = ($aTOTALhours_S * 60);
+	$aTOTALhours_S = round($aTOTALhours_S, 0);
+	if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
+	if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
+	$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
+
+	$TOTALhours_H =	($TOTALsec / 3600);
+	$TOTALhours_H_int = round($TOTALhours_H, 2);
+	$TOTALhours_H_int = intval("$TOTALhours_H_int");
+	$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
+	$TOTALhours_M = ($TOTALhours_M * 60);
+	$TOTALhours_M_int = round($TOTALhours_M, 2);
+	$TOTALhours_M_int = intval("$TOTALhours_M_int");
+	$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
+	$TOTALhours_S = ($TOTALhours_S * 60);
+	$TOTALhours_S = round($TOTALhours_S, 0);
+	if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
+	if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
+	$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
+
+	$TOTALavg_H =	(($TOTALsec / 3600) / $TOTALcalls);
+	$TOTALavg_H_int = round($TOTALavg_H, 2);
+	$TOTALavg_H_int = intval("$TOTALavg_H_int");
+	$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
+	$TOTALavg_M = ($TOTALavg_M * 60);
+	$TOTALavg_M_int = round($TOTALavg_M, 2);
+	$TOTALavg_M_int = intval("$TOTALavg_M_int");
+	$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
+	$TOTALavg_S = ($TOTALavg_S * 60);
+	$TOTALavg_S = round($TOTALavg_S, 0);
+	if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
+	if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
+	$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
+	}
+$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);}
+
+echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
+echo "| TOTAL:                                               | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate |          |\n";
+echo "|   AGENT TIME                                                      | $aTOTALhours |                     | $aTOTALrate |\n";
+echo "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
+
+
+
+##############################
+#########  STATUS CATEGORY STATS
+
+echo "\n";
+echo "---------- CUSTOM STATUS CATÉGORIE STATS\n";
+echo "+----------------------+------------+--------------------------------+\n";
+echo "| CATÉGORIE             | 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";
+
+
+
+##############################
+#########  USER STATS
+
+$TOTagents=0;
+$TOTcalls=0;
+$TOTtime=0;
+$TOTavg=0;
+
+echo "\n";
+echo "---------- AGENT STATS\n";
+echo "+--------------------------+------------+----------+--------+\n";
+echo "| AGENT                    | CALLS      | TIME M   | AVRG M |\n";
+echo "+--------------------------+------------+----------+--------+\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) {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]);while(strlen($user)>6) {$user = substr("$user", 0, -1);}
+	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_M = ($USERtotTALK / 60);
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
+	$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";
+	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
+
+	$USERavgTALK_M = ($USERavgTALK / 60);
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
+	$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 "| $user - $full_name | $USERcalls |   $USERtotTALK_MS | $USERavgTALK_MS |\n";
+
+	$i++;
+	}
+
+if (!$TOTcalls) {$TOTcalls = 1;}
+$TOTavg = ($TOTtime / $TOTcalls);
+$TOTavg = round($TOTavg, 0);
+$TOTavg_M = ($TOTavg / 60);
+$TOTavg_M_int = round($TOTavg_M, 2);
+$TOTavg_M_int = intval("$TOTavg_M_int");
+$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
+$TOTavg_S = ($TOTavg_S * 60);
+$TOTavg_S = round($TOTavg_S, 0);
+if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
+$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
+$TOTavg =		sprintf("%6s", $TOTavg_MS);
+
+$TOTtime_M = ($TOTtime / 60);
+$TOTtime_M_int = round($TOTtime_M, 2);
+$TOTtime_M_int = intval("$TOTtime_M_int");
+$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 =		sprintf("%6s", $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) {echo "$stmt\n";}
+$row=mysql_fetch_row($rslt);
+
+$AVGwait = $row[0];
+$AVGwait_M = ($AVGwait / 60);
+$AVGwait_M_int = round($AVGwait_M, 2);
+$AVGwait_M_int = intval("$AVGwait_M_int");
+$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 Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
+echo "+--------------------------+------------+----------+--------+\n";
+echo "| Average Wait time between calls                    $AVGwait |\n";
+echo "+-----------------------------------------------------------+\n";
+
+##############################
+#########  TIME STATS
+
+echo "\n";
+echo "---------- STATISTIQUE TEMPORELLES\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 "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES POUR LE TOTAL DES APPELS PLACES DEPUIS CETTE CAMPAGNE\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";
+
+
+
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+
+}
+
+
+
+?>
+
+
+ + \ No newline at end of file diff --git a/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_fr/AST_VICIDIAL_hopperlist.php similarity index 84% rename from LANG_www/vicidial/AST_VICIDIAL_hopperlist.php rename to LANG_www/vicidial_fr/AST_VICIDIAL_hopperlist.php index a30832be..c2b36594 100644 --- a/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_fr/AST_VICIDIAL_hopperlist.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_VICIDIAL_hopperlist.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat @@ -21,8 +21,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -37,7 +37,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -75,7 +75,7 @@ while ($i < $campaigns_to_print) \n"; -echo "VICIDIAL: Hopper List\n"; +echo "VICIDIAL: Liste des distributeurs de fiches\n"; echo "
\n"; #echo "\n"; #echo "\n"; @@ -88,8 +88,8 @@ echo "\n"; -echo "\n"; -echo "           MODIFY \n"; +echo "\n"; +echo "           MODIFIER \n"; echo "
\n\n"; echo "
\n\n";
@@ -98,14 +98,14 @@ echo "
\n\n";
 if (!$group)
 {
 echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
+echo "VEUILLEZ SELECTIONNER UNE CAMPAGNE CI-DESSUS ET CLIQUEZ SUR VALIDER\n";
 }
 
 else
 {
 
 
-echo "VICIDIAL: Live Current Hopper List                      $NOW_TIME\n";
+echo "VICIDIAL: Liste des distributeurs de fiches en cours                      $NOW_TIME\n";
 
 echo "\n";
 echo "---------- TOTALS\n";
@@ -117,7 +117,7 @@ $row=mysql_fetch_row($rslt);
 
 $TOTALcalls =	sprintf("%10s", $row[0]);
 
-echo "Total leads in hopper right now:       $TOTALcalls\n";
+echo "Total de fiches dans le distributeur de fiches à l'instant:       $TOTALcalls\n";
 
 
 ##############################
@@ -126,7 +126,7 @@ echo "Total leads in hopper right now:       $TOTALcalls\n";
 echo "\n";
 echo "---------- LEADS IN HOPPER\n";
 echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
-echo "|ORDER |PRIORITY| LEAD ID   | LIST ID    | PHONE NUM  | STATE | STATUS | COUNT | GMT    | ALT   |\n";
+echo "|ORDER |PRIORITÉ| LEAD ID   | ID DE LA LISTE    | 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.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;";
diff --git a/LANG_www/vicidial/AST_admin_log_display.php b/LANG_www/vicidial_fr/AST_admin_log_display.php
similarity index 83%
rename from LANG_www/vicidial/AST_admin_log_display.php
rename to LANG_www/vicidial_fr/AST_admin_log_display.php
index 9c5c4af6..b5abd944 100644
--- a/LANG_www/vicidial/AST_admin_log_display.php
+++ b/LANG_www/vicidial_fr/AST_admin_log_display.php
@@ -1,8 +1,8 @@
     LICENSE: GPLv2
-###
+# AST_admin_log_display.php
+# 
+# Copyright (C) 2008  Matt Florell     LICENSE: AGPLv2
+#
 
 require("dbconnect.php");
 
@@ -13,8 +13,8 @@ if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
 	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
 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["VALIDER"]))				{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -50,7 +50,7 @@ $browser = getenv("HTTP_USER_AGENT");
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
   else
@@ -77,8 +77,8 @@ $browser = getenv("HTTP_USER_AGENT");
 echo "\n";
 echo "\n";
 echo "\n";
-echo "\n";
-echo "VICIDIAL ADMIN LOG DISPLAY";
+echo "\n";
+echo "ADMINISTRATION DE VICIDIAL LOG DISPLAY";
 echo "\n";
 
 # Fri, 25 Mar 2005
@@ -100,13 +100,13 @@ echo "\n";
 
 echo "
\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "
\n\n"; echo "
\n\n";
 
 
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
+echo "ADMINISTRATION DE VICIDIAL CHANGE LOG                             $NOW_TIME\n";
 
 #passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
 passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
diff --git a/LANG_www/vicidial_fr/AST_agent_days_detail.php b/LANG_www/vicidial_fr/AST_agent_days_detail.php
new file mode 100644
index 00000000..ed269067
--- /dev/null
+++ b/LANG_www/vicidial_fr/AST_agent_days_detail.php
@@ -0,0 +1,601 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 90206-2202 - First build
+# 90225-1051 - Added CSV download option
+# 90310-0752 - Added admin header
+#
+
+
+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["VALIDER"]))					{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
+
+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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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 "Login ou mot de passe invalide: |$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 "VICIDIAL: Agent Jours Etat\n";
+	echo "";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+	echo "\n";
+	echo "\n";
+	echo "
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo "S'IL VOUS PLAÎT CHOISIR UN UTILISATEUR ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS VALIDER\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 "VICIDIAL: Agent Days Détail: $user                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENT Détails -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Days Détail: $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 "CALL 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Dates:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campagnes:
"; +echo "\n"; +echo "
Utilisateur:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " TÉLÉCHARGER | \n"; + echo " USER | \n"; + echo " USER STATS | \n"; + } +else + {echo " UTILISATEURS | \n";} +echo "RAPPORTS \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/LANG_www/vicidial/AST_agent_performance.php b/LANG_www/vicidial_fr/AST_agent_performance.php
similarity index 94%
rename from LANG_www/vicidial/AST_agent_performance.php
rename to LANG_www/vicidial_fr/AST_agent_performance.php
index eb2ceac4..e46b5ec0 100644
--- a/LANG_www/vicidial/AST_agent_performance.php
+++ b/LANG_www/vicidial_fr/AST_agent_performance.php
@@ -1,8 +1,8 @@
     LICENSE: GPLv2
-###
+# AST_agent_performance.php
+# 
+# Copyright (C) 2008  Matt Florell     LICENSE: AGPLv2
+#
 # CHANGES
 #
 # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
@@ -23,8 +23,8 @@ 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["VALIDER"]))				{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -40,7 +40,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -93,8 +93,8 @@ echo "\n";
-echo "\n";
-echo "           MODIFY | REPORTS \n";
+echo "\n";
+echo "           MODIFIER | RAPPORTS \n";
 echo "\n\n";
 
 echo "
\n";
@@ -103,7 +103,7 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
+echo "PLEASE SELECT A SERVEUR AND DATE-TIME ABOVE AND CLICK VALIDER\n";
 echo " NOTE: stats taken from 6 hour shift specified\n";
 }
 
@@ -127,7 +127,7 @@ if ($shift == 'PM')
 echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
+echo "---------- AGENTS Détails -------------\n\n";
 
 echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
diff --git a/LANG_www/vicidial_fr/AST_agent_performance_detail.php b/LANG_www/vicidial_fr/AST_agent_performance_detail.php
new file mode 100644
index 00000000..047b1889
--- /dev/null
+++ b/LANG_www/vicidial_fr/AST_agent_performance_detail.php
@@ -0,0 +1,943 @@
+    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
+#
+
+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["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["VALIDER"]))					{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
+
+
+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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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 "Login ou mot de passe invalide: |$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++;
+	}
+$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++;
+	}
+?>
+
+
+
+
+
+\n";
+echo "VICIDIAL: Agent Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFIER | RAPPORTS \n"; +echo "
\n\n"; + +echo "
\n";
+
+
+if (!$group)
+{
+echo "\n";
+echo "S'IL VOUS PLAÎT CHOISIR UNE CAMPAGNE ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS VALIDER\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 "VICIDIAL: Agent Performance Détail                        $NOW_TIME\n";
+
+echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+echo "---------- AGENTS Détails -------------\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 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 campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL 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];
+	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:\n";
+echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
+echo "| USER NAME       | ID       | CALLS  | TIME    | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG|$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;
+	$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]);
+				$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);
+	$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;}
+
+	$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');}
+		}
+
+	$USERtime_M = ($Stime / 60);
+	$USERtime_M_int = round($USERtime_M, 2);
+	$USERtime_M_int = intval("$USERtime_M_int");
+	$USERtime_S = ($USERtime_M - $USERtime_M_int);
+	$USERtime_S = ($USERtime_S * 60);
+	$USERtime_S = round($USERtime_S, 0);
+	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
+	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
+	$pfUSERtime_MS =		sprintf("%7s", $USERtime_MS);
+
+	$USERtotTALK_M = ($Stalk_sec / 60);
+	$USERtotTALK_M_int = round($USERtotTALK_M, 2);
+	$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
+	$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 =		sprintf("%6s", $USERtotTALK_MS);
+
+	$USERavgTALK_M = ($Stalk_avg / 60);
+	$USERavgTALK_M_int = round($USERavgTALK_M, 2);
+	$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
+	$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 =		sprintf("%6s", $USERavgTALK_MS);
+
+	$USERtotPAUSE_M = ($Spause_sec / 60);
+	$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
+	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
+	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
+	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
+	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
+	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
+	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
+	$pfUSERtotPAUSE_MS =		sprintf("%6s", $USERtotPAUSE_MS);
+	$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
+
+	$USERavgPAUSE_M = ($Spause_avg / 60);
+	$USERavgPAUSE_M_int = round($USERavgPAUSE_M, 2);
+	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M_int");
+	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
+	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
+	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
+	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
+	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
+	$pfUSERavgPAUSE_MS =		sprintf("%6s", $USERavgPAUSE_MS);
+
+	$USERtotWAIT_M = ($Swait_sec / 60);
+	$USERtotWAIT_M_int = round($USERtotWAIT_M, 2);
+	$USERtotWAIT_M_int = intval("$USERtotWAIT_M_int");
+	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
+	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
+	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
+	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
+	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
+	$pfUSERtotWAIT_MS =		sprintf("%6s", $USERtotWAIT_MS);
+
+	$USERavgWAIT_M = ($Swait_avg / 60);
+	$USERavgWAIT_M_int = round($USERavgWAIT_M, 2);
+	$USERavgWAIT_M_int = intval("$USERavgWAIT_M_int");
+	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
+	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
+	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
+	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
+	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
+	$pfUSERavgWAIT_MS =		sprintf("%6s", $USERavgWAIT_MS);
+	
+	$USERtotDISPO_M = ($Sdispo_sec / 60);
+	$USERtotDISPO_M_int = round($USERtotDISPO_M, 2);
+	$USERtotDISPO_M_int = intval("$USERtotDISPO_M_int");
+	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
+	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
+	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
+	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
+	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
+	$pfUSERtotDISPO_MS =		sprintf("%6s", $USERtotDISPO_MS);
+
+	$USERavgDISPO_M = ($Sdispo_avg / 60);
+	$USERavgDISPO_M_int = round($USERavgDISPO_M, 2);
+	$USERavgDISPO_M_int = intval("$USERavgDISPO_M_int");
+	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
+	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
+	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
+	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
+	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
+	$pfUSERavgDISPO_MS =		sprintf("%6s", $USERavgDISPO_MS);
+
+	$Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n";
+
+	$TOPsorted_output[$m] = $Toutput;
+
+	if ($stage == 'ID')
+		{$TOPsort[$m] =	'' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
+	if ($stage == 'CALLS')
+		{$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|CALLS",$stage))
+		{echo "$Toutput";}
+
+	$m++;
+	}
+### END loop through each user ###
+
+
+
+### BEGIN sort through output to display properly ###
+if (ereg("ID|TIME|CALLS",$stage))
+	{
+	if (ereg("ID",$stage))
+		{sort($TOPsort, SORT_NUMERIC);}
+	if (ereg("TIME|CALLS",$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);
+
+	$TOTtime_M = ($TOTtime / 60);
+	$TOTtime_M_int = round($TOTtime_M, 2);
+	$TOTtime_M_int = intval("$TOTtime_M_int");
+	$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);
+		while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
+
+	$TOTtotTALK_M = ($TOTtotTALK / 60);
+	$TOTtotTALK_M_int = round($TOTtotTALK_M, 2);
+	$TOTtotTALK_M_int = intval("$TOTtotTALK_M_int");
+	$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("%8s", $TOTtotTALK_MS);
+		while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
+
+	if ($TOTtotDISPO < 1) {$TOTtotDISPO_M = '0';}
+	else {$TOTtotDISPO_M = ($TOTtotDISPO / 60);}
+	$TOTtotDISPO_M_int = round($TOTtotDISPO_M, 2);
+	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M_int");
+	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
+	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
+	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
+	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
+	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
+	$TOTtotDISPO_MS =		sprintf("%8s", $TOTtotDISPO_MS);
+		while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
+
+	if ($TOTtotPAUSE < 1) {$TOTtotPAUSE_M = '0';}
+	else {$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);}
+	$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
+	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
+	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
+	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
+	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
+	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
+	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
+	$TOTtotPAUSE_MS =		sprintf("%8s", $TOTtotPAUSE_MS);
+		while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
+
+	if ($TOTtotWAIT < 1) {$TOTtotWAIT_M = '0';}
+	else {$TOTtotWAIT_M = ($TOTtotWAIT / 60);}
+	$TOTtotWAIT_M_int = round($TOTtotWAIT_M, 2);
+	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M_int");
+	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
+	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
+	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
+	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
+	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
+	$TOTtotWAIT_MS =		sprintf("%8s", $TOTtotWAIT_MS);
+		while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
+
+	if ($TOTtotTALK < 1) {$TOTavgTALK_M = '0';}
+	else {$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);}
+	$TOTavgTALK_M_int = round($TOTavgTALK_M, 2);
+	$TOTavgTALK_M_int = intval("$TOTavgTALK_M_int");
+	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
+	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
+	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
+	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
+	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
+	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
+		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
+
+	if ($TOTtotDISPO < 1) {$TOTavgDISPO_M = '0';}
+	else {$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);}
+	$TOTavgDISPO_M_int = round($TOTavgDISPO_M, 2);
+	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M_int");
+	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
+	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
+	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
+	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
+	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
+	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
+		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
+
+	if ($TOTtotPAUSE < 1) {$TOTavgPAUSE_M = '0';}
+	else {$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);}
+	$TOTavgPAUSE_M_int = round($TOTavgPAUSE_M, 2);
+	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M_int");
+	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
+	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
+	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
+	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
+	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
+	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
+		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
+
+	if ($TOTtotWAIT < 1) {$TOTavgWAIT_M = '0';}
+	else {$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);}
+	$TOTavgWAIT_M_int = round($TOTavgWAIT_M, 2);
+	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M_int");
+	$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);}
+
+
+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 |$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 campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL 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_M = ($PCpause_sec[$i] / 60);
+				$USERcodePAUSE_M_int = round($USERcodePAUSE_M, 2);
+				$USERcodePAUSE_M_int = intval("$USERcodePAUSE_M_int");
+				$USERcodePAUSE_S = ($USERcodePAUSE_M - $USERcodePAUSE_M_int);
+				$USERcodePAUSE_S = ($USERcodePAUSE_S * 60);
+				$USERcodePAUSE_S = round($USERcodePAUSE_S, 0);
+				if ($USERcodePAUSE_S < 10) {$USERcodePAUSE_S = "0$USERcodePAUSE_S";}
+				$USERcodePAUSE_MS = "$USERcodePAUSE_M_int:$USERcodePAUSE_S";
+				$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_M = ($Spause_sec / 60);
+	$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
+	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
+	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
+	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
+	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
+	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
+	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
+	$pfUSERtotPAUSE_MS =		sprintf("%6s", $USERtotPAUSE_MS);
+
+	$USERtotNONPAUSE_M = ($Snon_pause_sec / 60);
+	$USERtotNONPAUSE_M_int = round($USERtotNONPAUSE_M, 2);
+	$USERtotNONPAUSE_M_int = intval("$USERtotNONPAUSE_M_int");
+	$USERtotNONPAUSE_S = ($USERtotNONPAUSE_M - $USERtotNONPAUSE_M_int);
+	$USERtotNONPAUSE_S = ($USERtotNONPAUSE_S * 60);
+	$USERtotNONPAUSE_S = round($USERtotNONPAUSE_S, 0);
+	if ($USERtotNONPAUSE_S < 10) {$USERtotNONPAUSE_S = "0$USERtotNONPAUSE_S";}
+	$USERtotNONPAUSE_MS = "$USERtotNONPAUSE_M_int:$USERtotNONPAUSE_S";
+	$pfUSERtotNONPAUSE_MS =		sprintf("%6s", $USERtotNONPAUSE_MS);
+
+	$USERtotTOTAL_M = ($Stotal_sec / 60);
+	$USERtotTOTAL_M_int = round($USERtotTOTAL_M, 2);
+	$USERtotTOTAL_M_int = intval("$USERtotTOTAL_M_int");
+	$USERtotTOTAL_S = ($USERtotTOTAL_M - $USERtotTOTAL_M_int);
+	$USERtotTOTAL_S = ($USERtotTOTAL_S * 60);
+	$USERtotTOTAL_S = round($USERtotTOTAL_S, 0);
+	if ($USERtotTOTAL_S < 10) {$USERtotTOTAL_S = "0$USERtotTOTAL_S";}
+	$USERtotTOTAL_MS = "$USERtotTOTAL_M_int:$USERtotTOTAL_S";
+	$pfUSERtotTOTAL_MS =		sprintf("%6s", $USERtotTOTAL_MS);
+
+	$BOTTOMoutput = "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS |  |$SstatusesHTML\n";
+
+	$BOTTOMsorted_output[$m] = $BOTTOMoutput;
+
+#	if (!ereg("ID|TIME|CALLS",$stage))
+#		{
+		echo "$BOTTOMoutput";
+#		}
+
+	$m++;
+	}
+### END loop through each user ###
+
+
+
+### BEGIN sort through output to display properly ###
+#if (ereg("ID|TIME|CALLS",$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_M = ($Scalls / 60);
+		$USERsumstatPAUSE_M_int = round($USERsumstatPAUSE_M, 2);
+		$USERsumstatPAUSE_M_int = intval("$USERsumstatPAUSE_M_int");
+		$USERsumstatPAUSE_S = ($USERsumstatPAUSE_M - $USERsumstatPAUSE_M_int);
+		$USERsumstatPAUSE_S = ($USERsumstatPAUSE_S * 60);
+		$USERsumstatPAUSE_S = round($USERsumstatPAUSE_S, 0);
+		if ($USERsumstatPAUSE_S < 10) {$USERsumstatPAUSE_S = "0$USERsumstatPAUSE_S";}
+		$USERsumstatPAUSE_MS = "$USERsumstatPAUSE_M_int:$USERsumstatPAUSE_S";
+		$pfUSERsumstatPAUSE_MS =		sprintf("%6s", $USERsumstatPAUSE_MS);
+
+		$SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS);
+		$SUMstatusesHTML .= " $SUMstatusTXT |";
+		}
+	$n++;
+	}
+### END loop through each status ###
+
+	$TOT_AGENTS = sprintf("%-4s", $m);
+
+	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
+	$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
+	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
+	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
+	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
+	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
+	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
+	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
+	$TOTtotPAUSE_MS =		sprintf("%8s", $TOTtotPAUSE_MS);
+		while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
+
+	$TOTtotNONPAUSE_M = ($TOTtotNONPAUSE / 60);
+	$TOTtotNONPAUSE_M_int = round($TOTtotNONPAUSE_M, 2);
+	$TOTtotNONPAUSE_M_int = intval("$TOTtotNONPAUSE_M_int");
+	$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_M - $TOTtotNONPAUSE_M_int);
+	$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_S * 60);
+	$TOTtotNONPAUSE_S = round($TOTtotNONPAUSE_S, 0);
+	if ($TOTtotNONPAUSE_S < 10) {$TOTtotNONPAUSE_S = "0$TOTtotNONPAUSE_S";}
+	$TOTtotNONPAUSE_MS = "$TOTtotNONPAUSE_M_int:$TOTtotNONPAUSE_S";
+	$TOTtotNONPAUSE_MS =		sprintf("%8s", $TOTtotNONPAUSE_MS);
+		while(strlen($TOTtotNONPAUSE_MS)>8) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);}
+
+	$TOTtotTOTAL_M = ($TOTtotTOTAL / 60);
+	$TOTtotTOTAL_M_int = round($TOTtotTOTAL_M, 2);
+	$TOTtotTOTAL_M_int = intval("$TOTtotTOTAL_M_int");
+	$TOTtotTOTAL_S = ($TOTtotTOTAL_M - $TOTtotTOTAL_M_int);
+	$TOTtotTOTAL_S = ($TOTtotTOTAL_S * 60);
+	$TOTtotTOTAL_S = round($TOTtotTOTAL_S, 0);
+	if ($TOTtotTOTAL_S < 10) {$TOTtotTOTAL_S = "0$TOTtotTOTAL_S";}
+	$TOTtotTOTAL_MS = "$TOTtotTOTAL_M_int:$TOTtotTOTAL_S";
+	$TOTtotTOTAL_MS =		sprintf("%8s", $TOTtotTOTAL_MS);
+		while(strlen($TOTtotTOTAL_MS)>8) {$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";
+
+}
+
+
+?>
+
+
+ + \ No newline at end of file diff --git a/LANG_www/vicidial_fr/AST_agent_status_detail.php b/LANG_www/vicidial_fr/AST_agent_status_detail.php new file mode 100644 index 00000000..d04cfb55 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_agent_status_detail.php @@ -0,0 +1,665 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# + + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Login ou mot de passe invalide: |$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++; + } +$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 + { + $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 "VICIDIAL: Agent Jours Etat\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 "S'IL VOUS PLAÎT Sélectionnez une campagne ou groupe d'utilisateurs-HEURE ET DATE ET CLIQUEZ CI-DESSUS VALIDER\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 "VICIDIAL: Agent Status Détail                     $NOW_TIME\n";
+
+		echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENT Détails -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Status Détail                     $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) )
+			{
+			$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 "CALL 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=$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 ( ($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 |";
+				}
+			### 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "
Dates:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campagnes:
"; +echo "\n"; +echo "
Groupes d'utilisateurs:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " TÉLÉCHARGER | \n"; +echo " RAPPORTS \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/LANG_www/vicidial/AST_agent_time_sheet.php b/LANG_www/vicidial_fr/AST_agent_time_sheet.php
similarity index 64%
rename from LANG_www/vicidial/AST_agent_time_sheet.php
rename to LANG_www/vicidial_fr/AST_agent_time_sheet.php
index bd562a7b..e5bbd4a7 100644
--- a/LANG_www/vicidial/AST_agent_time_sheet.php
+++ b/LANG_www/vicidial_fr/AST_agent_time_sheet.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
-###
+# AST_agent_time_sheet.php
+# 
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -17,13 +19,15 @@ $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"];}
+	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["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
+if (isset($_GET["VALIDER"]))				{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))	{$VALIDER=$_POST["VALIDER"];}
+
+$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);
@@ -38,7 +42,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -62,16 +66,37 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 \n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "VICIDIAL ADMIN: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Modify User\n";
+echo "VICIDIAL: Agent Feuille de temps";
+
+
+##### 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 "AgentFeuille de tempsfor: $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 "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
-echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
+echo "Utilisateur ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
+echo "<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n";
 echo "</FORM>\n\n";
 
 echo "<PRE><FONT SIZE=3>\n";
@@ -80,7 +105,7 @@ echo "<PRE><FONT SIZE=3>\n";
 if (!$agent)
 {
 echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
+echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK VALIDER\n";
 echo " NOTE: stats taken from available agent log data\n";
 }
 
@@ -97,7 +122,7 @@ if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $full_name = $row[0];
 
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
+echo "VICIDIAL: AgentFeuille de temps                            $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
@@ -226,7 +251,7 @@ if ($calls_summary)
 		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
 		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
 
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
+	echo "TOTAL DES APPELSTAKEN: $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";
@@ -277,6 +302,104 @@ $login_time = ($end - $start);
 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 HEURE DE CONNECTION/DECONNECTION:</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>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</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 = ($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><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_int:$event_minutes_int";
+			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 = ($total_login_time / 3600);
+$total_login_hours_int = round($total_login_hours, 2);
+$total_login_hours_int = intval("$total_login_hours_int");
+$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";}
+
+	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_int:$total_login_minutes_int  </td></tr>\n";
+
+echo "</TABLE>\n";
+
+
+
 }
 
 
diff --git a/LANG_www/vicidial/AST_inboundEXTstats.php b/LANG_www/vicidial_fr/AST_inboundEXTstats.php
similarity index 94%
rename from LANG_www/vicidial/AST_inboundEXTstats.php
rename to LANG_www/vicidial_fr/AST_inboundEXTstats.php
index 5bc24935..75662f86 100644
--- a/LANG_www/vicidial/AST_inboundEXTstats.php
+++ b/LANG_www/vicidial_fr/AST_inboundEXTstats.php
@@ -1,7 +1,7 @@
 <? 
 # AST_inboundEXTstats.php
 # 
-# Copyright (C) 2006  Matt Florell <vicidial@gmail.com>    LICENSE: GPLv2
+# Copyright (C) 2008  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
 #
 # CHANGES
 # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
@@ -22,8 +22,8 @@ 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["SUBMIT"]))					{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
+if (isset($_GET["VALIDER"]))					{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))		{$VALIDER=$_POST["VALIDER"];}
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -38,7 +38,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -76,9 +76,9 @@ while ($i < $inbound_to_print)
  </STYLE>
 
 <? 
-echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
+echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
 #echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
-echo "<TITLE>ASTERISK: Inbound Calls Stats\n";
+echo "ASTERISK: Statistiques des appels entrants\n";
 echo "
\n"; echo "\n"; echo "\n"; @@ -91,7 +91,7 @@ echo "\n"; -echo "\n"; +echo "\n"; echo "
\n\n"; echo "
\n\n";
@@ -100,14 +100,14 @@ echo "
\n\n";
 if (!$group)
 {
 echo "\n\n";
-echo "PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
+echo "VEUILLEZ SELECTIONNER UN NUMERO ET UNE DATE CI-DESSUS ET CLIQUEZ SUR VALIDER\n";
 }
 
 else
 {
 
 
-echo "ASTERISK: Inbound Calls Stats                      $NOW_TIME\n";
+echo "ASTERISK: Statistiques des appels entrants                      $NOW_TIME\n";
 
 echo "\n";
 echo "---------- TOTALS\n";
@@ -125,11 +125,11 @@ $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 Calls That came into this number:       $TOTALcalls\n";
+echo "Total des appels reçus par ce numéro:       $TOTALcalls\n";
 echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
 
 echo "\n";
-echo "---------- DROPS\n";
+echo "---------- ABANDONNES\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);
@@ -198,7 +198,7 @@ if ($output == 'FULL')
 	{
 
 	echo "\n";
-	echo "---------- TIME STATS\n";
+	echo "---------- STATISTIQUE TEMPORELLES\n";
 
 	echo "\n";
 
@@ -271,7 +271,7 @@ if ($output == 'FULL')
 	#$hour_multiplier = round($hour_multiplier, 0);
 
 	echo "\n";
-	echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\n";
+	echo "GRAPHIQUE INCREMENTE PAR TRANCHE DE 15 MINUTES DU TOTAL DES APPELS\n";
 
 	$k=1;
 	$Mk=0;
diff --git a/LANG_www/vicidial/AST_server_performance.php b/LANG_www/vicidial_fr/AST_server_performance.php
similarity index 76%
rename from LANG_www/vicidial/AST_server_performance.php
rename to LANG_www/vicidial_fr/AST_server_performance.php
index afa75bd3..6c7d3859 100644
--- a/LANG_www/vicidial/AST_server_performance.php
+++ b/LANG_www/vicidial_fr/AST_server_performance.php
@@ -1,7 +1,7 @@
     LICENSE: GPLv2
+# Copyright (C) 2009  Matt Florell     LICENSE: AGPLv2
 #
 # CHANGES
 #
@@ -9,6 +9,8 @@
 #            - 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
 #
 
 require("dbconnect.php");
@@ -16,8 +18,6 @@ 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["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"];}
@@ -26,8 +26,8 @@ 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["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))	{$SUBMIT=$_POST["SUBMIT"];}
+if (isset($_GET["VALIDER"]))				{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))	{$VALIDER=$_POST["VALIDER"];}
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -42,7 +42,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -54,9 +54,8 @@ $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($begin_query_time)) {$begin_query_time = '09:00:00';}
-if (!isset($end_query_time)) {$end_query_time = '15:30:00';}
+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;";
@@ -85,11 +84,18 @@ while ($i < $servers_to_print)
 
 \n";
-echo "VICIDIAL: Server Performance\n";
+echo "VICIDIAL: Server Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + + echo "
\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; +echo "Date/Time Range: \n"; +echo "to \n"; echo "Server: \n"; $o++; } echo " \n"; -echo "\n"; -echo "             REPORTS \n"; +echo "\n"; +echo "             RAPPORTS \n"; echo "
\n\n"; echo "
\n";
@@ -109,16 +115,15 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK SUBMIT\n";
+echo "PLEASE SELECT A SERVEUR AND DATE/TIME RANGE ABOVE AND CLICK VALIDER\n";
 }
 
 else
 {
 
-$query_date_BEGIN = "$query_date $begin_query_time";   
-$query_date_END = "$query_date $end_query_time";
-$time_BEGIN = "$begin_query_time";   
-$time_END = "$end_query_time";
+$query_date_BEGIN = $begin_query_time;   
+$query_date_END = $end_query_time;
+
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
@@ -182,7 +187,7 @@ $PNGfile = "$group$query_date$shift$filedate$PNG";
 $HTMfp = fopen ("$DOCroot/$HTMfile", "a");
 $DATfp = fopen ("$DOCroot/$DATfile", "a");
 
-$stmt="select DATE_FORMAT(start_time,'%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;";
+$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);
@@ -190,20 +195,48 @@ $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);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
+	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);
 
-#print "rows: $i\n";
-
 $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';}
@@ -211,6 +244,8 @@ 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";
@@ -219,20 +254,20 @@ $HTMcontent .= "\n";
 $HTMcontent .= "#endif\n";
 $HTMcontent .= "#proc getdata\n";
 $HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\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 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\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:mm:ssa\n";
+$HTMcontent .= "stubformat: hh:mma\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
 $HTMcontent .= "stubs: inc 50\n";
@@ -241,7 +276,7 @@ $HTMcontent .= "gridskip: min\n";
 $HTMcontent .= "ticincrement: 100 1000\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
+$HTMcontent .= "xfield: datetime\n";
 $HTMcontent .= "yfield: userproc\n";
 $HTMcontent .= "linedetails: color=purple width=.5\n";
 $HTMcontent .= "fill: lavender\n";
@@ -249,7 +284,7 @@ $HTMcontent .= "legendlabel: user proc%\n";
 $HTMcontent .= "maxinpoints: $rows_to_max\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
+$HTMcontent .= "xfield: datetime\n";
 $HTMcontent .= "yfield: sysproc\n";
 $HTMcontent .= "linedetails: color=yelloworange width=.5\n";
 $HTMcontent .= "fill: dullyellow\n";
@@ -257,28 +292,28 @@ $HTMcontent .= "legendlabel: system proc%\n";
 $HTMcontent .= "maxinpoints: $rows_to_max\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\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: time\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: time\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-2 max\n";
+$HTMcontent .= "location: max-1 max\n";
 $HTMcontent .= "seglen: 0.2\n";
 $HTMcontent .= "\n";
 
@@ -290,7 +325,7 @@ passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
 
 sleep(1);
 
-echo "
\n"; +echo "
"; echo "\n"; echo "\n"; @@ -303,4 +338,6 @@ echo ""; ?> +
+ \ No newline at end of file diff --git a/LANG_www/vicidial/AST_timeonVDAD.php b/LANG_www/vicidial_fr/AST_timeonVDAD.php similarity index 67% rename from LANG_www/vicidial/AST_timeonVDAD.php rename to LANG_www/vicidial_fr/AST_timeonVDAD.php index e9c8f52e..c9863310 100644 --- a/LANG_www/vicidial/AST_timeonVDAD.php +++ b/LANG_www/vicidial_fr/AST_timeonVDAD.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonVDAD.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # live real-time stats for the VICIDIAL Auto-Dialer # # CHANGES @@ -10,6 +10,9 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -25,8 +28,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];} elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];} @@ -43,7 +46,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -110,8 +113,15 @@ if ($closer_display>0) \n"; echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
+echo "VICIDIAL: Time On VDAD\n";
+
+$short_header=1;
+
+require("admin_header.php");
+
+echo "
"; + +echo "
";
 
 ###################################################################################
 ###### SERVER INFORMATION
@@ -133,19 +143,19 @@ echo "SERVER: $server_ip\n";
 if ($closer_display>0) {$closer_display_reverse=0;   $closer_reverse_link='DEFAULT';}
 else {$closer_display_reverse=1;   $closer_reverse_link='CLOSER';}
 
-echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    $closer_reverse_link | REPORTS\n\n";
+echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    $closer_reverse_link | RAPPORTS\n\n";
 
 if ($closer_display>0)
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 }
 else
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+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;";
@@ -158,18 +168,77 @@ $talking_to_print = mysql_num_rows($rslt);
 	while ($i < $talking_to_print)
 		{
 		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
+		$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])) 
 			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('R/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
 			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
+		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", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
+		$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) )
 			{
@@ -177,8 +246,8 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cc[$i]++;
 			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
 			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
+		$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) )
 			{
@@ -186,10 +255,10 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cd[$i]++;
 			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
 			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
+		$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);
@@ -206,7 +275,7 @@ $talking_to_print = mysql_num_rows($rslt);
 			$G = '';		$EG = '';
 			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
+			if (eregi("PAUSED",$Sstatus[$i])) 
 				{
 				if ($call_time_M_int >= 1) 
 					{$i++; continue;} 
@@ -214,7 +283,7 @@ $talking_to_print = mysql_num_rows($rslt);
 					{$G=''; $EG='';}
 				}
 			$agentcount++;
-			echo "| $G$extension[$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";
+			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++;
 		}
@@ -259,23 +328,23 @@ $talking_to_print = mysql_num_rows($rslt);
 		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
 
-			echo "| $G$extension[$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";
+			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 agents logged in on server $server_ip\n\n";
-	#	echo "             - 5 minutes or more on call\n";
-	#	echo "             - Over 10 minutes on call\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+		echo "  $i agents connectés sur ce serveur $server_ip\n\n";
+	#	echo "             - En appel depuis 5 minutes ou plus\n";
+	#	echo "             - En appel depuis plus de 10 minutes\n";
 		}
 	else
 		{
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-		echo "  $agentcount agents logged in on server $server_ip\n\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "  $agentcount agents connectés sur ce serveur $server_ip\n\n";
 
-		echo "             - Paused agents\n";
-		echo "             - 5 minutes or more on call\n";
-		echo "             - Over 10 minutes on call\n";
+		echo "             - Agents en pause\n";
+		echo "             - En appel depuis 5 minutes ou plus\n";
+		echo "             - En appel depuis plus de 10 minutes\n";
 		}
 
 	}
@@ -283,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt);
 	{
 	echo "**************************************************************************************\n";
 	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
+	echo "********************************* AUCUN AGENT EN APPEL*********************************\n";
 	echo "**************************************************************************************\n";
 	echo "**************************************************************************************\n";
 	}
@@ -352,9 +421,9 @@ $parked_to_print = mysql_num_rows($rslt);
 		}
 
 		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
+		echo "  $i appels étant placés sur ce serveur $server_ip\n\n";
 
-		echo "             - LIVE CALL WAITING\n";
+		echo "             - APPEL EN ATTENTE\n";
 	#	echo "             - Over 5 minutes on hold\n";
 
 		}
@@ -362,7 +431,7 @@ $parked_to_print = mysql_num_rows($rslt);
 	{
 	echo "***************************************************************************************\n";
 	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
+	echo "******************************* PAS D'APPEL EN ATTENTE*********************************\n";
 	echo "***************************************************************************************\n";
 	echo "***************************************************************************************\n";
 	}
@@ -370,5 +439,6 @@ $parked_to_print = mysql_num_rows($rslt);
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_fr/AST_timeonVDADall.php b/LANG_www/vicidial_fr/AST_timeonVDADall.php new file mode 100644 index 00000000..5f0c8fb0 --- /dev/null +++ b/LANG_www/vicidial_fr/AST_timeonVDADall.php @@ -0,0 +1,1662 @@ + 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 +# + +$version = '2.0.5-36'; +$build = '90310-0906'; + +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["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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} +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["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} + elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} + +############################################# +##### 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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +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=0;} # 0=id, 1=name +if (!isset($orderby)) {$orderby='timeup';} +if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 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='N';} # 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]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $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); + + +$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 "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DAY = date("Y-m-d"); +$NOW_HOUR = date("H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id,campaign_name 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; + $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++; + } +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)"; + } + +#if ( (eregi('ALL-ACTIVE',$group_string)) and ($with_inbound=='O') and ($outbound_autodial_active > 0) ) +# {$with_inbound='N';} + +$stmt="select * 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_list .= ""; +$select_list .= "
Select Campagnes:
"; +$select_list .= ""; +$select_list .= "
(Pour sélectionner plus de 1 campagne, maintenez la touche Ctrl enfoncée et cliquez sur)"; +$select_list .= "
"; +$select_list .= "Fermer le panneau

"; + +if ($UGdisplay > 0) + { + $select_list .= "Select Groupe utilisateur:
"; + $select_list .= "

"; + } + +$select_list .= "   Inbound:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "VERSION: $version   CONSTRUCTION: $build"; +$select_list .= "
"; + +$open_list = "
Rapport Choisissez Options d'affichage
"; + +?> + + + + + + +\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id IN($group_SQL) and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + +echo "\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Campagne: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +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 "VICIDIAL Real-Time                                                                          \n"; +echo "\n"; +echo "
\n"; +echo "Rapport Choisissez Options d'affichage"; +echo "
\n"; +echo "
\n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if (eregi('ALL-ACTIVE',$group_string)) + { + echo "       MODIFIER | \n"; + } +else + { + echo "       MODIFIER | \n"; + } +echo "SUMMARY \n"; +echo "\n\n"; + + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$multi_drop=0; + +##### INBOUND ONLY ### +if (ereg('O',$with_inbound)) + { + $multi_drop++; + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + if ($adastats>1) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_REPONSEagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_REPONSEagent_non_pause_sec = round($AVG_REPONSEagent_non_pause_sec, 2); + $AVG_REPONSEagent_non_pause_sec = sprintf("%01.2f", $AVG_REPONSEagent_non_pause_sec); + } + else + {$AVG_REPONSEagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_REPONSEagent_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  
REPONSES TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + + } + + $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);"; + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; + + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + + + if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";} + + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_pause_codes_active = $row[0]; + + $rslt=mysql_query($stmtC, $link); + $row=mysql_fetch_row($rslt); + $agent_non_pause_sec = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_REPONSEagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_REPONSEagent_non_pause_sec = round($AVG_REPONSEagent_non_pause_sec, 2); + $AVG_REPONSEagent_non_pause_sec = sprintf("%01.2f", $AVG_REPONSEagent_non_pause_sec); + } + else + {$AVG_REPONSEagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_REPONSEagent_non_pause_sec=0; + } + + 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 ""; + } + +##### NOT INBOUND ONLY ### +else + { + if (eregi('ALL-ACTIVE',$group_string)) + { + $multi_drop++; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; + + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; + } + else + { + if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} + + if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) + { + $multi_drop++; + $stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $c=0; + while ($ccamps_to_print > $c) + { + $row=mysql_fetch_row($rslt); + $closer_campaigns = $row[0]; + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} + + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active 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) 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]; + $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); + $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); + $agent_pause_codes_active = $row[19]; + + + $stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select count(*) from vicidial_hopper;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VDhop = $row[0]; + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $DAleads = $row[0]; + $callsTODAY = $row[1]; + $dropsTODAY = $row[2]; + $drpctTODAY = $row[3]; + $diffONEMIN = $row[4]; + $agentsONEMIN = $row[5]; + $balanceFILL = $row[6]; + $answersTODAY = $row[7]; + if ($multi_drop > 0) + { + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + } + $VSCcat1 = $row[8]; + $VSCcat1tally = $row[9]; + $VSCcat2 = $row[10]; + $VSCcat2tally = $row[11]; + $VSCcat3 = $row[12]; + $VSCcat3tally = $row[13]; + $VSCcat4 = $row[14]; + $VSCcat4tally = $row[15]; + + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } + else {$diffpctONEMIN = '0.00';} + + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $balanceSHORT = $row[0]; + + 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  
REPONSES TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_REPONSEagent_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 ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
DIAL NIVEAU:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
- min   MAX NIVEAU:  $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     DIAL PROCEDE:  $DIALmethod    
HOPPER NIVEAU:  $HOPlev     DROPPED / REPONSEED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $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 "       CACHER GROUPE D'UTILISATEURS"; + } +else + { + echo "       VIEW GROUPE D'UTILISATEURS"; + } +if ($UidORname>0) + { + echo "       MONTRER AGENT ID"; + } +else + { + echo "       MONTRER AGENT NAME"; + } +if ($SERVdisplay>0) + { + echo "       CACHER SERVEUR INFO"; + } +else + { + echo "       MONTRER SERVEUR INFO"; + } +if ($CALLSdisplay>0) + { + echo "       CACHER WAITING CALLS"; + } +else + { + echo "       MONTRER WAITING CALLS"; + } +if ($PHONEdisplay>0) + { + echo "       CACHER PHONES"; + } +else + { + echo "       MONTRER PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       CACHER CUSTPHONES"; + } +else + { + echo "       MONTRER CUSTPHONES"; + } +echo "
"; + +echo "\n\n"; +} +################################################################################### +###### INBOUND/OUTBOUND CALLS +################################################################################### +if ($campaign_allow_inbound > 0) + { + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; + $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $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); + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; + } +else + { + if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} + else {$UgroupSQL = " and campaign_id IN($group_SQL)";} + + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;"; + } +if ($CALLSdisplay > 0) + { + $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority"; + } +else + { + $stmtA = "SELECT status"; + } + + +$k=0; +$stmt = "$stmtA $stmtB"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + $in_ivr=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + { + $out_live++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + else + { + if (eregi("IVR",$row[0])) + { + $in_ivr++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $CDqueue_priority[$k] = $row[6]; + $k++; + } + } + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + + $out_total++; + $i++; + } + + ##### MIDI alert audio file test ##### + # $test_midi=1; + # if ($test_midi > 0) + # { + # # echo ""; + # # echo ""; + # 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 " PAS D'APPEL EN ATTENTE\n"; + } + + + +################################################################################### +###### CALLS WAITING +################################################################################### + +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITÉ |\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-12s", $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]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_M = ($Ccall_time_S / 60); + $Ccall_time_M = round($Ccall_time_M, 2); + $Ccall_time_M_int = intval("$Ccall_time_M"); + $Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int); + $Ccall_time_SEC = ($Ccall_time_SEC * 60); + $Ccall_time_SEC = round($Ccall_time_SEC, 0); + if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";} + $Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC"; + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + $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 |\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: Agents Time On Calls Campagne: $group_string $NOW_TIME\n"; + + +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "------------+"; +$HTstation = " STATION |"; +$HDphone = "------------+"; +$HTphone = " PHONE |"; +$HDuser = "--------------------+"; +$HTuser = " USER |"; +$HDusergroup = "--------------+"; +$HTusergroup = " GROUPE D'UTILISATEURS |"; +$HDsessionid = "------------------+"; +$HTsessionid = " SESSIONID |"; +$HDbarge = "-------+"; +$HTbarge = " BARGE |"; +$HDstatus = "----------+"; +$HTstatus = " STATUS |"; +$HDcustphone = "------------+"; +$HTcustphone = " CUST PHONE |"; +$HDserver_ip = "-----------------+"; +$HTserver_ip = " SERVEUR IP |"; +$HDcall_server_ip = "-----------------+"; +$HTcall_server_ip = " CALL SERVEUR IP |"; +$HDtime = "---------+"; +$HTtime = " MM:SS |"; +$HDcampaign = "------------+"; +$HTcampaign = " CAMPAIGN |"; +$HDcalls = "-------+"; +$HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; + +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) && ($IAXmonitorLINK<1) ) + { + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; + } +if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) + { + $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\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\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 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]; + + $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'"; + } + + $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]=$Acall_finish[$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("%-10s", $extension); + while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} + } + else + { + $extension = eregi_replace('Local/',"",$Aextension[$i]); + $extension = sprintf("%-40s", $extension); + while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} + } + + $phone = sprintf("%-10s", $phone_split[0]); + $custphone = sprintf("%-10s", $custphone); + $Luser = $Auser[$i]; + $user = sprintf("%-18s", $Auser[$i]); + $Lsessionid = $Asessionid[$i]; + $sessionid = sprintf("%-9s", $Asessionid[$i]); + $Lstatus = $Astatus[$i]; + $status = sprintf("%-6s", $Astatus[$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)) + { + ### temporarily deactivate DEAD calls display until bug is fixed + if (!ereg("$Acallerid[$i]\|",$callerids)) + { + $Astatus[$i] = 'DEAD'; + $Lstatus = 'DEAD'; + $status = ' DEAD '; + } + + if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) + {$CM='A';} + else + { + if (eregi("ENTRANT",$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("%-18s", $Afull_name[$i]); + while(strlen($user)>18) {$user = substr("$user", 0, -1);} + } + else + { + $user = sprintf("%-40s", $Afull_name[$i]); + while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} + } + } + if (!eregi("INCALL|QUEUE",$Astatus[$i])) + {$call_time_S = ($STARTtime - $Acall_finish[$i]);} + else + {$call_time_S = ($STARTtime - $Acall_time[$i]);} + + $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 ($Lstatus=='INCALL') + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$G=''; $EG='';} + # if ($call_time_M_int >= 10) {$G=''; $EG='';} + } + if ($Lstatus=='DEAD') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_dead++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + } + } + if ($Lstatus=='DISPO') + { + if ($call_time_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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_M_int >= 360) + {$j++; continue;} + else + { + $agent_paused++; $agent_total++; + $G=''; $EG=''; + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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)) ) {$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_M_int >= 1) {$G=''; $EG='';} + if ($call_time_M_int >= 5) {$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 ($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 campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' 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[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 .= " Système de charge 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 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 agents morts dans les appels      \n"; + + echo "
";
+		echo "";
+		echo "$Cecho";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo " AUCUN AGENT EN APPEL\n";
+	echo "
$Cecho";
+	}
+
+?>
+
+
+ + diff --git a/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php similarity index 88% rename from LANG_www/vicidial/AST_timeonVDADallSUMMARY.php rename to LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php index 242b27a0..7d4c5778 100644 --- a/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_fr/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -13,6 +13,8 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -30,8 +32,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (!isset($RR)) {$gRRroup=4;} @@ -49,7 +51,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -104,8 +106,15 @@ if (!isset($RR)) {$RR=4;} \n"; -echo "VICIDIAL: Realtime All Campaigns Summary\n"; -echo "VICIDIAL: Realtime All Campaigns Summary           \n"; +echo "VICIDIAL: Realtime All Campagnes Summary\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "VICIDIAL: Realtime All Campagnes Summary           \n"; echo "STOP | "; echo "SLOW | "; echo "GO "; @@ -118,7 +127,7 @@ else { echo "- VIEW LESS SETTINGS"; } -echo "       REPORTS"; +echo "       RAPPORTS"; echo "

\n\n"; $k=0; @@ -201,7 +210,7 @@ $row=mysql_fetch_row($rslt); $balanceSHORT = $row[0]; echo "
"; -echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -211,7 +220,7 @@ echo ""; if ($adastats>1) { echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -229,12 +238,12 @@ echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; -echo ""; -echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; @@ -305,6 +314,7 @@ $parked_to_print = mysql_num_rows($rslt); $out_total=0; $out_ring=0; $out_live=0; + $in_ivr=0; while ($i < $parked_to_print) { $row=mysql_fetch_row($rslt); @@ -313,6 +323,8 @@ $parked_to_print = mysql_num_rows($rslt); {$out_live++;} else { + if (eregi("IVR",$row[0])) + {$in_ivr++;} if (eregi("CLOSER",$row[0])) {$nothing=1;} else @@ -334,10 +346,11 @@ $parked_to_print = mysql_num_rows($rslt); 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 " NO LIVE CALLS WAITING \n"; + echo " PAS D'APPEL EN ATTENTE\n"; } @@ -438,5 +451,6 @@ $k++; ?> +
DIAL LEVEL:  $DIALlev    DIAL NIVEAU:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  MAX LEVEL:  $maxDIALlev     MAX NIVEAU:  $maxDIALlev   DROPPED MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
DIALABLE LEADS:  $DAleads     CALLS TODAY:  $callsTODAY     AVG AGENTS:  $agentsONEMIN     DIAL METHOD:  $DIALmethod     DIAL PROCEDE:  $DIALmethod    
HOPPER LEVEL:  $HOPlev     DROPPED / ANSWERED:  $dropsTODAY / $answersTODAY   HOPPER NIVEAU:  $HOPlev     DROPPED / REPONSEED:  $dropsTODAY / $answersTODAY   DL DIFF:  $diffONEMIN     STATUSES:  $DIALstatuses    
diff --git a/LANG_www/vicidial/AST_timeonpark.php b/LANG_www/vicidial_fr/AST_timeonpark.php similarity index 94% rename from LANG_www/vicidial/AST_timeonpark.php rename to LANG_www/vicidial_fr/AST_timeonpark.php index fd54a333..e80182a3 100644 --- a/LANG_www/vicidial/AST_timeonpark.php +++ b/LANG_www/vicidial_fr/AST_timeonpark.php @@ -1,8 +1,8 @@ LICENSE: GPLv2 -### +# AST_timeonpark.php +# +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# # CHANGES # # 60620-1042 - Added variable filtering to eliminate SQL injection attack threat @@ -20,8 +20,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -36,7 +36,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -89,7 +89,7 @@ echo"VICIDIAL: Time On Park\n"; echo "
\n\n";
 
-echo "VICIDIAL: Time On Park         $NOW_TIME    REPORTS\n\n";
+echo "VICIDIAL: Time On Park         $NOW_TIME    RAPPORTS\n\n";
 echo "+------------+-----------------+---------------------+---------+\n";
 echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
 echo "+------------+-----------------+---------------------+---------+\n";
@@ -143,7 +143,7 @@ $parked_to_print = mysql_num_rows($rslt);
 	{
 	echo "****************************************************************\n";
 	echo "****************************************************************\n";
-	echo "******************** NO LIVE CALLS WAITING *********************\n";
+	echo "******************** PAS D'APPEL EN ATTENTE*********************\n";
 	echo "****************************************************************\n";
 	echo "****************************************************************\n";
 	}
@@ -207,7 +207,7 @@ $talking_to_print = mysql_num_rows($rslt);
 	{
 	echo "**************************************************************************************\n";
 	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
+	echo "********************************* AUCUN AGENT EN APPEL*********************************\n";
 	echo "**************************************************************************************\n";
 	echo "**************************************************************************************\n";
 	}
diff --git a/LANG_www/vicidial_fr/admin.php b/LANG_www/vicidial_fr/admin.php
new file mode 100644
index 00000000..5498b895
--- /dev/null
+++ b/LANG_www/vicidial_fr/admin.php
@@ -0,0 +1,20243 @@
+    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';
+$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';
+$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';
+$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_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["VALIDER"]))	{$VALIDER=$_GET["VALIDER"];}
+	elseif (isset($_POST["VALIDER"]))	{$VALIDER=$_POST["VALIDER"];}
+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($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 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];
+	$SSenable_queuemetrics_logging =	$row[1];
+	$SSenable_vtiger_integration =		$row[2];
+	$SSqc_features_active =				$row[3];
+	$SSoutbound_autodial_active =		$row[4];
+	$i++;
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+######################################################################################################
+######################################################################################################
+#######   Form variable filtering for security and data integrity
+######################################################################################################
+######################################################################################################
+
+if ($non_latin < 1)
+{
+### DIGITS ONLY ###
+$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage);
+$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);
+$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten);
+$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);
+$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds);
+$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);
+$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id);
+$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);
+
+### 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("[^\n0-9]","",$phone_numbers);
+
+### Y or N ONLY ###
+$active = ereg_replace("[^NY]","",$active);
+$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);
+$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc);
+$use_campaign_dnc = ereg_replace("[^NY]","",$use_campaign_dnc);
+$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);
+$disable_alter_custphone = ereg_replace("[^NY]","",$disable_alter_custphone);
+$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);
+
+$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled);
+
+
+### ALPHA-NUMERIC ONLY ###
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id);
+$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);
+
+### 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);
+
+### 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);
+
+### 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);
+$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status);
+$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);
+$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten);
+$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);
+$hold_time_option_callback_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_option_callback_filename);
+$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);
+
+### 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 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);
+
+### 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);
+$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);
+$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);
+
+### 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);
+
+### 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);
+$globals_string = ereg_replace(";","",$globals_string);
+$dialplan_entry = ereg_replace(";","",$dialplan_entry);
+
+### VARIABLES TO BE mysql_real_escape_string ###
+# $web_form_address
+# $queuemetrics_url
+# $admin_home_url
+# $qc_web_form_address
+# $vtiger_url
+
+### VARIABLES not filtered at all ###
+# $script_text
+
+}	# end of non_latin
+
+
+##### END VARIABLE FILTERING FOR SECURITY #####
+
+
+# AST GUI 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
+#
+# 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.0.5-172';
+$build = '90310-2203';
+
+$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);
+
+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 "Vous êtes maintenant déconnecté. Merci.\n";
+    exit;
+}
+
+#############################################
+##### 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 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 "Login ou mot de passe invalide: |$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 * 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];
+
+		$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 DE VICIDIAL: ";
+
+if (!isset($ADD))   {$ADD=0;}
+
+if ($ADD=="1")			{$hh='users';		echo "Ajouter un nouvel utilisateur";}
+if ($ADD=="1A")			{$hh='users';		echo "Utilisateur De Copy";}
+if ($ADD==11)			{$hh='campaigns';	$sh='basic';	echo "Ajouter une nouvelle campagne";}
+if ($ADD==12)			{$hh='campaigns';	$sh='basic';	echo "Campagne De Copy";}
+if ($ADD==111)			{$hh='lists';		echo "Ajouter une nouvelle liste";}
+if ($ADD==121)			{$hh='lists';		echo "Ajouter un nouveau DNC";}
+if ($ADD==1111)			{$hh='ingroups';	echo "Ajouter un nouveau in-group";}
+if ($ADD==1211)			{$hh='ingroups';	echo "Dans-Groupe De Copy";}
+if ($ADD==1311)			{$hh='ingroups';	echo "Ajouter un nouveauDID";}
+if ($ADD==1411)			{$hh='ingroups';	echo "CopieDID";}
+if ($ADD==11111)		{$hh='remoteagent';	echo "Ajouter de nouveaux agents distants";}
+if ($ADD==111111)		{$hh='usergroups';	echo "Ajouter de nouveaux groupes d'utilisateurs";}
+if ($ADD==1111111)		{$hh='scripts';		echo "Ajouter un nouveau script";}
+if ($ADD==11111111)		{$hh='filters';		echo "Ajouter un nouveau filtre";}
+if ($ADD==111111111)	{$hh='admin';	$sh='times';	echo "Ajouter une nouvelle période d'appels";}
+if ($ADD==131111111)	{$hh='admin';	$sh='shifts';	echo "Ajouter un nouveau Shift";}
+if ($ADD==1111111111)	{$hh='admin';	$sh='times';	echo "Ajouter une nouvelle période d'appels d'état";}
+if ($ADD==11111111111)	{$hh='admin';	$sh='phones';	echo "AJOUTER UN NOUVEAU TELEPEHONE";}
+if ($ADD==12111111111)	{$hh='admin';	$sh='phones';	echo "AJOUTER UN NOUVEAU TELEPEHONE ALIAS";}
+if ($ADD==13111111111)	{$hh='admin';	$sh='phones';	echo "ADD NEW GROUP ALIAS";}
+if ($ADD==111111111111)	{$hh='admin';	$sh='server';	echo "AJOUTER UN NOUVEAU SERVEUR";}
+if ($ADD==131111111111)	{$hh='admin';	$sh='templates';	echo "ADD NEW CONF TEMPLATE";}
+if ($ADD==141111111111)	{$hh='admin';	$sh='carriers';	echo "ADD NEW CARRIER";}
+if ($ADD==1111111111111)	{$hh='admin';	$sh='conference';	echo "AJOUTER UNE NOUVELLE CONFERENCE";}
+if ($ADD==11111111111111)	{$hh='admin';	$sh='conference';	echo "ADD NEW VICIDIAL CONFERENCE";}
+if ($ADD=='2')			{$hh='users';		echo "Ajout d'un nouvel utilisateur";}
+if ($ADD=='2A')			{$hh='users';		echo "Nouvelle Addition Copiée D'Utilisateur";}
+if ($ADD==20)			{$hh='campaigns';	$sh='basic';	echo "Nouvelle Addition Copiée De Campagne";}
+if ($ADD==21)			{$hh='campaigns';	$sh='basic';	echo "Ajout d'une nouvelle campagne";}
+if ($ADD==22)			{$hh='campaigns';	$sh='status';	echo "Ajout d'un nouveau statut de campagne";}
+if ($ADD==23)			{$hh='campaigns';	$sh='hotkey';	echo "New Campagne HotKey Addition";}
+if ($ADD==25)			{$hh='campaigns';	$sh='recycle';	echo "New CampagneLe Fil RéutilisentAddition";}
+if ($ADD==26)			{$hh='campaigns';	$sh='autoalt';	echo "Nouveau statut d'appel automatique du numéro alternatif";}
+if ($ADD==27)			{$hh='campaigns';	$sh='pause';	echo "Nouveau code de pause";}
+if ($ADD==28)			{$hh='campaigns';	$sh='dialstat';	echo "Statut d'appel pour la campagne ajouté";}
+if ($ADD==29)			{$hh='campaigns';	$sh='listmix';	echo "Le Mélange De Liste De Campagne S'est ajouté";}
+if ($ADD==211)			{$hh='lists';		echo "Ajout d'une nouvelle liste";}
+if ($ADD==2111)			{$hh='ingroups';	echo "Ajout d'un nouvel In-Group";}
+if ($ADD==2011)			{$hh='ingroups';	echo "Nouvelle Addition Copiée De Dans-Groupe";}
+if ($ADD==2311)			{$hh='ingroups';	echo "A New Addition";}
+if ($ADD==2411)			{$hh='ingroups';	echo "Nouvelle adjonction Copied DID";}
+if ($ADD==21111)		{$hh='remoteagent';	echo "Ajout d'un nouvel agent distant";}
+if ($ADD==211111)		{$hh='usergroups';	echo "Ajout d'un nouveau groupe d'utilisateurs";}
+if ($ADD==2111111)		{$hh='scripts';		echo "Ajout d'un nouveau script";}
+if ($ADD==21111111)		{$hh='filters';		echo "Ajout d'un nouveau filtre";}
+if ($ADD==211111111)	{$hh='admin';	$sh='times';	echo "Ajout d'une nouvelle période d'appels";}
+if ($ADD==231111111)	{$hh='admin';	$sh='shifts';	echo "New Shift adjonction";}
+if ($ADD==2111111111)	{$hh='admin';	$sh='times';	echo "Ajout d'une nouvelle période d'appels d'état";}
+if ($ADD==21111111111)	{$hh='admin';	$sh='phones';	echo "AJOUTER UN NOUVEAU TELEPHONE";}
+if ($ADD==22111111111)	{$hh='admin';	$sh='phones';	echo "AJOUT DE NOUVEAU TÉLÉPHONE ALIAS";}
+if ($ADD==23111111111)	{$hh='admin';	$sh='phones';	echo "AJOUT DE NOUVEAU GROUPE ALIAS";}
+if ($ADD==211111111111)	{$hh='admin';	$sh='server';	echo "AJOUTER UN NOUVEAU SERVEUR";}
+if ($ADD==221111111111)	{$hh='admin';	$sh='server';	echo "AJOUT D'UN NOUVEAU TRUNK VERS UN SERVEUR VICIDIAL";}
+if ($ADD==231111111111)	{$hh='admin';	$sh='templates';	echo "AJOUT DE NOUVEAUX CONF TEMPLATE";}
+if ($ADD==241111111111)	{$hh='admin';	$sh='carriers';	echo "AJOUT DE NOUVEAUX CARRIER";}
+if ($ADD==2111111111111)	{$hh='admin';	$sh='conference';	echo "AJOUT D'UNE NOUVELLE CONFERENCE";}
+if ($ADD==21111111111111)	{$hh='admin';	$sh='conference';	echo "ADDING NEW VICIDIAL CONFERENCE";}
+if ($ADD==221111111111111)	{$hh='admin';	$sh='status';	echo "AJOUTER DES STATUTS DE SYSTÈME DE VICIDIAL";}
+if ($ADD==231111111111111)	{$hh='admin';	$sh='status';	echo "AJOUTER LA CATÉGORIE DE STATUT DE VICIDIAL";}
+if ($ADD==241111111111111)	{$hh='admin';	$sh='status';	echo "AJOUT VICIDIAL QC Code de statut";}
+if ($ADD==3)			{$hh='users';		echo "Modifier un utilisateur";}
+if ($ADD==30)			{$hh='campaigns';	echo "Camapagne non autorisée";}
+if ($ADD==31)			
+		{
+		$hh='campaigns';	$sh='detail';	echo "Modifier la campagne - Détail - $campaign_id";
+		if ($SUB==22)	{echo " - Statuts";}
+		if ($SUB==23)	{echo " - HotKeys";}
+		if ($SUB==25)	{echo " -Le Fil RéutilisentEntries";}
+		if ($SUB==26)	{echo " - Auto Alt Dial Statuts";}
+		if ($SUB==27)	{echo " - Agent Pause Codes";}
+		if ($SUB==28)	{echo " - QC";}
+		if ($SUB==29)	{echo " - Liste Mixes";}
+		if ($SUB=='20A')	{echo " - Sondage";}
+		}
+if ($ADD==34)
+		{
+		$hh='campaigns';	$sh='basic';	echo "Modifier une Campagne - Vue Basique - $campaign_id";
+		if ($SUB==22)	{echo " - Statuts";}
+		if ($SUB==23)	{echo " - HotKeys";}
+		if ($SUB==25)	{echo " -Le Fil RéutilisentEntries";}
+		if ($SUB==26)	{echo " - Auto Alt Dial Statuts";}
+		if ($SUB==27)	{echo " - Agent Pause Codes";}
+		if ($SUB==28)	{echo " - QC";}
+		if ($SUB==29)	{echo " - Liste Mixes";}
+		if ($SUB=='20A')	{echo " - Sondage";}
+		}
+if ($ADD==32)			{$hh='campaigns';	$sh='status';	echo "Statuts De Campagne";}
+if ($ADD==33)			{$hh='campaigns';	$sh='hotkey';	echo "Campagne HotKeys";}
+if ($ADD==35)			{$hh='campaigns';	$sh='recycle';	echo "Le Fil De Campagne Réutilisent Des Entrées";}
+if ($ADD==36)			{$hh='campaigns';	$sh='autoalt';	echo "Statuts Automatiques De Cadran De la Campagne Alt";}
+if ($ADD==37)			{$hh='campaigns';	$sh='pause';	echo "Codes De Pause D'Agent De Campagne";}
+if ($ADD==38)			{$hh='campaigns';	$sh='dialstat';	echo "Statuts De Cadran De Campagne";}
+if ($ADD==39)			{$hh='campaigns';	$sh='listmix';	echo "Mlanges De Liste De Campagne";}
+if ($ADD==311)			{$hh='lists';		echo "Modifier la liste";}
+if ($ADD==3111)			{$hh='ingroups';	echo "Modifier le In-Group";}
+if ($ADD==3311)			{$hh='ingroups';	echo "ModifierDID";}
+if ($ADD==31111)		{$hh='remoteagent';	echo "Modifier les agents distants";}
+if ($ADD==311111)		{$hh='usergroups';	echo "Modifier les groupes d'utilisateurs";}
+if ($ADD==3111111)		{$hh='scripts';		echo "Modifier le script";}
+if ($ADD==31111111)		{$hh='filters';		echo "Modifier le filtre";}
+if ($ADD==311111111)	{$hh='admin';	$sh='times';	echo "Modifier la période d'appels";}
+if ($ADD==321111111)	{$hh='admin';	$sh='times';	echo "Modifier la liste des définitions des périodes d'appels d'état";}
+if ($ADD==331111111)	{$hh='admin';	$sh='shifts';	echo "Modifier Shift";}
+if ($ADD==3111111111)	{$hh='admin';	$sh='times';	echo "Modifier la période d'appels d'état";}
+if ($ADD==31111111111)	{$hh='admin';	$sh='phones';	echo "MODIFIER LE TELEPHONE";}
+if ($ADD==32111111111)	{$hh='admin';	$sh='phones';	echo "MODIFIER LE TELEPHONE ALIAS";}
+if ($ADD==33111111111)	{$hh='admin';	$sh='phones';	echo "Modifier un groupe ALIAS";}
+if ($ADD==311111111111)	{$hh='admin';	$sh='server';	echo "MODIFIER LE SERVEUR";}
+if ($ADD==331111111111)	{$hh='admin';	$sh='templates';	echo "MODIFY CONF TEMPLATE";}
+if ($ADD==341111111111)	{$hh='admin';	$sh='carriers';	echo "MODIFY CARRIER";}
+if ($ADD==3111111111111)	{$hh='admin';	$sh='conference';	echo "MODIFIER LA CONFERENCE";}
+if ($ADD==31111111111111)	{$hh='admin';	$sh='conference';	echo "MODIFY VICIDIAL CONFERENCE";}
+if ($ADD==311111111111111)	{$hh='admin';	$sh='settings';	echo "MODIFIER LES REGLAGES DU SYSTEME VICIDIAL";}
+if ($ADD==321111111111111)	{$hh='admin';	$sh='status';	echo "MODIFIEZ LES STATUTS DE SYSTÈME DE VICIDIAL";}
+if ($ADD==331111111111111)	{$hh='admin';	$sh='status';	echo "MODIFIEZ LA CATÉGORIE DE STATUT DE VICIDIAL";}
+if ($ADD==341111111111111)	{$hh='admin';	$sh='status';	echo "MODIFY VICIDIAL QC Code de statut";}
+if ($ADD=="4A")			{$hh='users';		echo "Modifier un utilisateur - Admin";}
+if ($ADD=="4B")			{$hh='users';		echo "Modifier un utilisateur - Admin";}
+if ($ADD==4)			{$hh='users';		echo "Modifier un utilisateur";}
+if ($ADD==41)			{$hh='campaigns';	$sh='detail';	echo "Modifier la campagne";}
+if ($ADD==42)			{$hh='campaigns';	$sh='status';	echo "Modifier la campagne Status";}
+if ($ADD==43)			{$hh='campaigns';	$sh='hotkey';	echo "Modifier la campagne HotKey";}
+if ($ADD==44)			{$hh='campaigns';	$sh='basic';	echo "Modifier une Campagne - Vue Basique";}
+if ($ADD==45)			{$hh='campaigns';	$sh='recycle';	echo "Modifier la campagne Recyclage Plomb";}
+if ($ADD==47)			{$hh='campaigns';	$sh='pause';	echo "Modifier le code de pause";}
+if ($ADD==48)			{$hh='campaigns';	$sh='qc';	echo "Modifier les paramètres de campagne QC";}
+if ($ADD==49)			{$hh='campaigns';	$sh='listmix';	echo "Modifiez Le Mélange De Liste De Campagne";}
+if ($ADD=='40A')		{$hh='campaigns';	$sh='survey';	echo "Modifier Campagne Sondage";}
+if ($ADD==411)			{$hh='lists';		echo "Modifier la liste";}
+if ($ADD==4111)			{$hh='ingroups';	echo "Modifier le In-Group";}
+if ($ADD==4311)			{$hh='ingroups';	echo "ModifierDID";}
+if ($ADD==41111)		{$hh='remoteagent';	echo "Modifier les agents distants";}
+if ($ADD==411111)		{$hh='usergroups';	echo "Modifier les groupes d'utilisateurs";}
+if ($ADD==4111111)		{$hh='scripts';		echo "Modifier le script";}
+if ($ADD==41111111)		{$hh='filters';		echo "Modifier le filtre";}
+if ($ADD==411111111)	{$hh='admin';	$sh='times';	echo "Modifier la période d'appels";}
+if ($ADD==431111111)	{$hh='admin';	$sh='shifts';	echo "Modifier Shift";}
+if ($ADD==4111111111)	{$hh='admin';	$sh='times';	echo "Modifier la période d'appels d'état";}
+if ($ADD==41111111111)	{$hh='admin';	$sh='phones';	echo "MODIFIER LE TELEPHONE";}
+if ($ADD==42111111111)	{$hh='admin';	$sh='phones';	echo "MODIFIER LE TELEPHONE ALIAS";}
+if ($ADD==43111111111)	{$hh='admin';	$sh='phones';	echo "Modifier un groupe ALIAS";}
+if ($ADD==411111111111)	{$hh='admin';	$sh='server';	echo "MODIFIER LE SERVEUR";}
+if ($ADD==421111111111)	{$hh='admin';	$sh='server';	echo "MODIFIER LE TRUNK SERVEUR VICIDIAL";}
+if ($ADD==431111111111)	{$hh='admin';	$sh='templates';	echo "MODIFY CONF TEMPLATE";}
+if ($ADD==441111111111)	{$hh='admin';	$sh='carriers';	echo "MODIFY CARRIER";}
+if ($ADD==4111111111111)	{$hh='admin';	$sh='conference';	echo "MODIFIER LA CONFERENCE";}
+if ($ADD==41111111111111)	{$hh='admin';	$sh='conference';	echo "MODIFY VICIDIAL CONFERENCE";}
+if ($ADD==411111111111111)	{$hh='admin';	$sh='settings';	echo "MODIFIER LES REGLAGES DU SYSTEME VICIDIAL";}
+if ($ADD==421111111111111)	{$hh='admin';	$sh='status';	echo "MODIFIEZ LES STATUTS DE SYSTÈME DE VICIDIAL";}
+if ($ADD==431111111111111)	{$hh='admin';	$sh='status';	echo "MODIFIEZ LES CATÉGORIES DE STATUT DE VICIDIAL";}
+if ($ADD==441111111111111)	{$hh='admin';	$sh='status';	echo "MODIFY VICIDIAL QC Code de statut";}
+if ($ADD==5)			{$hh='users';		echo "SupprimerUtilisateur";}
+if ($ADD==51)			{$hh='campaigns';	$sh='detail';	echo "SupprimerCampagne";}
+if ($ADD==52)			{$hh='campaigns';	$sh='detail';	echo "Déconnecter les agents";}
+if ($ADD==53)			{$hh='campaigns';	$sh='detail';	echo "Emergency VDAC Jam Clear";}
+if ($ADD==511)			{$hh='lists';		echo "SupprimerList";}
+if ($ADD==5111)			{$hh='ingroups';	echo "SupprimerIn-Group";}
+if ($ADD==5311)			{$hh='ingroups';	echo "SupprimerDID";}
+if ($ADD==51111)		{$hh='remoteagent';	echo "Supprimer les agents distants";}
+if ($ADD==511111)		{$hh='usergroups';	echo "Supprimer les utilisateurs Group";}
+if ($ADD==5111111)		{$hh='scripts';		echo "Supprimer les scripts";}
+if ($ADD==51111111)		{$hh='filters';		echo "Supprimer le filtre";}
+if ($ADD==511111111)	{$hh='admin';	$sh='times';	echo "SupprimerCall Time";}
+if ($ADD==531111111)	{$hh='admin';	$sh='shifts';	echo "Maj + Suppr";}
+if ($ADD==5111111111)	{$hh='admin';	$sh='times';	echo "Supprimer la période d'appels d'état";}
+if ($ADD==51111111111)	{$hh='admin';	$sh='phones';	echo "DELETE PHONE";}
+if ($ADD==52111111111)	{$hh='admin';	$sh='phones';	echo "DELETE PHONE ALIAS";}
+if ($ADD==53111111111)	{$hh='admin';	$sh='phones';	echo "DELETE GROUP ALIAS";}
+if ($ADD==511111111111)	{$hh='admin';	$sh='server';	echo "DELETE SERVER";}
+if ($ADD==531111111111)	{$hh='admin';	$sh='templates';	echo "DELETE CONF TEMPLATE";}
+if ($ADD==541111111111)	{$hh='admin';	$sh='carriers';	echo "DELETE CARRIER";}
+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 "SupprimerUtilisateur";}
+if ($ADD==61)			{$hh='campaigns';	$sh='detail';	echo "SupprimerCampagne";}
+if ($ADD==62)			{$hh='campaigns';	$sh='detail';	echo "Déconnecter les agents";}
+if ($ADD==63)			{$hh='campaigns';	$sh='detail';	echo "Emergency VDAC Jam Clear";}
+if ($ADD==65)			{$hh='campaigns';	$sh='recycle';	echo "Supprimer le recyclage des fiches";}
+if ($ADD==66)			{$hh='campaigns';	$sh='autoalt';	echo "Supprimer ce statut d'appel automatique du numéro alternatif";}
+if ($ADD==67)			{$hh='campaigns';	$sh='pause';	echo "Supprimer le code de pause";}
+if ($ADD==68)			{$hh='campaigns';	$sh='dialstat';	echo "Statut d'appel pour la campagne supprimé";}
+if ($ADD==69)			{$hh='campaigns';	$sh='listmix';	echo "Mélange De Liste De Campagne Enlevé";}
+if ($ADD==611)			{$hh='lists';		echo "SupprimerList";}
+if ($ADD==6111)			{$hh='ingroups';	echo "SupprimerIn-Group";}
+if ($ADD==6311)			{$hh='ingroups';	echo "SupprimerDID";}
+if ($ADD==61111)		{$hh='remoteagent';	echo "Supprimer les agents distants";}
+if ($ADD==611111)		{$hh='usergroups';	echo "Supprimer les utilisateurs Group";}
+if ($ADD==6111111)		{$hh='scripts';		echo "Supprimer les scripts";}
+if ($ADD==61111111)		{$hh='filters';		echo "Supprimer le filtre";}
+if ($ADD==611111111)	{$hh='admin';	$sh='times';	echo "SupprimerCall Time";}
+if ($ADD==631111111)	{$hh='admin';	$sh='shifts';	echo "Maj + Suppr";}
+if ($ADD==6111111111)	{$hh='admin';	$sh='times';	echo "Supprimer la période d'appels d'état";}
+if ($ADD==61111111111)	{$hh='admin';	$sh='phones';	echo "DELETE PHONE";}
+if ($ADD==62111111111)	{$hh='admin';	$sh='phones';	echo "DELETE PHONE ALIAS";}
+if ($ADD==63111111111)	{$hh='admin';	$sh='phones';	echo "DELETE GROUP ALIAS";}
+if ($ADD==611111111111)	{$hh='admin';	$sh='server';	echo "DELETE SERVER";}
+if ($ADD==621111111111)	{$hh='admin';	$sh='server';	echo "SUPPRIMER LE TRUNK SERVEUR VICIDIAL";}
+if ($ADD==621111111111)	{$hh='admin';	$sh='templates';	echo "DELETE CONF TEMPLATE";}
+if ($ADD==621111111111)	{$hh='admin';	$sh='carriers';	echo "DELETE CARRIER";}
+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 "Nombre de fiches désavtivées";}
+if ($ADD==7111111)		{$hh='scripts';		echo "Prévisualisation du script";}
+if ($ADD==700000000000000)	{$hh='reports';	echo "ADMINISTRATION DE VICIDIAL CHANGE LOG";}
+if ($ADD==710000000000000)	{$hh='reports';	echo "VICIDIAL UTILISATEUR ADMIN CHANGE LOG";}
+if ($ADD==720000000000000)	{$hh='reports';	echo "VICIDIAL SECTION ADMIN CHANGE LOG";}
+if ($ADD==730000000000000)	{$hh='reports';	echo "VICIDIAL DETAIL ADMIN CHANGE LOG";}
+if ($ADD==0)			{$hh='users';		echo "Liste des utilisateurs";}
+if ($ADD==8)			{$hh='users';		echo "Rappels de l'agent";}
+if ($ADD==81)			{$hh='campaigns';	$sh='list';	echo "Rappels dans la campagne ";}
+if ($ADD==811)			{$hh='lists';	echo "Rappels dans la liste";}
+if ($ADD==8111)			{$hh='usergroups';	echo "Rappels de service dans le groupe d'utilisateurs";}
+if ($ADD==10)			{$hh='campaigns';	$sh='list';		echo "Campagnes";}
+if ($ADD==100)			{$hh='lists';		echo "Listes";}
+if ($ADD==1000)			{$hh='ingroups';	echo "In-Groups";}
+if ($ADD==1300)			{$hh='ingroups';	echo "DIDs";}
+if ($ADD==10000)		{$hh='remoteagent';	echo "Agents distants";}
+if ($ADD==100000)		{$hh='usergroups';	echo "Groupes d'utilisateurs";}
+if ($ADD==1000000)		{$hh='scripts';		echo "Scripts";}
+if ($ADD==10000000)		{$hh='filters';		echo "Filtres";}
+if ($ADD==100000000)	{$hh='admin';	$sh='times';	echo "Périodes d'appels";}
+if ($ADD==130000000)	{$hh='admin';	$sh='shifts';	echo "Shifts";}
+if ($ADD==1000000000)	{$hh='admin';	$sh='times';	echo "Périodes d'appels d'états";}
+if ($ADD==10000000000)	{$hh='admin';	$sh='phones';	echo "LISTE DE TELEPHONES";}
+if ($ADD==12000000000)	{$hh='admin';	$sh='phones';	echo "TÉLÉLISTE DE TELEPHONESE ALIAS";}
+if ($ADD==13000000000)	{$hh='admin';	$sh='phones';	echo "GROUPE ALIAS LISTE";}
+if ($ADD==100000000000)	{$hh='admin';	$sh='server';	echo "LISTE DE SERVEURS";}
+if ($ADD==130000000000)	{$hh='admin';	$sh='templates';	echo "CONF TEMPLATE LISTE";}
+if ($ADD==140000000000)	{$hh='admin';	$sh='carriers';	echo "CARRIER LISTE";}
+if ($ADD==1000000000000)	{$hh='admin';	$sh='conference';	echo "LISTE DE CONFERENCES";}
+if ($ADD==10000000000000)	{$hh='admin';	$sh='conference';	echo "VICIDIAL LISTE DE CONFERENCES";}
+if ($ADD==550)			{$hh='users';		echo "Formulaire de recherche";}
+if ($ADD==551)			{$hh='users';		echo "RECHERCHER DES TELEPHONES";}
+if ($ADD==660)			{$hh='users';		echo "Résultats de la recherche";}
+if ($ADD==661)			{$hh='users';		echo "RESULTATS DE LA RECHERCHE DE TELEPHONES";}
+if ($ADD==99999)		{$hh='users';		echo "AIDE";}
+if ($ADD==999999)		{$hh='reports';		echo "RAPPORTS";}
+
+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>CAMPAIGN</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") )
+			{
+			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);
+				}
+			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="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';";
+			$rslt=mysql_query($stmt, $link);
+			}
+		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-CAMPAGNES-',$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>ENTRANT 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);
+				}
+			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="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);
+			}
+		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-CAMPAGNES-"';
+	$qc_campaigns_value='';
+	$qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPAGNES-"';
+	$qc_groups_value='';
+	$qc_groups_list='<B><input type="checkbox" name="qc_groups[]" value="-ALL-GROUPS-"';
+		$p=0;
+		while ($p<100)
+			{
+			if (eregi('ALL-CAMPAGNES',$campaigns[$p])) 
+				{
+				$campaigns_list.=" CHECKED";
+				$campaigns_value .= " -ALL-CAMPAGNES- -";
+				}
+			if (eregi('ALL-CAMPAGNES',$qc_campaigns[$p])) 
+				{
+				$qc_campaigns_list.=" CHECKED";
+				$qc_campaigns_value .= " -ALL-CAMPAGNES- -";
+				}
+			if (eregi('ALL-GROUPS',$qc_groups[$p])) 
+				{
+				$qc_groups_list.=" CHECKED";
+				$qc_groups_value .= " -ALL-GROUPS- -";
+				}
+			$p++;
+			}
+	$campaigns_list.="> ALL-CAMPAGNES - LES UTILISATEURS PEUVENT VOIR CHAQUE CAMPAGNE</B><BR>\n";
+	$qc_campaigns_list.="> ALL-CAMPAGNES - UTILISATEURS CAN QC TOUTE LA CAMPAGNE</B><BR>\n";
+	$qc_groups_list.="> ALL-GROUPS - UTILISATEURS CAN QC ENTRANT TOUT GROUP</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<100)
+			{
+			if ($campaign_id_value == $campaigns[$p]) 
+				{
+			#	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<100)
+			{
+			if ($group_id_value == $qc_groups[$p]) 
+				{
+				$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=\"AIDE\" 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 DE VICIDIAL: AIDE


\n"; + +?> +VICIDIAL_UTILISATEURS TABLE

+ +
+ID Utilisateur - C'est ici que vous mettez le numéro ID de l'utilisateur VICIDIAL, entre 2 et 8 caractères. + +
+
+
+Mot de passe - Mot de passe de l'utilisateur VICIDIAL. Doit contenir au moins 2 caractères. + +
+
+
+Nom complet - C'est dans ce champ que vous mettez le nom complet de l'utilisateur VICIDIAL. Doit contenir au moins 2 caractères. + +
+
+
+Niveau de l'utilisateur - C'est ici que vous sélectionnez le niveau de l'utilisateur. Le niveau doit être de 1 pour pouvoir ce connecter à VICIDIAL, plus grand que 2 pour se connecter à une campagne de type Closer, doit être superieur ou égal à 8 pour accéder à la section web administrateur. + +
+
+
+Groupe d'utilisateur - C'est dans ce menu que vous selectionnez le groupe utilisateur dans lequel sera cet utilisateur. Pour l'instant il n'y a pas de restriction, ce n'est que pour répartir les utilisateurs et autoriser les futures fonctions basées sur ceci. + +
+
+
+Login du téléphone - C'est ici que vous mettez le login par défaut du téléphone pour quand cette utilisateur se connecte dans vicidial.php. Le champ phone_login sera automatiquement rempli par cette valeur quand l'utilisateur se connectera avec son utilisateur-mot_de_passe_passe-campagne dans l'écran de connection vicidial.php . + +
+
+
+Mot de passe du téléphone - C'est ici que vous mettez le mot de passe par defaut du téléphone pour quand l'utisateur se connecte dans vicidial.php. Le champ phone_pass sera rempli automatiquement avec cette valeur quand l'utilisateur se connectera avec utilislateur-passe-campagne dans l'écran de conncetion vicidial.php. + +
+
+
+Active - Ce champ détermine si l'utilisateur est actif dans le système et peuvent utiliser VICIDIAL ressources. La valeur par défaut est Y + +
+
+
+Raccourcis clavier actifs - Si cette option est à 1 elle autorise l'utilisateur à utiliser les raccourcis clavier vicidial.php. + +
+
+
+Choix des Ingroups -<\/B> Cette option, si elle est mise à 1 autorise l'utilisateur à choisir les ingroups depuis lesquels il recevra des appels quand il est connecté dans une campagne de type CLOSER ou ENTRANT sinon le manager devra le définir dans l'écran de détails de l'utiliseur sur la page d'amiministration. + +
+
+
+Rappels programmés - Cette option autorise un agent à statuer un appel comme CALLBK et à choisir une date et une heure à laquelle la fiche sera réactivée. + +
+
+
+Rappel Agent-Seulement - Cette option autorise un agent à assigner un rappel pour lequel il sera le seul a pouvoir rappeler le client. Cela autorise aussi l'agent à voir sa liste de rappel quand il le désire. + +
+
+
+Appel manuel pour l'agent- Cette option autorise un agent à entrer manuellement une nouvelle fiche et à l'appeler. Elle autorise aussi l'appel de n'importe quel numéro de téléphone depuis vicidial et met cette appel dans sa session. Utilisez cette option avec précaution. + +
+
+
+Enregistrement vicidial - Cette otpion peut empêcher un agent de faire un enregistrement après qu'il se soit connecté à vicidial. Cette option doit être activée pour que vicidial suive la session d'enregistrement de la campagne. + +
+
+
+Transferts Vicidial - Cette option peut empêcher un agent d'ouvrir un transfert - conférence dans vicidial. Si c'est desactivé, l'agent ne pourra pas appeler une tierce personne ou transferer l'appel. + + 0) + { + ?> +
+
+
+ Closer Default Blended -<\/B> Cette option coche simplement par défaut la checbox Blended sur un écran de connection d'une campagne de type CLOSER. + + +
+
+
+Ecrasement de l'enregistrement de VICIDIAL - Cette option va écraser l'option d'enregistrement de la campagne quelle qu'elle soit. DISABLED n'écrasera pas les réglages d'enregistrement de la campagne. NEVER désactivera l'enregistrement sur le client. ONDEMAND est la valeur par défaut et autorise l'agent à démarrer ou arrêter l'enregistrement si nécessaire. ALLCALLS démarrera l'enregistrment à chaque fois qu'un appel est passé à un agent. ALLFORCE démarrera l'enregistrement à chaque fois qu'un appel à un agent est passé sans permettre à l'agent d'arrêter l'enregistrement. Pour les valeurs ALLCALLS et ALLFORCE il possible d'utiliser l'option 'Délai d'enregistrement' pour réduire la taille des enregistrments et la charge du système. + +
+
+
+Agent de l'exécution Shift Override - Ce paramètre remplace les utilisateurs quel que soit le groupe d'utilisateurs a mis en application de la loi pour Maj. HANDICAPES utilise l'utilisateur groupe. OFF ne fera pas appliquer à tous les changements. START ne faire respecter les temps de connexion, mais n'aura pas d'incidence sur un agent qui est en cours d'exécution sur leurs heures de travail si elles sont déjà logged in ALL appliquent passer l'heure de début et se connecter à un agent, après, ils courent sur la fin de leur quart de temps. La valeur par défaut est désactivé. + +
+
+
+Alerte Activé - Ce champ indique si l'agent est le navigateur Web des alertes lorsque les appels ont permis de venir dans leur vicidial.php session. La valeur par défaut est 0 pour les NO. + +
+
+
+La campagne se range - dans cette section vous pouvez définir le rangque un agent aura pour chaque campagne. Ces rangs peuvent êtreemployés pour tenir compte du cheminement préféré d'appel quand leprochain appel d'agent est placé au campaign_rank. Également dans cette section sont le WEB VAR pour chaque campagne. Il s'agit de permettre à chaque agent d'avoir une autre variable de chaîne qui peuvent être ajoutés à la fiche de Web ou SCRIPT onglet URL, simplement en mettant - A - web_vars - B - comme vous le mettre dans tout autre domaine. + +
+
+
+Groupes entrants - C'est ici que vous selectionnez les groupes entrants depuis lesquels vous voulez recevoir des appels si vous avez selectionné une campagne de type CLOSER. Vous pourrez également placer le rang, ou le niveau de compétence,dans cette section pour chacun des groupes d'arrivée aussi bien quepouvoir voir le nombre d'appels reçus de chaque groupe d'arrivéepour cet agent spécifique. En outre dans cette section est la capacité de donner à l'agent unrang pour chaque groupe d'arrivée. Ces rangs peuvent être employéspour le cheminement préféré d'appel quand cette option est choisiedans l'écran de dans-groupe. Également dans cette section sont le WEB VAR pour chaque campagne. Il s'agit de permettre à chaque agent d'avoir une autre variable de chaîne qui peuvent être ajoutés à la fiche de Web ou SCRIPT onglet URL, simplement en mettant - A - web_vars - B - comme vous le mettre dans tout autre domaine. + +
+
+
+Modifications des données des clients pour l'agent - Cette option permet de surcharger, pour un agent précis, l'option de la campagne concernant la modification des données du clients. NOT_ACTIVE utilisera la valeur présente dans l'option de la campagne. ALLOW_ALTER autorisera toujours à cet agent de modifier les données du client quelque soit la valeur de l'option dans la campagne. La valeur par défaut est NOT_ACTIVE. + +
+
+
+Alter Agent Client Téléphone Override - Cette option va remplacer ce que l'option est dans la campagne pour modifier le numéro de téléphone du client. NOT_ACTIVE va utiliser quel que soit l'établissement est présent pour la campagne. ALLOW_ALTER toujours de permettre à l'agent de modifier le numéro de téléphone des clients, quel que soit le réglage de la campagne. La valeur par défaut est NOT_ACTIVE. + +
+
+
+Modifier les options de l'interface agent - Cette option, si elle est à 1, autorise l'utilisateur administrateur à modifier les otpions de l'interface Agent dans admin.php. + +
+
+
+Effacer des utilisateurs - Cette option et mise à 1 pour autoriser l'utilisateur à effacer d'autres utilisateurs qui ont un niveau inférieur ou égal depuis le système. + +
+
+
+Supprimer des groupes d'utilisateurs - Cette option et mise à 1 pour autoriser l'utilisateur à effacer les groupes d'utilisateurs depuis le système. + +
+
+
+Supprimer des listes - Cette option et mise à 1 pour autoriser l'utilisateur à effacer des listes depuis le système. + +
+
+
+Supprimer des campagnes - Cette option et mise à 1 pour autoriser l'utilisateur à effacer des campagnes vicidial depuis le système. + +
+
+
+Supprimer des In-groups - Cette option et mise à 1 pour autoriser l'utilisateur à effacer des In-groups vicidial depuis le système. + +
+
+
+Supprimer des agents distants - Cette option et mise à 1 pour autoriser l'utilisateur à effacer des agents distants vicidial depuis le système. + + 0) + { + ?> +
+
+
+ Charger des fiches - Cette option et mise à 1 pour autoriser l'utilisateur à charger des fiches dans la table vicidial_list en utilisant le chargeur de fiches web. + + +
+
+
+Détails de la campagne- Cette option et mise à 1 pour autoriser l'utilisateur à voir et modifier les éléments de l'écran de details de la campagne. + +
+
+
+Accès administrateur AGC - Cette option et mise à 1 pour autoriser l'utilisateur à se connecter aux pages d'administration de astGUIclient. + +
+
+
+Supprimer des téléphones AGC - Cette option est mise à 1 pour autoriser l'utilisateur à effacer des téléphones dans les pages d'aministration d'astGUIclient. + +
+
+
+Supprimer des scripts - Cette option si elle est mise à 1 autorise l'utilisateur à supprimer des scripts de campagne dans l'écran de modification du script. + +
+
+
+Modifier les fiches - Si cette otpion est à 1 elle autorise l'utilisateur à modifier les fiches dans la page des résultats de la recherche de fiches dans la section d'administration. + +
+
+
+Changer l'agent de campagne - Cette option, si elle est mise à 1, permet à l'utilisateur de changer la campagne dans laquelle est connecté un agent alors qu'il y est connecté. + + 0) + { + ?> +
+
+
+ Supprimer des filtres - Cette option autorise l'utilisateur à supprimer les filtres de fiches du système. + + +
+
+
+Suppression des périodes d'appels -<\/B> Cette option permet à l'utilisateur de supprimer les enregistrements des périodes d'appels vicidial et les enregistrement des périodes d'appels d'état de ce système. + +
+
+
+Modification des périodes d'appels -<\/B> Cette option autorise l'utilisateur à voir et modifier les périodes d'appels et les périodes d'appels d'état. Un utilisateur n'a pas besoin de cette option si il a seulement besoin de changer les options des périodes d'appels sur l'écran de campagne. + +
+
+
+Modifications des sections - Cette option autorise l'utilisateur à voir et modifier chaque enregistrement de section. Si cette option a pour valeur 0, l'utilisateur pourra voir la liste des sections, mais pas le détail et ne pourra pas modifier les enregistrements dans cette section. + +
+
+
+Voir les rapports - Cette option autorise l'utilisateur à voir les rapports VICIDIAL. + + 0) + { + ?> +
+
+
+ QC Activé - Cette option permet à l'utilisateur de se connecter à l'agent de contrôle de la qualité d'écran. + +
+
+
+ QC Niveau de l'utilisateur - Ce paramètre définit ce que l'agent de contrôle de la qualité est au niveau utilisateur. Ce qui déterminera le niveau de fonctionnalité de l'agent dans la section QC:
+ 1 - Rien Modifier
+ 2 - Modifier Rien Sauf Etat
+ 3 - Modifier tous les Domaines
+ 4 - Vérifiez Premier Cycle de QC
+ 5 - Voir QC Statistiques
+ 6 - Possibilité de modifier fini records
+ 7 - Level Manager
+ +
+
+
+ Record QC Pass - Cette option permet à l'agent de préciser que le dossier a franchi le premier tour de Québec, après avoir examiné le dossier. + +
+
+
+ Record QC Finish - Cette option permet à l'agent de préciser que le dossier a terminé la deuxième ronde de Québec après avoir examiné le dossier transmis. + +
+
+
+ Record QC Commit - Cette option permet à l'agent de préciser que le record a été commise dans QC. Il ne peut plus être modifié par n'importe qui. + + +
+
+
+Ajouter Log timeclock Record - Cette option permet à l'utilisateur d'ajouter des enregistrements à l'timeclock journal. + +
+
+
+Modifier timeclock Connexion Record - Cette option permet à l'utilisateur de modifier des enregistrements dans le journal timeclock. + +
+
+
+Supprimer timeclock Connexion Record - Cette option permet à l'utilisateur de supprimer des enregistrements dans les journaux timeclock. + +
+
+
+Agent API d'accès - Cette option permet le compte à utiliser avec l'agent VICIDIAL commandes API. + +
+
+
+Shift Manager exécution Override - Ce paramètre, s'il est à 1 permettra d'entrer dans un gestionnaire d'utilisateur et leur mot de passe sur l'écran d'un agent pour l'emporter sur l'évolution des restrictions sur un agent de la session si l'agent essaie de se connecter à l'extérieur de leur quart de travail. La valeur par défaut est 0. + +
+
+
+Download Listes - Ce paramètre, s'il est à 1 permet à un gestionnaire de téléchargement, cliquez sur le lien de la liste au bas de l'écran de modification d'une liste d'exporter la totalité du contenu d'une liste de données à un fichier plat. La valeur par défaut est 0. + +
+
+
+Rapports d'exportation - Ce paramètre, s'il est à 1 permettra d'accéder à un gestionnaire de l'exportation des rapports sur l'appel RAPPORTS écran. La valeur par défaut est 0. Pour le rapport invite l'exportation, l'ordre suivant est utilisé pour les exportations:
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 + + + + + + +



+ +VICIDIAL_CAMPAGNES TABLE

+
+
+ID de la campagne - C'est un nom court pour la campagne, il n'est pas modifiable après validation, il ne peut contenir d'espaces et doit contenir entre 2 et 8 caractèresh. + +
+
+
+Nom de la campagne - C'est la description de la campagne, elle doit contenir entre 6 et 40 caractères. + +
+
+
+Description de la campagne - C'est un champ de note pour la campagne, il est optionel et ne peut contenir plus de 255 caractères. + +
+
+
+Date de changement de la campagne - C'est la dernière fois que les réglages de la campagne ont été modifié. + +
+
+
+Date de la dernière connection à la campagne - C'est la dernière fois qu'un agent s'est connecté à la campagne. + +
+
+
+Rafraichissement des statistiques de la campagne - Cette checkbox permet de forcer un rafraichissement des statistiques de vicidial, même si la campagne n'est pas active. + +
+
+
+Active - C'est ici que vous indiquez si la campagne est active ou non. Si elle est inactive personne ne peut se connecter à cette campagne. + +
+
+
+Extension de mise en attente- C'est ici que vous pouvez personnaliser la musique d'attente pour VICIDIAL. Assurez vous que l'extension est en place dans le fichier extension.conf et qu'elle pointe sur le fichier suivant. + +
+
+
+Fichier de mise en attente- C'est ici que vous pouvez personnaliser la musique d'attente pour VICIDIAL. Assurez vous que le nom du fichier fasse moins de 10 caractères et qu'il soit bien en place dans le répertoire /var/lib/asterisk/sounds. + +
+
+
+Formulaire Web - C'est ici que que vous pouvez mettre une page web personnalisée qui sera ouverte quand l'utilisateur cliquera sur le bouton FORMULAIRE WEB. Pour personnaliser la chaîne de requête, après le formulaire Web, il suffit de commencer avec le formulaire web, VAR et puis l'URL que vous voulez utiliser, en remplaçant les variables avec les noms des variables que vous voulez utiliser - A - phone_number - B -- comme dans l'onglet SCRIPTS. + +
+
+
+Formulaire Web Public- C'est là que vous pouvez définir la page Web personnalisée cadre que le formulaire web sera ouverte lorsque l'utilisateur clique sur le bouton de formulaire Web. La valeur par défaut est _blank. + +
+
+
+Autoriser les Closers - C'est ici que vous pouvez définir si les utilisateurs de cette campagne pouront envoyer l'appel vers une campagne de type closer. + +
+
+
+Groupe de transfert de défaut - ce champ est le Dans-Groupe dedéfaut qui sera automatiquement choisi quand l'agent va à l'armaturede transférer-conférence dans leur interface d'agent. + +
+
+
+Groupes laissés de transfert - avec ces listes de checkbox vouspouvez choisir les groupes aux lesquels les agents dans cette campagnepeuvent transférer des appels. Permettez Closers doit être permispour que cette option révèle. + + 0) + { + ?> +
+
+
+ Permettez d'arrivée et mélangé - c'est où vous pouvez placer siles utilisateurs de cette campagne auront l'option pour prendre desappels d'arrivée avec cette campagne. Si vous voulez faire d'arrivéeet en partance mélangés puis ceci doit être placé à Y. Si vousvoulez seulement faire composer en partance sur cette campagne placiezceci à N. Default est N. + +
+
+
+ Statut de l'appel -<\/B> C'est ici que vous indiquez les statuts que vous voulez appeler dans les listes actives pour la campagne suivante. Pour ajouter un autre statut d'appel, selectionnez le dans la liste déroulante et cliquez sur AJOUTER. Pour supprimer un de ces statuts, cliquez sur le lien SUPPRIMER à côté du statut que vous voulez supprimer. + +
+
+
+ Ordre de la liste - C'est dans ce menu que vous selectionnez comment les fiches qui correspondent aux statuts selectionnés ci-dessus seront mises dans le distributeur de fiches: +
  - DOWN: selectionne les premières fiches chargées dans la table vicidial_list +
  - UP: selectionne les dernières fiches chargées dans la table vicidial_list +
  - UP PHONE: selectionne le plus grand numéro de téléphone et continue vers le bas +
  - DOWN PHONE: selectionne le plus petit numéro de téléphone et continue vers le haut +
  - UP LAST NAME: commence avec les noms commençant pas Z et continue vers le bas +
  - DOWN LAST NAME: commence avec les noms commençant par A et continue vers le haut +
  - UP COUNT: commence avec les fiches les plus appelées et continue en descendant +
  - DOWN COUNT: commence avec les fiches les moins appelées et continue en augmentant +
  - DOWN COUNT 2nd NEW: commence avec les fiches les moins appelées et continue en montant en insérant une fiche NEW à chaque autre fiche - Ne doit PAS avoir NEW selectionné dans les statuts d'appel +
  - DOWN COUNT 3nd NEW: commence avec les fiches les moins appelées et continue en augmentant en insérant une fiche NEW toutes les 3 fiches - Ne doit PAS avoir NEW selectionné dans les statuts d'appel +
  - DOWN COUNT 4th NEW: commence avec les fiches les moins appelées et continue en augmentant en insérant une fiche NEW toutes les 4 fiches - Ne doit PAS avoir NEW selectionné dans les statuts d'appel + +
+
+
+ Niveau du distributeur - C'est le nombre de fiches que le script VDhopper essaye de garder dans la table vicidial_hopper pour cette campagne. Si l'on lance le script VDhopper chaque minute, mettez juste au dessus du nombre de fiches que vous voulez traiter par minute. + +
+
+
+ Filtre de fiches - C'est une méthode de filtrage de vos fiches utilisant un fragment de requête SQL. Utilisez cette fonction avec précaution, il est facile de stoper une comunication accidentellement avec le plus petit changement du statement SQL. La valeur par défaut est NONE. + +
+
+
+ Forcer la réinitialisation du distributeur - Cela vous autorise à éliminer le contenu du distributeur depuis un formulaire de validation. Il devrait être rempli une nouvelle fois quand le quand VDhopper se lance. + +
+
+
+ Méthode d'appel - Ce champ permet de définir la façon dont sont passés les appels. Si c'est MANUAL alors le auto_dial_level sera bloqué à 0 à moins que le méthode d'appel ne change. 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 Niveau de l'appel automatique if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode. ENTRANT_MAN permet à l'agent de mise manuel composer des appels de la liste d'une campagne tout en étant en mesure de prendre des appels entrants entre le manuel de composer des appels. + +
+
+
+ Niveau de l'appel automatique - C'est ici que vous mettez combien de lignes VICIDIAL devrait utiliser par agent. 0 veut dire que l'appel automatique est désactivé et que l'agent doit cliquer pour appeler chaque numéro. Autrement VICIDIAL maintiendra le nombre de lignes égale au nombre d'agents actifs multiplié par le niveau de l'appel automatique pour arriver au nombres de lignes que cette campagne devrait permettre sur chaque serveur . La checkbox ADAPTER LE DEPASSEMENT vous permet de forcer un nouveau niveau d'appel même si la méthode d'appel est ADAPT. C'est utile s'il y a une variation dramatique dans la qualité des fiches et que vous voulez changer rigoureusement le dial_level manuellement. + +
+
+
+ Valable seulement pour les contrôles - Si ce champ est à Y les agents ayant pour statut INCALL ou QUEUE seront omis pour le calcul des appels à passer quand le mode d'appel n'est pas MANUAL. La valeur par défaut est N. + +
+
+
+ Pourcentage limite d'abandon - Ce champ permet de définir le pourcentage limite d'appels abandonnés voulu lors de l'utilisation de méthode d'appel adaptive-predictive, pas MANUAL ni RATIO. + +
+
+
+ Niveau maximum d'adaptation d'appel - Ce champ permet de définir la limite du nombre de lignes que vous voulez composer par agent lors de l'utilisation d'une méthode d'appel adaptive-predictive, pas MANUAL ni RATIO. Ce nombre peut être plus grand que le Niveau de l'appel automatique de votre matériel ci celui-ci le supporte. La valeur doit être un nombre positif plus grand que 1 qui peut être décimal. La valeur par défaut est 3.0. + +
+
+
+ Heure maximum du serveur - Ce champ est seulement utilisé par la méthode d'appel ADAPT_TAPERED. Vous devez y saisir l'heure à laquelle vous allez arrêter d'appeler pour cette campagne, 2100 veut dire que vous arrêterez d'appeler pour cette campagne à 21h00. Cela autorise l'algorithme Tapered de décider comment appeler agressivement en fonction du temps restant avant d'arrêter d'appeler. + +
+
+
+ Adapter le modifieur d'intensité -<\/B> Ce champ est utilisé pour ajuster l'intensité prédictive à la fois plus haut ou plus bas. Plus vous selectionnez un nombre positif grand, plus l'appeleur augmentera considérablement l'appel quand il monte et plus l'appeleur dimunera lentement l'appel quand il descend. Plus le chiffre négatif que vous selectionnez est petit, plus l'appeleur augmentera lentement l'appel et plus l'appeleur diminuera rapidement l'appel quand il descend. La valeur par défaut est 0. Ce champ n'est pas utilisé par les méthodes d'appels MANUAL et RATIO. + +
+
+
+ Différence cible du niveau d'appel -<\/B> Ce champ est utilisé pour définir quel nombre spécifique d'agents vous désiser avoir en attente d'appels ou d'appels en attente d'agents. Par exemple, si vous voulez avoir toujours en moyenne un agent de libre pour prendre des appels immediatement vous devriez mettre ceci à -1, si vous ciblez d'avoir un appel gardé en attente d'un agent vous devriez mettre ceci à 1. La valeur par default est 0. Ce champ n'est pas utilisé par les méthodes d'appels MANUAL et RATIO. + +
+
+
+ Transferts concurents - Ce champ permet de définir le nombre d'appels qui peuvent être envoyés à un agent simultanément. Il est recommandé de laisser AUTO. Le champ n'est pas utilisé si la méthode est MANUAL. + +
+
+
+ File d'attente de priorité - Ce paramètre est utilisé pour définir l'ordre dans lequel les appels sortants à partir de cette campagne devrait être répondu en ce qui concerne les appels entrants si cette campagne est en mode mixte. + +
+
+
+ Appeler automatiquement le numéro alternatif - Ce champ est utilisé pour appeler automatiquement le numéro alternatif si les méthodes d'appels RATIO ou ADAPT sont utilisées quand il n'y pas de réponse au numéro de téléphone principale d'une fiche, les statuts NA, B, DC et N. Cette option n'est pas utilisée pour la méthode d'appel MANUAL. EXTENDED suppléant nombres sont des nombres dans le système en dehors de la norme de l'écran principal de l'information. L'aide de vous pouvez avoir des centaines de numéros de téléphone pour un seul client record. + +
+
+
+ Délai d'appel -<\/B> Si défini, les appels qui seraient normalement raccrochés après le délai défini dans extensions.conf le seront après ce nombre de secondes si c'est moins que le délai dans extensions.conf. Cela autorise des délais de changement d'appel rapide de serveur à serveur et limite les effets à une simple campagne. Si vous avez beaucoup de répondeur et de boîte vocales, vous devriez essayer de mettre une valeur entre 21 et 26 et voir si les résultats s'améliorent. + +
+
+
+ Campagne VDAD extension - Ce champ permet une coutume VDAD transfert extension. Cela vous permet d'utiliser différentes méthodes de traitement des appels en fonction de votre campagne. +- 8364 - même que 8368 +- 8365 - Will seulement envoyer l'appel à un agent sur le même serveur que l'appel est en +- 8366 - Occasions-1 pour la presse et campagnes de sondage +- 8367 - Le premier à essayer d'envoyer l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on +- 8369 - Occasions de Answering Machine de détection après que, même comportement que 8368 +- 8373 - Occasions de Answering Machine de détection après cette même comportement que 8366 + +
+
+
+ Message de répondeur - Entrez dans ce champ l'extension pour tranferer aveuglement des appels pour quand l'agent tombe sur un répondeur et qu'il clique sur le bouton Message de répondeur dans la fenêtre de transfert de conférence. Vous devez placer cet exten dans le Dial Plan - extensions.conf - et vous assurer qu'il joue un fichier audio puis raccroche. + +
+
+
+ AMD envoyé au vm exten -<\/B> Ce menu vous permet de définir si un message est laissé sur un répondeur quand il est détecté. L'appel sera immédiatement transmis à l'extention Answering-Machine-Message si AMD est actif et si il est déterminé que l'appel est un répondeur. + +
+
+
+ CPD AMD Action - Si vous utilisez le Sangoma ParaXip Call Progress logiciel de détection, vous souhaitez activer ce paramètre, soit la mise à disposition DISPO qui l'appel comme AA et l'accrocher si l'appel est en cours de traitement et n'a pas été envoyée à un agent ou encore MESSAGE qui enverra l'appel à la définition Message de répondeur pour cette campagne. La valeur par défaut est DISABLED. + +
+
+
+ Appel du numéro alternatif pour l'agent - Cette option permet à l'agent d'appeler le numéro de téléphone alternatif ou le champ adresse3 après que le numéro de téléphone principal ait été appelé. + +
+
+
+ Secondes avant abandon de l'appel -<\/B> C'est le nombre de secondes depuis le moment où la ligne du client est prise jusqu'à ce que l'appel soit considéré comme abandonné, s'applique seulement aux appels sortants. + +
+
+
+ Drop Action - Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Inbound groupe qui est défini ci-dessous + +
+
+
+ Extension du port sûr -<\/B> C'est l'extension du dial plan où le fichier audio désiré est localisé sur le serveur. + +
+
+
+ Boîte vocale - Si elle est définie, les appels qui sont normalement abandonné seront redirigés vers une boîte vocale pour écouter et laisser un message. + +
+
+
+ Drop de transfert Group - Si Drop action est fixée à IN_GROUP, l'appel sera envoyé à ce groupe d'arrivée si elle parvient Temps avant abandon de l'appel. + +
+
+
+ Autoriser la connection aux distributeurs de fiches vides - Si défini à Y, autorise les agents à se connecter à la campagne même si il n'y a pas de fiches chargées dans le distributeur pour cette campagne. Cette fonction est nécessaire pour les campagne de type CLOSER. La valeur par défaut est N. + +
+
+
+ Mélange d'ordre de liste - dépasse les champs d'ordre de fil et destatut de cadran. Emploiera les paramètres de liste et de statut pourl'entrée choisie de mélange de liste dans la section de sous-marinde mélange de liste à la place. Le défaut est HANDICAPÉ. + +
+
+
+ Identification de mélange de liste - identification du mélange deliste. Doit être de 2-20 caractères de longueur sans les espaces outoute autre ponctuation spéciale. + +
+
+
+ Nom de mélange de liste - nom descriptif du mélange de liste. Doitêtre de 2-50 caractères de longueur. + +
+
+
+ Détail de mélange de liste - la composition de l'entrée de mélangede liste. Contient l'identification de liste, l'ordre de mélange, lespourcentages et les statuts qui composent ce mélange de liste. Lespourcentages toujours doivent additionner jusqu'à 100, et toutes leslistes doivent être en activité et réglées à la campagne pour quel'entrée de mélange d'ordre soit activée. + +
+
+
+ Méthode de mélange de liste - la méthode de mélanger toutes lesparties du détail de mélange de liste ensemble. EVEN_MIX mélangerades fils de chaque partie intercalée aux autres parties, comme ces1.2.3.1.2.3.1.2.3. IN_ORDER mettra les fils dans l'ordre dans lequelils sont énumérés dans l'écran 1.1.1.2.2.2.3.3.3 de détail demélange de liste. La volonté ALÉATOIRE les a mis dans l'ordreALÉATOIRE 1.3.2.1.1.3.2.1.3. Le défaut est IN_ORDER. + +
+
+
+ Agent Screen Extended Alt Dial - Cette fonction permet aux agents d'accéder à des numéros de téléphone suppléant étendue des pistes au-delà de l'Alt Address3 de téléphone et les champs qui peuvent être utilisés dans VICIDIAL de numéros de téléphone au-delà du numéro de téléphone principal. L'étendue des numéros de téléphone peut être composé automatiquement en utilisant la fonction Auto-Alt-Dial VICIDIAL dans les paramètres de campagne, mais l'activation de cette fonctionnalité, agent d'écran permettra également l'agent d'appeler ces numéros à partir de l'écran de leur mandataire, ainsi que de modifier leurs informations. + +
+
+
+ Première Enquête Audio File - Il s'agit du nom de fichier audio qui se joue dès que le client choisit le téléphone lors de l'exécution d'une étude campagne. + +
+
+
+ Enquête DTMF Digits - Ce domaine est l'endroit où vous définissez les chiffres que le client peut presse comme une option sur une campagne de sondage. valable chiffres DTMF sont0123456789*# + +
+
+
+ Enquête Non Intéressé Digit - Ce domaine est l'endroit où vous définissez le client pressé chiffres qui montrent qu'ils ne sont pas intéressés. + +
+
+
+ Enquête Non Intéressé Etat - Ce domaine est l'endroit où vous choisissez le statut d'être utilisé pour pas intéressé. S'il est utilisé DNC et la campagne est défini pour utiliser DNC ensuite le numéro de téléphone sera automatiquement ajouté à la liste DNC VICIDIAL interne.et, éventuellement, la campagne de la liste des DNC. + +
+
+
+ Enquête sur Opt-in Audio File - Il s'agit du nom de fichier audio qui se joue lorsque le client a opté dans l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à optout. Après ce fichier audio est joué, le sondage de l'action ne soit prise. + +
+
+
+ Enquête Non Intéressé Audio File - Il s'agit du nom de fichier audio qui se joue lorsque le client a choisi de l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à OptIn. Après ce fichier audio est joué, l'appel sera suspendu jusqu'à. + +
+
+
+ Enquête sur la méthode - Cette option permet de définir ce qui se passe à un appel après que le client a opté en. AGENT_XFER enverra l'appel à la prochaine agent. MESSAGERIE VOCALE envoie l'appel à la boîte vocale qui est spécifié dans la boîte vocale domaine. EXTENSION envoie le client à l'extension définie dans le Enquête Xfer Extension domaine. Hangup se raccrocher le client. CAMPREC_60_WAV enverra au client d'avoir un enregistrement réalisé avec leur réponse, cet enregistrement sera placé dans un dossier nommé comme la campagne de l'intérieur de l'Enquête sur la campagne d'enregistrement Directory. + +
+
+
+ Etude de non-réponse de l'action - C'est là que vous définissez ce qui se passera s'il n'y a pas de réponse à la question de sondage. OptIn ne envoyer l'appel à la méthode d'enquête, si le client en pressant une chiffres DTMF. OptOut envoie le client sur la méthode d'enquête, même si elles ne sont pas sur un chiffre DTMF. + +
+
+
+ Enquête Réponse Digit Map - Il s'agit de la section où vous pouvez définir une description pour aller avec chaque option DTMF chiffres que le client mai sélectionner. + +
+
+
+ Enquête Xfer Extension - Si la méthode d'enquête de l'extension est sélectionné, le client appel sera dirigé vers cette extension dialplan. + +
+
+
+ Enquête sur la campagne d'enregistrement - Annuaire Si la méthode d'enquête de CAMPREC_60_WAV est sélectionné, le service à la clientèle sera enregistré et placé dans un répertoire nommé d'après la campagne de l'intérieur de ce répertoire. + + + +
+
+
+Appel de l'agent suivant - Cela determine quel agent recevra l'appel suivant quand c'est possible: +
  - random: ordonne par la valeur aléatoire de mise à jour dans la table vicidial_live_agents +
  - oldest_call_start: ordonne par la dernière date à laquelle un agent a passé un appel. Résultats des agents recevant globalement un nombre à peu près identique d'appels . +
  - oldest_call_finish: ordonne suivant la dernière date à laquelle un agent a terminé un appel. L'agent AKA attendant le plus longtemps reçoit le premier appel. +
  - overall_user_level: ordonne par le user_level de l'agent comme défini dans la table vicidial_users, un user_level plus élévé recevra plus d'appels. +
  - campaign_rank : ordres par le rang donné à l'agent pour la campagne.Le plus haut à le plus bas. +
  - fewest_calls : ordres par le nombre d'appels reçus par un agent pource groupe d'arrivée spécifique. Moindres appels d'abord. + +
+
+
+Temps d'appel local -<\/B> C'est ici que vous indiquez pendant quelles heures vous voulez appeler, comme déterminé par l'heure locale dans la région dans laquelle vous voulez appeler. C'est controlé par le code de la région et est ajusté pendant le temps des Daylight Savings si c'est approprié. Les habitudes générales aux Etat-Unis, de Buisness à Buisness, sont de 9h00 à 17h00 et de Buisness à particulier de 9h00 à 21h00. + +
+
+
+Préfixe d'appel - Ce champ autorise plus facilement à changer un chemin d'appel vers l'exterieur à travers une méthode differente sans devoir recharger Asterisk. La valeur par défaut 9 est basée sur 91NXXNXXXXXX dans le dial plan du fichier extensions.conf . + +
+
+
+Omettre le Phone Code - Ce champ permet de ne pas utiliser le champ phone_code lors d'appels passés depuis VICIDIAL. Par exemple si vous appelez de France vers la France vous devriez avoir 33 dans le champ phone_code de chaque fiche, mais vous voulez utiliser 10 chiffres dans le dial plan extensions.conf au lieu de 33 puis 10 chiffres. La valeur par défaut est N. + +
+
+
+CallerID de la campagne - Ce champ autorise à envoyer un numéro de callerId personnalisé sur les appels sortants. C'est le numéro de callerId que vous voullez montrer à la personne que vous appellez. La valeur par défaut est UNKNOW. Si vous utilisez des T1 ou E1s pour appeler vers l'extérieur cette option est seulement valable si vous utilisez des PRIs - ISDN T1s ou E1s - qui ont la fonction CallerId personnalisable activée, cela ne fonctionne pas avec le service Robbed-bit et les circuits -RBS-. Cela fonctionne aussi avec la plupart des fournisseurs VOIP -SIP ou trunks IAX- qui autorisent un callerId de sortie dynamique. Le callerID personnalisé ne s'applique qu'aux appels passés directement depuis la campagne VICIDIAL, n'importe quel appel avec une tierce personne ou transféré n'enverra pas le callerId personnalisé. NOTE: Parfois en mettant UNKWOWN ou PRIVATE dans ce champ c'est le callerId par défaut de votre ligne qui sera transmis pour les appels. Vous pouvez tester cela et mettre 0000000000 à la place dans le champs calleID si vous ne voulez pas envoyer votre CallerID. + +
+
+
+Extention d'enregistrement - Ce champs autorise à avoir une extension personnalisée d'enregistrement pour l'utiliser avec VICIDIAL. Cela autorise à utiliser différentes extensions selon le temps maximum d'enregistrement que vous voulez autoriser et le type de codec que vous voulez utiliser. L'exten par defaut est 8309 qui, si vous avez suivi les exemples de la SCRATCH_INSTALL, enregistrera dans le format WAV jusqu'à une heure. Une autre option incluse dans les exemples est 8310 qui enregistrera dans le format GSM jusqu'à une heure. + +
+
+
+Enregistrement de la campagne - Ce menu permet de choisir le niveau d'enregistrement autorisé pour cette campagne. NEVER désactive l'enregistrement sur l'application client. ONDEMAND est la valeur par défaut et permet à l'agent de démarrer et arrêter l'enregistrement si nécessaire. ALLCALLS démarrera l'enregistrement pour tous les appels passés vers un agent. ALLFORCE démarrera l'enregistrement à chaque appel passés vers un agent sans donné la possibilité à l'agent de stopper l'enregistrement. Pour ALLCALLS et ALLFORCE il y a une option pour utiliser un délai d'enregistrement afin de réduire les enregistrements et la charge système. + +
+
+
+Nom du fichier d'enregistrement de la campagne - Ce champs vous permet de personnaliser le nom de fichier pour l'enregistrement quand l'enregistrement de la campage est sur ONEDEMAND ou ALLCALLS. Les variables autorisées sont CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. La valeur par defaut est FULLDATE_AGENT et le nom du fichier ressemblerait à ceci : 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE ce qui ressemblerait à ceci : TESTCAMP_51020103108_3125551212 . 50 char max. + +
+
+
+Délai d'enregistrement - Uniquement pour les enregistrements ALLCALLS et ALLFORCE. Cette valeur est le nombre de secondes après lesquelles commence l'enregistrement des appels. La valeur par défaut est 0. + +
+
+
+Script campagne ->/B> Ce menu vous permet de choisir le script qui apparaîtra sur l'écran des agents pour cette campagne. Mettez NONE pour ne pas montrer de script pour cette campagne. + +
+
+
+Consigne de lancement d'appel - Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. + +
+
+
+DTMF pour le transfert de conférence -<\/B> Ces quatre champs vous permettent de définir deux préselection DTMF pour les transferts de conférences. Quand l'appel ou la campagne est chargée, le script vicidial.php montrera deux boutons dans la fenêtre transfert-conference et remplira automatiquement les champs numéro-à-appeler et envoyer-dtmf quand ils sont pressés. Si vous voulez autoriser les transferts de consultation, de fronter à closer, vous pouvez placer CXFER comme une des préselection du nombre-à-appeler et la chaîne d'appel approprié sera envoyé pour faire un tranfert de consultation locale, puis l'agent peu juste quitter l'appel à 3 ou continuer sur l'appel suivant. Si vous voulez autoriser les transferts à l'aveugle d'un client vers un script AGI VICIDIAL pour le log ou un IRV, placez AXFER dans le champ numéro-à-appeler. Vous pouvez aussi specifier une extention personnalisée après AXFER ou CXFER, par exemple si vous voulez faire un transfert de consultation interne à la place d'un local vous devriez mettre CXFER90009 dans le champ numéro à appelé. + +
+
+
+Rappels programmés - Cette option autorise un agent à statuer un appel comme CALLBK et à choisir une date et une heure à laquelle la fiche sera réactivée. + +
+
+
+Temps de conclusion -<\/B> Nombre de secondes pendant lesquelles l'agent est forcé à attendre avant de pouvoir recevoir ou passer un nouvel appel. Le timer commence dès que l'agent à raccrocher - ou dans le cas de l'appel du numéro alternatif quand l'agent à terminer la fiche - La valeur par défaut est 0. Si le timer se termine avant que l'agent n'ait statué l'appel, l'agent ne passera pas à l'appel suivant tant qu'il n'a pas sélectionné un statut. + +
+
+
+Message de conclusion -<\/B> C'est un message spécifique à la campagne à afficher si le temps de conclusion est défini. + +
+
+
+Utiliser la liste DNC interne - Cela défini si cette campagne doit filter les fiches par rapport à la liste DNC. Si ce champ est à Y alors le distributeur de fiches recherchera chaque numéro de téléphone dans la liste DNC avant de la placer dans le distributeur de fiches. Si il est dans la liste DNC alors le statut de la fiche sera changer en DNCL, il ne pour donc pas être appelé. La valeur par défaut est N. + +
+
+
+Utilisez Campagne DNC List - Cela définit si cette campagne est de filtrer les mène à une liste DNC qui est spécifique à cette campagne seulement. Si elle est définie à Y, la trémie sera, pour chaque numéro de téléphone dans la campagne des DNC avant de le placer dans la trémie. Si elle est dans la campagne des DNC liste, il va changer le statut qui conduisent à DNCC il ne peut donc pas être composé. La valeur par défaut est N. + +
+
+
+Groupes entrants autorisés - 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. + +
+
+
+Activer les codes de la pause des agents - Autorise les agents à sélectionner un code de pause quand il clique sur le bouton PAUSE dans vicidial.php. Les codes de pause sont définissable par campagne dans le bas de la vue détaillée de la campagne et sont stockés dans la table vicidial_agent_log. La valeur par défaut est N. Force va forcer les agents à choisir un code PAUSE si elles cliquez sur le bouton PAUSE. + +
+
+
+Désactiver la modification des données du client - Si défini à Y alors les données de la fiche d'un client ne sont pas modifiées quand un agent passe l'appel. La valeur pas défaut est N. + +
+
+
+Désactiver Alter clientèle Téléphone - Si la valeur de Y, ne modifie pas le client numéro de téléphone lors d'un agent dispositions de l'appel. La valeur par défaut est Y. + +
+
+
+Agent Afficher Queue Count - Si la valeur de Y, lorsque le client est en attente d'un agent, la file d'attente de demande d'affichage en haut de l'agent de l'écran devient rouge et indique le nombre d'appels en attente. Le défaut est Y. + +
+
+
+Identification manuelle de liste de cadran - le list_id de défaut àemployer quand des placces d'un agent un appel manuel et un nouveaudisque de fil est créés dans le vicidial_list. Le défaut est 999.Ce champ peut contenir des chiffres seulement. + +
+
+
+Manuelle Filter - Cela vous permet de filtrer les appels que les agents font en mode manuel composer pour cette campagne par une combinaison des éléments suivants: DNC - à coup sur, CAMPAIGNLISTES - le nombre doit être dans les listes pour la campagne, AUCUN - pas de filtre sur le cadran ou manuel rapide composer des listes. + +
+
+
+Agent de presse-papiers de copie d'écran - Cette fonctionnalité est actuellement disponible que pour Internet Explorer. Cette fonctionnalité vous permet de sélectionner un domaine qui sera copiée dans le presse-papiers de l'ordinateur de l'agent sur l'ordinateur d'un appel d'être envoyées à un agent. Commune utilise pour cela sont pour faciliter le collage de numéros de compte ou des numéros de téléphone en héritage les applications client à l'agent d'ordinateur. + +
+
+
+3-Way Outbound Call CallerID - Cela définit ce qui est envoyé en tant que sortant CallerID nombre de 3-way appels effectués par l'agent, la campagne utilise la campagne personnalisée CallerID, client utilise le numéro de client qui est actif sur les agents de l'écran et utilise les CallerID AGENT_PHONE le téléphone pour que l'agent est entré dans. AGENT_CHOOSE permet de choisir l'agent qui CallerID à utiliser pour les 3-way appels à partir d'une liste de choix. + +
+
+
+3-Way Call Préfixe de numérotation - Cela définit ce qui est utilisé comme préfixe pour les 3-way appels, par défaut est vide de sorte que la campagne de préfixe est utilisé, passthru afin que vous puissiez entendre sonner est de 88. + + 0) + { + ?> +
+
+
+ QC Activé - Mise en ce domaine permet à Y pour l'agent de contrôle de la qualité caractéristiques au travail. La valeur par défaut est N. + +
+
+
+ Statuts QC - Cette zone est l'endroit où vous choisissez ce qui entraîne des statuts doit être dépassé par le système de QC. Placez un contrôle à côté de l'état que vous voulez examiner QC. + +
+
+
+ QC Shift - Il s'agit du changement de calendrier utilisé pour tirer QC pour une campagne. Les jours de la semaine sont ignorées pour ces fonctions. + +
+
+
+ Record QC Get lancement Cela permet à l'une des actions suivantes peut être déclenché sur un agent QC recevoir un nouveau record. + +
+
+
+ QC Voir Recording - qui permet un enregistrement qui mai être liée à la QC record à afficher dans le QC agent écran. + +
+
+
+ QC WebForm Adresse - Il s'agit de l'adresse du site web d'un agent QC pouvez aller à en cliquant sur le lien dans la WebForm QC écran. + +
+
+
+ Script QC - C'est le script qui peut être utilisé par les agents QC SCRIPT dans l'onglet de la QC écran. + + +
+
+
+Recherche Catégorie Vtiger - Si Vtiger intégration est activé dans les paramètres du système puis de définir ce paramètre lorsque l'vtiger_search.php page de recherche pour le numéro de téléphone qui a été entré. Il ya 4 options qui peuvent être utilisés dans ce domaine: LEAD-Cette option de recherche par le biais du conduit Vtiger seulement, COMPTE-Cette option de recherche par le biais du Vtiger comptes et tous les contacts et les sous-contacts pour le numéro de téléphone, VENDOR-Cette option ne recherche que par l'intermédiaire du Vtiger fournisseurs, ACCTID-Cette option ne fonctionne que pour les comptes et il prendra les VICIDIAL vendor_lead_code terrain et essayer de chercher le numéro de compte Vtiger. En cas d'échec, il va essayer d'autres méthodes que la liste que vous avez sélectionné. Plusieurs options peuvent être utilisées pour chaque recherche, mais sur de grandes bases de données ce n'est pas recommandé. La valeur par défaut est LEAD. + +
+
+
+Vtiger Créer Call Record - Si Vtiger intégration est activé dans les paramètres du système puis de définir ce paramètre est de savoir si un nouveau record d'activité Vtiger est créé pour l'appel lorsque l'agent est à la vtiger_search page. La valeur par défaut est Y. + +
+
+
+Vtiger Créer Lead Record - Si Vtiger intégration est activé dans les paramètres système et Vtiger LEAD Recherche Catégorie comprend alors ce paramètre est de déterminer si un nouveau record Vtiger plomb est créé lorsque l'agent est à la page vtiger_search et il n'est pas ont trouvé à l'appel le numéro de téléphone. La valeur par défaut est Y. + +
+
+
+Vtiger Login Screen - Si Vtiger intégration est activé dans les paramètres de ce système de réglage de définir si l'utilisateur est connecté à l'interface Vtiger automatiquement lors de leur connexion à VICIDIAL. Le défaut est Y. + +
+
+
+Groupe Alias Admis - Si vous souhaitez permettre à vos agents d'utiliser les alias de groupe, vous devez mettre à Y. alias Groupe sont expliqués plus en section administrative, ils permettent de sélectionner différents agents callerIDs manuel pour les appels sortants qu'ils mai place. La valeur par défaut est N. + +
+
+
+Groupe par défaut Alias - Si vous avez permis à ce groupe Alias est l'alias du groupe qui est sélectionné en premier par défaut lorsque l'agent choisit d'utiliser un alias pour un groupe émetteur manuel appel. La valeur par défaut est None ou vide. + + + + + +



+ +VICIDIAL_LISTES TABLE

+
+
+ID de la liste - C'est le nom numérique de la liste, il n'est pas éditable après la première validation, il ne doit contenir que des nombres et contenir entre 2 et 8 caractères. Must be a number greater than 100. + +
+
+
+Nom de la liste - C'est la description de la liste, elle doit contenir entre 2 et 20 caractères. + +
+
+
+Description de la liste - C'est un champ de note pour la liste, il est optionnel. + +
+
+
+Dernier changement de la liste - C'est la dernière fois que les réglages de la liste ont été modifié. + +
+
+
+Date du dernier appel de la liste - C'est la dernière fois qu'une fiche de cette liste a été appelée. + +
+
+
+Campagne - C'est la campagne à laquelle cette liste appartient. Une liste ne peut etre appelée que depuis une seule campagne à la fois. + +
+
+
+Active - Cela définie si la liste peut etre appelée ou non. + +
+
+
+Réinisialiser le Lead-Called-Status pour cette liste - Cela réinitialise les fiches dans cette liste à N pour "not called since last reset" et signifie que n'importe quelle fiche peut maintenant être appelée si ce statut est défini dans l'écran de campagne. + +
+
+
+DNC VICIDIAL List - Do Not Call Cette liste contient tous les conduire qui a été fixé à un statut de DCN dans le système. Dans les listes - ADD NOMBRE DE DNC page que vous êtes en mesure d'ajouter manuellement les numéros de cette liste afin de ne pas être appelé par des campagnes qui utilisent la liste interne DNC. Il ya aussi la possibilité d'ajouter conduit à la campagne des listes DNC et pour les campagnes qui ont les. + + + +



+ +VICIDIAL_ENTRANT_GROUPS TABLE

+
+
+ID du groupe - C'est le nom court du group entrant, il n'est pas éditable après la première initialisation, il doit contenir entre 2 est 20 caractères. + +
+
+
+Nom du groupe - C'est la déscription du groupe, il doit contenir entre 2 et 30 caractères et ne doit pas contenir de tirets, de plus ou d'espaces . + +
+
+
+Couleur du groupe C'est la couleur que est affichée dans l'application cliente VICIDIAL quand un appel arrive dans ce groupe. Il doit contenir entre 2 et 7 caractères. Si c'est une couleur en hexadecimal vous devez mettre un # au début de la chaîne de caractères ou VICIDIAL ne fonctionnera pas proprement. + +
+
+
+Active - Cela détermine si ce groupe sera visible dans la boîte de sélection quand un agent se connecte à VICIDIAL. + +
+
+
+Formulaire Web - C'est l'adresse personnalisée qui, en cliquant sur le boutton WEB FORM dans VICIDIAL, sera prise pour les appels qui arrivent dans ce groupe. + +
+
+
+Appel de l'agent suivant - Cela determine quel agent recevra l'appel suivant quand c'est possible: +
  - random: ordonne par la valeur aléatoire de mise à jour dans la table vicidial_live_agents +
  - oldest_call_start: ordonne par la dernière date à laquelle un agent a passé un appel. Résultats des agents recevant globalement un nombre à peu près identique d'appels . +
  - oldest_call_finish: ordonne suivant la dernière date à laquelle un agent a terminé un appel. L'agent AKA attendant le plus longtemps reçoit le premier appel. +
  - overall_user_level: ordonne par le user_level de l'agent comme défini dans la table vicidial_users, un user_level plus élévé recevra plus d'appels. +
  - inbound_group_rank : ordres par le rang donné à l'agent pour legroupe d'arrivée spécifique. Le plus haut à le plus bas. +
  - fewest_calls : ordres par le nombre d'appels reçus par un agent pource groupe d'arrivée spécifique. Moindres appels d'abord. +
  - campaign_rank : ordres par le rang donné à l'agent pour la campagne.Le plus haut à le plus bas. +
  - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. +
+ +
+
+
+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. + +
+
+Affichage de l'enseigne -<\/B> Ce champ détermine si l'agent VICIDIAL sortant doit avoir l'enseigne - si il y en a une - affichée dans le champ Statut quand l'appel est passé à l'agent. + +
+
+
+Script campagne ->/B> Ce menu vous permet de choisir le script qui apparaîtra sur l'écran des agents pour cette campagne. Mettez NONE pour ne pas montrer de script pour cette campagne. + +
+
+
+Consigne de lancement d'appel - Ce menu vous permet de choisir si vous voulez lancer automatiquement la page de web-form dans une fenêtre séparée, passer automatiquement sur l'onglet de script ou ne rien faire quand un appel est envoyé par un agent dans cette campagne. + +
+
+
+DTMF pour le transfert de conférence -<\/B> Ces quatre champs vous permettent de définir deux préselection DTMF pour les transferts de conférences. Quand l'appel ou la campagne est chargée, le script vicidial.php montrera deux boutons dans la fenêtre transfert-conference et remplira automatiquement les champs numéro-à-appeler et envoyer-dtmf quand ils sont pressés. Si vous voulez autoriser les transferts de consultation, de fronter à closer, vous pouvez placer CXFER comme une des préselection du nombre-à-appeler et la chaîne d'appel approprié sera envoyé pour faire un tranfert de consultation locale, puis l'agent peu juste quitter l'appel à 3 ou continuer sur l'appel suivant. Si vous voulez autoriser les transferts à l'aveugle d'un client vers un script AGI VICIDIAL pour le log ou un IRV, placez AXFER dans le champ numéro-à-appeler. Vous pouvez aussi specifier une extention personnalisée après AXFER ou CXFER, par exemple si vous voulez faire un transfert de consultation interne à la place d'un local vous devriez mettre CXFER90009 dans le champ numéro à appelé. + +
+
+
+Temps avant abandon de l'appel - Le nombre de secondes d'un appel restera dans la file d'attente avant d'être considéré comme un DROP. + +
+
+
+Drop Action - Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Temps avant abandon de l'appel domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Inbound groupe qui est défini ci-dessous. + +
+
+
+Drop EXTEN - Si l'action est goutte d'MESSAGE, c'est le cadran plan d'extension que l'appel sera envoyée si elle parvient à Temps avant abandon de l'appel. + +
+
+
+Boîte vocale - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + +
+
+
+Drop de transfert Group - Si Drop action est fixée à IN_GROUP, l'appel sera envoyé à ce groupe d'arrivée si elle parvient Temps avant abandon de l'appel. + +
+
+
+Temps d'appel - c'est l'arrangement de temps d'appel à employer pource groupe d'arrivée. Maintenez dans l'esprit que le temps est basésur le temps de serveur. Le défaut est 24hours. + +
+
+
+Après les heures d'ouverture d'action - L'action à effectuer si c'est après les heures de travail tels que définis dans le temps de l'arrivée pour ce groupe. Hangup hangup immédiatement à l'appel, MESSASGE va jouer le fichier dans le message après les heures de Filenam domaine, EXTENSION envoie l'appel à la fois la durée d'extension de la dialplan et de la messagerie vocale vous envoyer l'appel à la boîte vocale figurant dans la boîte vocale après les heures de domaine , IN_GROUP enverra l'appel à l'arrivée du groupe sélectionné dans le groupe après les heures de sélectionner la liste de transfert. La valeur par défaut est MESSAGE. + +
+
+
+Après nom de fichier de message d'heures - le dossier audio localisésur le serveur à jouer si l'action est placée au MESSAGE. Le défautest VM-AU revoir + +
+
+
+Après prolongation d'heures - la prolongation dialplan pour envoyerl'appel si l'action est placée à la PROLONGATION. Le défaut est8300. + +
+
+
+Après des heures Boîte vocale - la boîte de voicemail pour envoyerl'appel si l'action est placée à VOICEMAIL. + +
+
+
+Après les heures d'ouverture de transfert Group - Si l'action Après les heures d'ouverture est fixée à IN_GROUP, l'appel sera envoyé à cette arrivée du groupe si celui-ci entre dans le groupe en dehors de l'appel de temps défini pour le régime de groupe. + +
+
+
+Nom de fichier bienvenu de message - le dossier audio localisé sur leserveur à jouer quand l'appel entre. Si ensemble à ---NONE --- alorsaucun message ne sera joué. Le défaut est ---NONE --- + +
+
+
+Message de bienvenue Play - Ces réglages choisir le moment de jouer le message de bienvenue défini, TOUJOURS jouera à chaque fois, JAMAIS il ne pourra jamais jouer, IF_WAIT_ONLY seulement jouer le message de bienvenue si l'appel n'est pas immédiatement à un agent , et YES_UNLESS_NODELAY toujours jouer le message de bienvenue NO_DELAY à moins que le paramètre est activé. La valeur par défaut est TOUJOURS. + +
+
+
+Musique sur le contexte de prise - la musique sur le contexte de prisepour employer quand le client est placé sur la prise. Le défaut estdéfaut. + +
+
+
+Sur le nom de fichier de message de sollicitation de prise - ledossier audio localisé sur le serveur à jouer à un intervallerégulier quand le client est sur la prise. Le défaut estgeneric_hold. Ce dossier audio DOIT être de 9 secondes ou moins dansla longueur. + +
+
+
+Sur l'intervalle de message de sollicitation de prise - la durée ensecondes d'attendre avant de jouer dessus le message de sollicitationde tenir. Le défaut est 60. Pour désactiver l'invite en attente, réglez l'intervalle de 0. + +
+
+
+Jouer en ligne Place - Cela définit si l'appelant entendra leur place dans la ligne quand ils entrent dans la file d'attente, ainsi que quand ils entendent le announcemend. La valeur par défaut est N. + +
+
+
+Hold estimée Play Time - Cela définit si l'appelant entend tenir les prévisions de temps avant qu'ils ne soient transférés à un agent. La valeur par défaut est N. + +
+
+
+Hold Time Option - Cela vous permet de spécifier le routage de l'appel, si les prévisions de tenir le temps est sur le montant de la seconde précisés ci-dessous. La valeur par défaut est NON. + +
+
+
+Hold Time Option secondes - Si Hold Time Option est fixé à rien, mais AUCUNE, c'est le nombre de secondes de l'estimation du temps que vous maintenez le déclencheur tenir option. La valeur par défaut est 360 secondes. + +
+
+
+Hold Time Option Extension - Si Hold Time Option est fixé à l'extension, c'est l'extension dialplan que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + +
+
+
+Hold Time Option Boîte vocale - Si Hold Time Option est fixé à la boîte vocale, il s'agit de la boîte vocale que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + +
+
+
+Hold Time Option de transfert In-Group - Si Hold Time Option est fixé à IN_GROUP, c'est l'arrivée du groupe que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds. + +
+
+
+Hold Time Option Callback Filename - Si Hold Time Option est fixé à CALLERID_CALLBACK, cette invite est le nom du fichier qui se joue avant l'appel est enregistré comme un nouveau chef de file de la liste ID spécifiées ci-dessous si l'estimation est supérieure à la fois tenir Hold Time Option Seconds. + +
+
+
+Hold Time Option Rappel Liste ID - Si Hold Time Option est fixé à CALLERID_CALLBACK, il s'agit de la liste de ID de l'appel est ajouté à un nouveau chef de file, si les prévisions de tenir le temps dépasse le Hold Time Option Seconds. + +
+
+
+Prolongation alerte d'agent - la prolongation à envoyer dans lasession d'agent pour annoncer qu'un appel vient à l'agent. Cetteprolongation devrait avoir un playback d'un dossier audio. Ne pasemployer cette fonction a placé ceci à X. Default est X. + +
+
+
+L'alerte d'agent Retardent - la durée en millisecondesd'attendre avant d'envoyer l'appel à l'agent après avoir jouédessus la prolongation alerte d'agent. Le défaut est 1000. + +
+
+
+Groupe de transfert de défaut - ce champ est le Dans-Groupe dedéfaut qui sera automatiquement choisi quand l'agent va à l'armaturede transférer-conférence dans leur interface d'agent. + +
+
+
+En groupe enregistrement Override - Ce champ permet d'primordial de la campagne d'appel enregistrement. Ce réglage peut être modifié par l'enregistrement de l'emporter sur la mise en vicidial_user. HANDICAPES ne remplacent pas la campagne de l'enregistrement programmé. JAMAIS désactive l'enregistrement sur le client. OnDemand est l'option par défaut et permet à l'agent de début et de fin d'enregistrement en tant que de besoin. ALLCALLS va commencer l'enregistrement sur le client chaque fois qu'un appel est adressé à un agent. ALLFORCE va commencer l'enregistrement sur le client chaque fois qu'un appel est adressé à un agent qui l'agent aucune option pour arrêter l'enregistrement. + +
+
+
+En groupe d'enregistrement du fichier - Ce champ peut passer outre à la campagne d'enregistrement nommage des fichiers système, sauf si elle est définie à AUCUNE. Les variables sont autorisés CAMPAGNE CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. La valeur par défaut est FULLDATE_AGENT et se présente comme suit 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui se présente comme suit TESTCAMP_51020103108_3125551212. 50 char max. La valeur par défaut est NON. + + 0) + { + ?> +
+
+
+ QC Activé - Mise en ce domaine permet à Y pour l'agent de contrôle de la qualité caractéristiques au travail. La valeur par défaut est N. + +
+
+
+ Statuts QC - Cette zone est l'endroit où vous choisissez ce qui entraîne des statuts doit être dépassé par le système de QC. Placez un contrôle à côté de l'état que vous voulez examiner QC. + +
+
+
+ QC Shift - Il s'agit du changement de calendrier servant à tirer d'un QC inbound_group. Les jours de la semaine sont ignorées pour ces fonctions. + +
+
+
+ Record QC Get lancement Cela permet à l'une des actions suivantes peut être déclenché sur un agent QC recevoir un nouveau record. + +
+
+
+ QC Voir Recording - qui permet un enregistrement qui mai être liée à la QC record à afficher dans le QC agent écran. + +
+
+
+ QC WebForm Adresse - Il s'agit de l'adresse du site web d'un agent QC pouvez aller à en cliquant sur le lien dans la WebForm QC écran. + +
+
+
+ Script QC - C'est le script qui peut être utilisé par les agents QC SCRIPT dans l'onglet de la QC écran. + + +
+
+
+Hold Recall transfert In-Group - Si un client demande à ce groupe en plus d'une fois et cela n'est pas mis à AUCUNE, puis l'appel sera automatiquement envoyé à l'En-groupe sélectionné dans ce domaine . La valeur par défaut est NON. + +
+
+
+Appel Route n ° Delay - Mettre ce paramètre à Y va effacer tous les temps d'attente et audio et de tenter d'envoyer l'appel droit à un agent. T-elle pas sur le message d'accueil ou en attente rapide des paramètres. La valeur par défaut est N. + +
+
+
+Stats Pourcentage des appels dans les X secondes - Ce domaine vous permet de définir le nombre de secondes que le tenir en temps réel des statistiques d'affichage à utiliser pour calculer le pourcentage d'appels qui ont répondu ont répondu dans X le nombre de secondes en attente. + +
+
+
+Groupe par défaut Alias - Si vous avez permis à Groupe Alias pour la campagne que l'agent est entré dans ce groupe est l'alias qui est sélectionnée par défaut sur la première d'un appel provenant de l'arrivée de ce groupe quand l'agent choisit de utiliser un alias pour un groupe émetteur manuel appel. La valeur par défaut est None ou vide. + + + + + +



+ +VICIDIAL_ENTRANT_DIDS TABLE

+
+
+
+DID Extension - C'est le nombre, d'extension ou de DID qui déclenchent cette entrée et que vous la route à l'intérieur du système en utilisant cette fonction. Il est réservé par défaut DID que vous pouvez utiliser ce qui est juste le mot-par défaut, sans les tirets, qui allos d'envoyer tout appel qui ne correspond pas à tout les autres modèles de la valeur par défaut de DID. + +
+
+
+Description DID - Il s'agit de la description de l'entrée de routage DID. + +
+
+
+DID Active - C'est le domaine où vous définissez la DID à l'entrée active ou non. La valeur par défaut est Y. + +
+
+
+Route DID - Ce type de route que vous avez mis le DID à utiliser. EXTEN va envoyer des appels à l'extension en dessous, à la messagerie vocale vous envoyer des appels directement à la boîte vocale en dessous, AGENT envoie les appels vers un agent VICIDIAL s'ils sont identifiés, PHONE enverra l'appel d'un téléphone d'entrée, sélectionnez ci-dessous, vous IN_GROUP envoyer des appels directement à l'arrivée du groupe spécifié. La valeur par défaut est EXTEN. + +
+
+
+Extension - Si EXTEN est sélectionné en tant que DID route, alors c'est le dialplan extension qui appelle sera envoyée. La valeur par défaut est 9998811112, pas de service. + +
+
+
+Extension Contexte - Si EXTEN est sélectionné en tant que DID route, alors c'est le contexte qui dialplan demande sera envoyée. Par défaut est la valeur par défaut. + +
+
+
+Boite vocale - Si messagerie vocale est sélectionné en tant que DID Route, c'est la boîte vocale qui demande sera envoyée. La valeur par défaut est vide. + +
+
+
+Téléphone Extension - si le téléphone est sélectionné comme DID Route, cette extension est le téléphone que les appels seront envoyées. + +
+
+
+Téléphone IP du serveur - si le téléphone est sélectionné comme DID route, alors c'est l'IP du serveur pour le téléphone d'extension que les appels seront envoyés à. + +
+
+
+Utilisateur Agent - si l'agent est sélectionné en tant que DID route, alors c'est le VICIDIAL l'agent qui demande sera envoyée à. + +
+
+
+Utilisateur Unavailable Action - si l'agent est sélectionné en tant que DID route, et l'utilisateur n'est pas connecté ou disponible, c'est la route que les appels se. + +
+
+
+Utilisateur Settings En Route-Group - si l'agent est sélectionné en tant que DID route, alors c'est le groupe In-qui sera utilisé pour la file d'attente de paramètres que l'appelant est en attente d'être envoyé à l'agent. La valeur par défaut est AGENTDIRECT. + +
+
+
+In-Groupe ID - Si IN_GROUP est sélectionné en tant que DID route, alors c'est le groupe qui en demande sera envoyée à. + +
+
+
+In-Call Groupe Handle Method - Si IN_GROUP est sélectionné en tant que DID route, alors c'est la méthode de traitement des appels de ces appels. Base de données ajouter un nouveau record à conduire tous les appels à l'aide du CallerID comme le numéro de téléphone, CIDLOOKUP vais essayer de rechercher le numéro de téléphone par le CallerID dans l'ensemble du système, CIDLOOKUPRL sera attampt pour rechercher le numéro de téléphone par le CallerID précisé que dans une seule liste , CIDLOOKUPRC sera attampt de rechercher le numéro de téléphone par le CallerID dans l'ensemble des listes qui font partie de la campagne spécifié, plus proche est indiquée pour VICIDIAL Closer appels, ANI va ajouter un nouveau record à conduire tous les appels à l'aide du ANI que le numéro de téléphone, ANILOOKUP va tenter de rechercher le numéro de téléphone de l'ANI dans l'ensemble du système, ANILOOKUPRL sera attampt de rechercher le numéro de téléphone par l'ANI précisé que dans une seule liste, XDIGITID amènera l'appelant pour un X chiffres avant que l'appel sera mis en la file d'attente. La valeur par défaut est BDCE. + +
+
+
+In-Groupe Agent Méthode de recherche - Si IN_GROUP est sélectionné en tant que DID route, alors c'est l'agent de recherche à la méthode de l'arrivée du groupe, LO est à équilibrage de charge-débordement et d'essayer d'envoyer l'appel à un agent sur le serveur local avant d'essayer de l'envoyer à un agent sur un autre serveur, LB est à équilibrage de charge et de tenter d'envoyer l'appel à l'agent, quel que soit elles sont sur le serveur, le serveur SO est seulement et que d'essayer d'envoyer des appels vers les agents sur le serveur que l'appel est venu dans le. La valeur par défaut est LB. + +
+
+
+Dans la liste Groupe ID - Si IN_GROUP est sélectionné en tant que DID Route, c'est la liste qui mène mai ID être recherchées à travers et que le conduit sera inséré dans le cas échéant. + +
+
+
+En-groupe ID de la campagne - Si IN_GROUP est sélectionné en tant que DID route, alors c'est le ID de la campagne que mène mai être recherchée dans le cas de la méthode est de faire appel CIDLOOKUPRC. + +
+
+
+En-groupe Téléphone Code - Si IN_GROUP est sélectionné en tant que DID route, alors ce téléphone est le code utilisé si un nouveau chef de file est créé. + + + + +



+ +VICIDIAL_REMOTE_AGENTS TABLE

+
+
+ID utilisateur de départ - C'est l'ID utilisateur de départ qui est utilisé quand un entrée d'agent distant est inserée dans le système. Si le nombre de lignes est plus grand que 1, ce nombre est incrementé de un pour chaque ligne qui a une entrée. Assurez vous d'avoir créer un nouveau compte utilisateur VICIDIAL avec un niveau de 4 ou plus si vous voulez qu'il puisse utiliser la page vdremote.php pour pour un accès web distant pour ce compte. + +
+
+
+Numéro de lignes - Cela définie combien d'entrées d'agent distants le système crée, et détermine combien de lignes peuvent être envoyées sans soucis au numéro ci-dessus. + +
+
+
+IP du serveur - Une entrée d'agent distant est seulement valide pour un serveur spécifique, c'est ici que vous sélectionnez quel serveur vous voulez. + +
+
+
+Extension externe - C'est le numéro vers lequel vous voulez faire suivre l'appel. Assurez vous que c'est un numéro du dial plan et si vous avez besoin d'un 9 au début mettez le ici. Testez en appelant ce numéro depuis un téléphone du système. + +
+
+
+Etat - C'est ici que vous activez ou desacivez l'agent distant. Dès que l'agent est actif le systeme permet que des appels puissent lui être envoyés. Cela peu prendre plus de 30 secondes à partir du moment où vous avez desactivé l'agent jusqu'à l'arrêt de la réception des appels. + +
+
+
+Campagne - C'est ici que vous choisissez la campagne dans laquelle ces agents distants ce connecteront. Les appels entrants ont besoin d'une campagne de type CLOSER et de selectionner les campagnes entrantes ci-dessus dans laquelle vous voulez recevoir des appels. + +
+
+
+Groupes entrants - C'est ici que vous selectionnez les groupes entrants depuis lesquels vous voulez recevoir des appels si vous avez selectionné une campagne de type CLOSER. + + +



+ +VICIDIAL_CAMPAIGN_LISTES

+
+
+Les listes de cette campagne sont énumérées ici, leur activité est dénotée par le Y ou N et vous pouvez aller à l'écran de la liste en cliquant sur l'ID de la liste dans la première colonne. + + +



+ +VICIDIAL_CAMPAIGN_STATUSES TABLE

+
+
+En utilisant des statuts de campagne personnalisés, vous pouvez utiliser des statuts qui n'existent que pour une campagne spécifique. Le statut doit contenir entre 1 et 8 caractères , la description entre 2 et 30 et Selectionnable définit si il apparaît dans VICIDIAL comme disposition. Human_answered le champ est employé en calculant le pourcentage debaisse, ou le taux d'abandon. L'arrangement human_answered à Yemploiera ce statut en comptant les appels humain-répondus. L'option de catégorie vous permet de grouper plusieurs statuts dansun catogy qui peut être employé pour l'analyse statistique. + + + + 0) + { + ?> +



+ + VICIDIAL_CAMPAIGN_HOTKEYS TABLE

+
+
+ En utilisant des raccourcis clavier personnalisés, les agents utilisant le client web VICIDIAL peuvent raccrocher et statuer les appels juste en pressant une seule touche du clavier. Il y a deux raccourcis claviers que vous pouvez utiliser en même temps que l'appel du numéro alternatif, ALTPH2 - Alternate Phone Hot Dial et ADDR3 - Adresse3 qui permet à un agent d'utiliser un raccourci pour raccocher l'appel, rester sur la fiche et appeler un autre numéro de la fiche. + + + + + +



+ + VICIDIAL_LEAD_RECYCLE TABLE

+
+
+ 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. + + + + + +



+ + STATUTS VICIDIAL DE L'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF

+
+
+ Si le champ Appel automatique du numéro alternatif est défini, alors les fiches diposées sous ces statuts d'appels automatiques du numéro alternatif auront leurs champs numéro alternatif et/ou adresse3 appelés après n'importe quel statut de non-réponse. + + + + + +



+ +VICIDIAL CODES PAUSE DES AGENTS

+
+
+Si les codes de pause des agents sont activés alors les agents pourront en selectionner un parmi ces codes quand ils cliquent sur le bouton PAUSE. Cette donnée est ensuite stockée dans les log sur les agents vicidial. Un code de pause doit contenir uniquement des lettres et des chiffres et doit contenir moins de 7 caractères. Le nom du code ne doit pas contenir plus de 30 caractères. + + + + + +



+ +VICIDIAL_USER_GROUPS TABLE

+
+
+Groupe d'utilisateurs - C'est le nom court d'un groupe d'utilisateurs Vicidial, n'utilisez ni espaces ni ponctuation pour ce champ. Max 20 caractère min 2. + +
+
+
+Nom du Groupe - C'est la description du groupe d'utilisateurs vicidial. Max 40 caractères. + +
+
+
+Force timeclock Login - Cette option vous permet de ne pas laisser un agent vous connecter à l'interface agent VICIDIAL si elles ne sont pas enregistrés dans le timeclock. La valeur par défaut est N. Il est possible d'exonérer les utilisateurs admin, le niveau 8 et 9. + +
+
+
+Shift exécution - Ce paramètre vous permet de restreindre l'agent de connexion sur la base des changements qui ont été sélectionnés ci-dessous. OFF ne fera pas appliquer à tous les changements. START ne faire respecter les temps de connexion, mais n'aura pas d'incidence sur un agent qui est en cours d'exécution sur leurs heures de travail si elles sont déjà logged in ALL appliquent passer l'heure de début et se connecter à un agent, après, ils courent sur la fin de leur quart de temps. La valeur par défaut est OFF. + +
+
+
+Groupe changements - Il s'agit d'un choix de la liste des changements qui peuvent restreindre l'accès des agents à temps sur le système. + +
+
+
+Campagnes autorisés - C'est une liste de campagnes dans lesquelles les utilisateurs de ce groupes pourront se connecter. L'option TOUTES LES CAMPAGNES autorise les utilisateurs de ce groupe à voir et se connecter à toutes les campagnes sur le système. + + 0) + { + ?> +
+
+
+ QC permis Campagnes - Il s'agit d'un choix de la liste des campagnes où les membres de ce groupe d'utilisateurs seront en mesure de QC. Le ALL-CAMPAGNES option permet aux utilisateurs de ce groupe de Québec une campagne sur le système. + +
+
+
+ QC permis l'arrivée des groupes - Il s'agit d'un choix de la liste des groupes dont l'arrivée des membres de ce groupe d'utilisateurs seront en mesure de QC. Le ALL-GROUPES option permet aux utilisateurs dans ce groupe d'utilisateurs QC arrivée du groupe sur tout le système. + + + + + +



+ +VICIDIAL_SCRIPTS TABLE

+
+
+Id du script - C'est le nom court d'un Script Vicidal. Il doit être unique. Ne pas utiliser d'espace ni de ponctuation pour ce champ. Doit être composé de 2 à 10 caractères. + +
+
+Nom du ccript - C'est le titre du script Vicidial. C'est une courte description du script. Maximum 50 caractères, minimum 2. Il ne doit pas avoir d'espace ou de ponctuation de quelque sorte dans ce champ. + +
+
+Commentaires du script - C'est ici que vous entrez un commentaire pour le script Vicidial comme -changed to free upgrade on Sept 23- Max 255 caractères , min 2 caractères. + +
+
+Texte du 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. 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--&phone=--A--phone--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> +
+ +
+
+
+Activé - Cela determine si ce script peut être selectionné pour être utilisé dans une campagne. + + + + + + 0) + { + ?> +



+ + VICIDIAL_LEAD_FILTRES TABLE

+
+
+ ID du Filtre - C'est le nom court du filtre de fiches Vicidial. Il doit être unique. N'utilisez ni espace ni ponctuation. Max 10 caractères min 2. + +
+
+ Nom du Filtre - C'est un nom plus descrtiptif du filtre. C'est un court resumé du filtre. Max 30 caractères Min 2. + +
+
+ Commentaire du filtre - C'est ici que vous placez les commmentaire du filtre vicidial comme -Appel toutes les fiches de Californie- max 255 characters, min 2. + +
+
+ Filtre SQL - C'est ici que vous mettez le fragment de requête SQL que vous voulez utiliser pour filtrer. Ne commencez pas ni ne finissez pas par AND, cela est automatiquement ajouté par le script cron. Exemple : called_count > 4 and called_count < 8 . + + + + + +



+ +VICIDIAL_PERIODES D'APPELS TABLE

+
+
+Identifiant de la période d'appel - C'est le nom court de la période d'appel de VICIDIAL. Il doit être unique. N'utilisez pas d'espace ou de ponctuation. 10 caractères maximum et 2 minimum. + +
+
+Nom de la période d'appel - C'est un nom plus descriptif de la période d'appel. Une courte description. 30 caractères maximum et 2 minimum. + +
+
+Commentaires de la période d'appel - Vous pouvez y placer des commentaires sur la période d'appel de Vicidial comme-de 10h00 à 16h00 avec des restrictions-. Max 255 caractères. + +
+
+Heures de début et de fin par défaut - Ce sont les heures par défaut pendant lesquelles un appel est autorisé si l'heure de début de day-of-the-week n'est pas définie. 0 est minuit. Pour interdir complétement les appels mettez 2400 et mettez 2400 à l'heure de fin par défaut. Pour autoriser les appels 24h/24, remplissez les champs avec 0 pour le début et 2400 pour la fin. + +
+
+Heures de début et de fin pour un jour - Ce sont les heures de début et de fin personnalisés pour un jour. Les mêmes règles s'appliquent qu'aux heures de début et de fin par défaut. + +
+
+Définitions des états des périodes d'appel -<\/B> C'est la liste des définitions spécifiques des périodes d'appels des états qui sont suivies dans cette définition de période d'appels. + +
+
+State Call Time State -<\/B> Ce sont les deux lettres code pour l'état auquel cette définition de période d'appels correspond. Pour que cela prenne effet, la période d'appel locale qui est définie dans la campagne doit avoir cette enregistrement d'état de période d'appel aussi bien que toutes les fiches ayant ces deux lettre codes d'état. + + + + +



+ +VICIDIAL_SHIFTS TABLE

+
+
+Shift ID - Il s'agit du nom court d'un VICIDIAL Shift Définition. Cela doit être un identifiant unique. Ne pas utiliser les espaces ou la ponctuation dans ce champ. max 20 caractères, un minimum de 2 caractères. + +
+
+Nom Shift - Il s'agit d'un nom descriptif de la Maj Définition. Ceci est un bref résumé de la définition Maj. max 50 caractères, un minimum de 2 caractères. + +
+
+Start Time Shift - Il est temps que la campagne commence à passer. Ne doivent être des chiffres, 9:30 AM serait 0930 et 5:00 PM serait 1700. + +
+
+Longueur Shift - Il est temps en heures et minutes que dure la campagne de changement. 8 heures seraient 08h00 et 7 heures et 30 minutes serait 07:30. + +
+
+Shift Weekdays - Dans cette section, vous devriez choisir le jour de la semaine que ce changement est active. + + + + 0) + { + ?> + +



+ + FONCTIONNALITES DU CHARGEUR DE FICHES DE VICIDIAL

+
+
+ Le chargeur enchaînement-basé de base de fil de VICIDIAL est conçusimplement pour prendre un dossier de fil - jusqu'à 8MB dans lataille qu'est l'étiquette ou la pipe délimitée et pour le chargerdans la table de vicidial_list. Le chargeur de fil tient compte duchamp choisissant et de TXT- le texte tout simplement, les valeursséparées par virgule de CSV- et les XLS- excellent des formats dedossier. Le chargeur de fil ne fait pas la validation de données,mais elle vous permet de vérifier les reproductions en soi, dans lacampagne ou dans le système entier. En outre, assurez-vous que vousavez créé la liste que ces fils doivent être dessous de sorte quevous puissiez les employer. Voici une liste des champs dans leurcommande appropriée pour les dossiers de fil : +
    +
  1. Code vendeur de la fiche - montre dans le champ dID du vendeur de l'interface graphique +
  2. Code source - usage interne uniquement pour les administrateurs et les administrateurs de la base de données +
  3. Identifiant de la liste - le numéro de la liste dans laquelle seront ces fiches +
  4. Code du téléphone - le préfixe pour le numéro de téléphone - 1 pour les USA, 0144 pour le Royaume-Uni, 01161 pour l'Australie, etc +
  5. Numéro de téléphone - doit contenir au moins 8 chiffres +
  6. Titre - titre du client - Mr. Mme. Mlle., etc... +
  7. Nom +
  8. Initiales +
  9. Prénom +
  10. Adresse Ligne 1 +
  11. Adresse Ligne 2 +
  12. Adresse Ligne 3 +
  13. Ville +
  14. Etat - Limité à 2 caractères +
  15. Province +
  16. Code Postal +
  17. Pays +
  18. Sexe +
  19. Date de naissance +
  20. Numero de téléphone alternatif +
  21. Adresse mail +
  22. Phrase de sécurité +
  23. Commentaires +
+ +
NOTES : La fonctionnalité de chargeur de fil d'exceler est permisepar une série de manuscrits de Perl et doit avoir un dossier en placecorrectement configuré de /etc/astguiclient.conf sur le web server.En outre, des modules d'un Perl de couples doivent être chargés pourelle pour travailler aussi bien - oLE-Storage_Lite-Storage_Lite et leBilan-ParseExcel. Vous pouvez vérifier les erreurs d'exécution dansces derniers en regardant votre dossier d'error_log d'apache. Enoutre, pour des contrôles de duplication contre le gampaignénumère, la liste qui a de nouveaux fils entrer dans lui doit êtrecréée dans le système avant que vous commenciez à charger lesfils. + + + + +



+ + + + + + +TABLE DES TELEPHONES

+
+
+Extension du téléphone - C'est dans ce champ qu'il faut mettre le nom du téléphone comme il apparait dans Asterisk sans mettre le protocole ou le slash du début. Par exemple: pour le téléphone SIP SIP/test101 l'extension sera test101. De même pour les téléphones IAX2 assurez vous d'utiliser le nom complet du téléphone : pour IAX2/IAXphone1@IAXphone1 ce sera IAXphone1@IAXphone1. Pour les téléphones ZAP assurez vous de mettre le channel complet: pour Zap/25-1 ce sera 25-1. De plus, assurez vous d'avoir mis le bon protocole en dessous pour votre téléphone. + +
+
+
+Numéro dans le Dial Plan - Ce champ est pour le numéro utilisé pour appeler ce téléphone. Ce numéro est défini dans le fichier extensions.conf du serveur Asterisk + +
+
+
+Boîte vocale - Ce champ est pour la boîte vocale vers laquelle iront les messages pour l'utilisateur de ce téléphone. Il est utilisé pour vérifier la présence de messages et pour permettre à l'utilisateur d'utiliser le bouton VOICEMAIL dans l'application astGUIclient. + +
+
+
+CallerID sortant - Ce champ est celui dans lequel vous entrez le numéro callerID que vous souhaitez voir apparaître lors d'appels externes passés depuis le client web astguiclient. Cela ne fonctionne pas avec RBS, non-PRI, T1/E1s. + +
+
+
+Adresse IP du téléphone - Ce champ est pour l'adresse IP du téléphone si c'est un téléphone VOIP. Ce champ est optionnel + +
+
+
+Adresse IP de l'ordinateur - Ce champ est pour l'adresse IP de l'ordinateur. C'est un champ optionel + +
+
+
+IP du serveur - Ce champ est celui où vous choisissez le serveur sur lequel est activé le téléphone. + +
+
+
+Login - login utilisé par l'utilisateur du téléphone pour se connecter aux applications clientes. + +
+
+
+Mot de passe - Le mot de passe utilisé par l'utilisateur du téléphone pour se connecter aux applications clientes. + +
+
+
+Statut - C'est le statut du téléphone dans le système, ACTIVE et ADMIN autorisent les clients graphiques à fonctionner. ADMIN autorise l'acces à l'administration de ce site. Tous les autres statuts n'autorisent pas l'accès aux clients graphiques ou à l'administration. + +
+
+
+Compte actif - Indique si le téléphone est actif pour le mettre dans la liste dans le client GUI. + +
+
+
+Type de téléphone - Seuelement pour les notes administratives. + +
+
+
+Nom complet - Utilisé par le client GUI dans la liste des téléphones actifs. + +
+
+
+Compagnie - Seulement pour les notes administratives. + +
+
+
+Image - Pas encore implémenté. + +
+
+
+Nouveaux messages - Nombre de nouveaux messages vocaux pour ce téléphone sur le serveur Asterisk. + +
+
+
+Anciens messages - Nombre d'anciens messages vocaux pour ce téléphone sur le serveur Asterisk. + +
+
+
+Protocole client - Le protocole que le téléphone utilise pour se connecter au serveur Asterisk: SIP, IAX2, Zap. Il y a également EXTERNAL pour les numéros distants et les numérotation rapide que vous voulez lister comme téléphone. + +
+
+
+GMT local - La différence entre l'heure de Greenwich, ou l'heure ZULU et le fuseau horaire du téléphone. NE PAS AJUSTER POUR LES DAYLIGHT SAVINGS TIME. Ceci est utilisé par les campagnes VICIDIAL pour afficher correctement l'heure et l'heure du client. + +
+
+
+Login du manager - C'est le login que les clients GUI de ce téléphones vont utiliser pour accéder à la base de données dans laquelle sont stockées les données du serveur. + +
+
+
+Mot de passe du manager - C'est le mot de passe que les clients GUI de ce téléphone vont utiliser pour accéder à la base de données dans laquelle sont stockées les données du serveur. + +
+
+
+Utilisateur par défaut de VICIDIAL - Permet de remplir une valeur par défaut dans le champ utilisateur de VICIDIAL quand l'utilisateur de ce téléphone ouvre l'application client astVICIDIAL. Laisser vide pour ne pas l'utiliser. + +
+
+
+Mot de passe par défaut de VICIDIAL - Permet de remplir une valeur par défaut dans le champ mot de passe de VICIDIAL quand l'utilisateur de ce téléphone ouvre l'application client astVICIDIAL. Laisser vide pour ne pas l'utiliser. + +
+
+
+Campagne par défaut de VICIDIAL - Permet de remplir une valeur par défaut dans le champ campagne de VICIDIAL quand l'utilisateur de ce téléphone ouvre l'application client astVICIDIAL. Laisser vide pour ne pas l'utiliser. + +
+
+
+Exten de mise en attente - C'est l'exten par défaut utilisé pour la mise en attente dans l'application client. Verifiez qu'il fonctionne avant de le changer. + +
+
+
+Exten pour mise en attente de la conférence - C'est l'exten par défaut utilisé pour la mise en attente de la conférence dans l'appilcation client. Verifiez qu'il autre fonctionne avant de le changer. + +
+
+
+Exten de mise en attente VICIDIAL - C'est l'exten par defaut utilisé pour la mise en attente pour l'appilcation cliente VICIDIAL. Avant de changer ce champ verifiez que le nouveau fonctionne. + +
+
+
+Fichier du parc VICIDIAL - C'est le nom du fichier par defaut pour la mise en attente de VICIDIAL. Avant de le changer verifiez que le nouveau fonctionne. Limité a 10 caractères. + +
+
+
+Prefix de Moniteur - C'est le prefix du monitoring des Channels Zap automatiquement contenu dans l'appication astguiclient. Ne changez qu'en accord avec les enregistrement des extensions ZapBarge. + +
+
+
+Exten d'enregistrement - C'est l'extension dans le dial plan pour l'enregistrement utilisé pour enregistrer les conférences. C'est habituellement stoppé au bout d'une heure. Verifiez le fichier extentions.conf avant tout changement. + +
+
+
+Exten principal pour VMAIL - C'est l'extension du dial plan utilisé pour verifier la boîte vocale. Verifiez le fichier extensions.conf avant tout changement. + +
+
+
+VMAIL Dump Exten - C'est le préfix du dial plan utilisé pour lancer des appels directement vers la boite vocale de l'utilisateur depuis un un appelen cours dans l'application astGUIclient app. Avant tout changement verifiez le fichier extensions.conf. + +
+
+
+Extension du contexte - C'est le contexte du dial plan que les téléphones utilisent principalement. Ce qui suppose que tous les numéros appelés par l'application cliente sont accessibles depuis ce contexte, assurez vous donc que ce contexte soit le plus large possible. Verifiez le fichier extension.conf avant toutes modifications. + +
+
+
+Cannal d'envoi de DTMF - C'est le channel utilisé pour envoyer les sons DTMF dans les conférences meetme depuis l'application cliente. Verifiez le fichier extentions.conf avant tout changement. + +
+
+
+Groupe d'appel sortant -<\/B> C'est le groupe de canal hors duquel seront placés les appels passés depuis ce téléphone. Il y a des routines dans l'application cliente qui l'utilisent. Pour les cannal Zap vous devriez utiliser quelque chose comme Zap/g2, pour les trunks IAX vous devriez utiliser un préfixe entier IAX comme IAX2/VICItet1:secret@10.10.10.15:4569. Vérifiez les trunks dans le fichier extensions.conf, il est courant que vous avez défini comme variable globale TRUNK au début du fichier. + +
+
+
+Emplacement du Navigateur - C'est le chemin absolu pour le navigateur Mozilla ou firefox, ceci n'est applicable que pour les clients UNIX/LINUX. Vérifiez en le lançant manuellement. + +
+
+
+Répertoire d'installation - C'est l'endroit où astGUIclient et les scripts astVICUDUAL sont installés sur la machine. Pour Win32 cela doit être quelque chose comme C:\\AST_VICI and for UNIX cela doit être quelque chose comme /usr/local/perl_TK. Vérifiez cela manuellement. + +
+
+
+URL du CallerID - C'est l'adresse web de la page utilisée pour faire une verification personnalisée du CallerId. L'adresse des test par defaut est : http://astguiclient.sf.net/test_callerid_output.php + +
+
+
+URL par defaut de VICIDIAL - C'est l'adresse web de la page utilisée pour faire des requêtes Web VICIDIAL personnalisées. L'adresse par defaut est: http://astguiclient.sf.net/test_VICIDIAL_output.php + +
+
+
+Log des appels - Mettez à true si le fichier call_log.agi est placé dans le fichier extension.conf pour tout les appels sortants ainsi que l'extension de racrochage 'h' pour logger tout les appels. Il devrait toujours être à 1 car cela est nécessaire pour que certaines des fonctionnalités d'astGUIclient et de VICIDIAL fonctionnent proprement. + +
+
+
+Changement d'utilisateur - Mettez à true pour autoriser un utilisateur à changer pour un autre compte utilisateur. NOTE: Si l'utilisateur commute, il peut initier l'enregistrement sur la nouvelle conversation téléphonique du nouvel utilisateur + +
+
+
+En conférence - Mettez à true pour autoriser un utilisateur a démarrer une conférence avec plus de 6 lignes externs. + +
+
+
+Racrochage administateur- Mettre à true pour autoriser l'utilisateur à racrocher n'importe quelle ligne à travers astGUIclient. C'est une bonne idée de l'activer pour les administarteurs. + +
+
+
+Détournement adminisrateur -<\/B> Mettre à true pour autoriser l'utilisateur à pouvoir intercepter et rediriger vers son extention n'importe quelle ligne à travers Astguiclient. C'est une bonne idée de l'activer pour les administrateurs. Mais c'est aussi très utile pour les managers. + +
+
+
+Moniteur adminisrateur - Mettre à true pour autoriser l'utilisateur à intercepter et rediriger vers son extension certaines lignes à partir de astGUIclient. C'est une bonne idée de l'activer pour les adiministrateurs. Mais c'est aussi très utile pour les managers et comme outil d'entrainement. + +
+
+
+Parc d'appels -<\/B> Mettez à true pour autoriser l'utilisateur à parquer des appels dans astGUIclient pour être pris par n'importe quel utilisateur astGUIcient sur le système. Les appels sont mis en attente jusqu'à 30 minutes puis sont raccrochés. Habituellement activé pour tous. + +
+
+
+Vérification de mise à jour - Mettre à true pour afficher une popup avertissant que le temps de mise à jour n'a pas changé en 20 secondes. Utile pour les administrateurs. + +
+
+
+Log des AF - Mettre à true pour logguer les actions de astGUIclient dans un fichier texte sur l'ordinateur de l'utilisateur. + +
+
+
+Activer la queue - Mettre à true pour que les applications clientes utilisent le systeme central de queue d'asterisk. Requis pour VICIDIAL et recommandé pour tout les utilisateurs. + +
+
+
+Popup sur le CallerID - Mettre à true pour autoriser, pour les numéros définis dans le fichier extensions.conf, à afficher des popup concernat le CallerID aux utilisateurs d'astGUIclient. + +
+
+
+Bouton de boîte vocale - Mettre à true pour afficher le bouton VOICEMAIL et le nombre de messages dans astGUIclient. + +
+
+
+Rafraichissement rapide - Mettre à true pour activer un nouveau taux de rafraichissement de l'information dans astGUIclient. Par défaut ce taux est de 1000ms, 1 seconde. Si vous diminuez ce taux cela peu augmenter la charge système. + +
+
+
+Taux de rafraichissement rapide - en millisecondes. Utiliser seulement si le rafraichissement rapide est activé. Par défaut le taux est de 1000ms , 1 seconde. La diminution de ce taux peux augmenter la charge système. + +
+
+
+MySQL persistant -<\/B> Si activé, alors la connection à MYSQL sera maintenue au lieu d'être reconnectée chaque seconde. Utile si vous avez un taux de rafraichissement rapide. Cela va augmenter le nombre de connections au seveur MYSQL. + +
+
+
+Appel automatique du numéro suivant - Si activé, le client VICIDIAL appelera automatiquement le numéro suivant dans la liste selon la disposition d'un appel à moins qu'ils aient choisi "Stop Dialing" sur l'écran de disposition. + +
+
+
+Stoper l'enregistrement après chaque appel - Si activé, le client VICIDIAL stopera chaque enregistrement à la fin de l'appel. Utile si vous faites beaucoup d'enregistrements et si vous utiliser un formulaire web pour déclancher l'enregistrement. + +
+
+
+Activer les messages SIPSAK - Si activé alors le serveur enverra des messages au téléphone SIP à afficher sur l'écran du téléphone quand il est connecté à VICIDIAL. Cette fonction ne fonctionne seulement avec les téléphones SIP et nécessite que sipsak soit installé sur le serveur web. La valeur par défaut est 0. + +
+
+
+Serveur DBX - Le serveur de la base de données MYSQL auquel cette utilisateur se connecte. + +
+
+
+Base de données DBX - Base de données à laquelle cet utilisateur ce connecte. La valeur par défault est asterisk. + +
+
+
+Utilisateur DBX - Login utilisateur de la base de données utilisé pour la connection. La valeur par défaut est cron. + +
+
+
+Mot de passe DBX - Mot de pass de la connetion MYSLQ. La valeur par défaut est 1234. + +
+
+
+Port DBX - Port de la connection à la base de données. La valeur par défaut est 3306. + +
+
+
+Serveur DBY - Le serveur de base de données auquel cet utilisateur ce connecte. Secondaireserver, pas utilisé actuellement. + +
+
+
+Base de données DBY - La base de données MYSQL à laquelle cette utilisateur se connecte. La valeur par défaut est asterisk. Secondaireserver, pas utilisé actuellement. + +
+
+
+Utilisateur DBY - Login utilisateur avec lequel cet utilisateur ce connecte à la base de données. La valeur par défaut est cron. Secondaireserver, pas utilisé actuellement. + +
+
+
+Mot de passe DBY - Mot de passe avec lequel cet utilisateur ce connecte à MYSQL. La valeur par defaut est 1234. Secondaireserver, pas utilisé actuellement. + +
+
+
+DBY port - Port TCP de la connection MYSQL utilisée par cet utilisateur. La valeur par défaut est 3306. Secondaireserver, pas utilisé actuellement. + +
+
+
+Alias ID - L'ID de l'alias utilisé pour permettre les connexions de téléphone à équilibrage de charge. pas d'espaces ou autres caractères spéciaux autorisés. Doit être compris entre 2 et 20 caractères de longueur. + +
+
+
+Alias Nom - Le nom utilisé pour désigner un téléphone alias, doit être compris entre 2 et 50 caractères de longueur. + +
+
+
+Téléphones Connexions List - La virgule sépare la liste de téléphone de connexion utilisé lors d'un agent se connecte par téléphone pour équilibrer la charge de connexion. L'agent se trouve l'application serveur actif avec le moins d'agents et connecté à un appel à ce serveur à l'agent au moment de la connexion. + +
+
+
+Téléphones Email - L'adresse e-mail associée à ce téléphone d'entrée. Il est utilisé pour les paramètres de messagerie vocale. + +
+
+
+Template ID - C'est le fichier de conf ID que ce modèle de téléphone utilisé pour la saisie des paramètres de son Asterisk. La valeur par défaut est - ABSENCE --. + +
+
+
+Conf Override Settings - 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. + +
+
+
+Alias Groupe ID - L'ID du groupe alias utilisés par les agents de composer les appels de l'agent VICIDIAL interface avec différents Caller ID. pas d'espaces ou autres caractères spéciaux autorisés. Doit être compris entre 2 et 20 caractères de longueur. + +
+
+
+Nom du groupe Alias - Le nom utilisé pour décrire un groupe d'emprunt, doit être compris entre 2 et 50 caractères de longueur. + +
+
+
+Numéro d'identification de l'appelant - Le numéro d'identification de l'appelant utilisée dans ce groupe Alias. Chiffres doivent être. + +
+
+
+Nom d'identification de l'appelant - Le nom d'identification de l'appelant qui peut être envoyé à ce groupe Alias. Pour autant que nous sachions ce qui ne fera que travailler au Canada sur les circuits PRI et l'utilisation d'un tronc IAX boucle par Asterisk. + + + + +



+ +TABLE DES SERVEURS

+
+
+ID du Sevreur - C'est ici que vous mettez le nom du serveur Asterisk, il n'est pas obligatoire de mettre le sous dommaine, juste un nom pour identifier le seveur pour les administrateurs. + +
+
+
+Descritpion du serveur - Petite description du serveur asterisk. + +
+
+
+Adresse IP du serveur - Le champs dans lequel vous mettez l'adresse IP du serveur Asterisk. + +
+
+
+Actif - Mettre si le serveur Asterisk est actif ou non. + +
+
+
+Système de charge - Ces deux statistiques montrent loadavg la fois d'un système 100 et le pourcentage d'utilisation CPU du serveur et est mis à jour chaque minute. Le loadavg devrait être en moyenne inférieure à 100 multiplié par le nombre de noyaux de CPU de votre système a, pour des performances optimales. Le pourcentage d'utilisation CPU devrait rester en dessous de 50 pour une performance optimale. + +
+
+
+Live Chaînes - Ce champ indique le nombre actuel d'Asterisk canaux qui sont en direct sur le système dès maintenant. Il est important de noter que le nombre de canaux Asterisk est habituellement beaucoup plus élevé que le nombre d'appels sur un système. Ce champ est mis à jour une fois chaque minute. + +
+
+
+Disk Usage - Ce champ montre l'utilisation du disque pour chaque partition sur ce serveur. Ce champ est mis à jour une fois chaque minute. + +
+
+
+Version d'Asterisk - Mettre la version d'asterisk que vous avez installé sur ce serveur. Examples: ' 1.2 ', ' 1.0.8 ', ' 1.0.7 ', 'CVS_HEAD', 'REALLY OLD', etc... Ceci est utilisé car les versions 1.0.8 et 1.0.9 ont une methode differente pour gérer les canaux Local/, un bug qui a été fixé dans le CVS v1.0, et qui nescessite d'être traité differement quand les canaux Local/ sont manipulés. Aussi, la version courante CVS_HEAD et l'arbre 1.2 utilisent des managers et des commandes différentes, qui doivent donc être traités différemment.. + +
+
+
+Nombre maximum de trunks VICIDIAL - Ce champ détermine le nombre maximum de lignes que l'appel automatique de VICIDIAL essayera d'appeler sur ce serveur. Si vous voulez consacrer pleinement deux PRI T1s à VICIDIAL sur un serveur vous devriez mettre ce champ à 46. La valeur par defaut est 96. + +
+
+
+Max demande par seconde - Ce paramètre détermine le nombre maximum d'appels qui peuvent être mis par la sortie d'auto-script d'appel sur ce serveur par seconde. Doit être de 1 à 100. La valeur par défaut est 20. + +
+
+
+Hôte telnet - C'est l'adresse ou le nom du serveur Asterisk et c'est comme cela que les applications managers se connectent au sevreur quand elle sont lancées. Si les applications managers sont lancées sur le serveur Asterisk, alors la valeur par defaut 'localhost' fonctionne bien . + +
+
+
+Port telnet - C'est le port de connection au manager du serveur Asterisk c'est par ceului-ci que les applications managers se connectent. La valeur par defaut '5038' fonctionne bien avec une installation standard. + +
+
+
+Utilisateur du manager - C'est l'utilisateur utilisé pour la connection au manager Asterisk. La valeur par défaut est 'cron' + +
+
+
+Mot de passe du manager - Le secret ou mot de passe utilisé pour ce connecter au manager Asterisk. La valeur par defaut est '1234' + +
+
+
+Utilisateur du manager pour les mises à jour - Le nom d'utilisateur ou le login utilisé pour se connecter au manager d'Asterisk, optimisé pour les scripts de mise à jour. La valeur par defaut est 'updatecron' et a le même secret que l'utilisateur générique. + +
+
+
+Utilisateur du manager pour l'écoute - Le nom d'utilisateur ou le login utilisé pour se connecter au manager d'Asterisk, optimisé pour les scripts qui écoutent la sortie seulement. La valeur par défaut est 'listencron' et a le même secret que l'utilisateur générique. + +
+
+
+Utilisateur du manager pour l'envoi - Le nom d'utilisateur ou le login utilisé pour se connecter au manager d'Asterisk, optimisé pour les scripts qui envoient des actions au manager. La valeur par défaut est 'sendcron' et a le même secret que l'utilisateur générique. + +
+
+
+Décalage GMT du serveur -La difference en heure par rapport à l'heure GMT non ajustée pour Les Daylight-Savings-Time du serveur. Par defaut '-5' + +
+
+
+Exten VMail Dump - Le prefix de l'extention utilisé sur ce serveur pour lancer des appels directement depuis agc vers une boite vocale spécifique. La valeur par defaut est '85026666666666' + +
+
+
+Extension de VICIDIAL AD - L'extension par défaut si personne n'est présent dans la campagne qui permet de lancer des appels pour l'appel automatique de VICIDIAL. La valeur par defaut est '8365' + +
+
+
+Contexte par défaut - Le contexte par defaut utilisé par les scripts qui opèrent sur ce serveur. La valeur par défaut est 'default' + +
+
+
+Performances du système - Mettre cette option à Y permet de loger les statistiques des performances du système, incluant la charge du système, les processus et les canaux Asterisk utilisés. La valeur par défaut est N. + +
+
+
+Logs du serveur - Mettre cette option à Y permet de loger tous les scripts liés à Asterisk dans leurs fichiers textes de log. Mettre cette option à N arrête le logs dans les fichiers pour ces processus, et de ce fait désactive l'écran de log de Asterisk si cette option est à N quand Asterisk démarre. La valeur par défaut est Y. + +
+
+
+Sortie des scripts AGI - Mettre cette option à NONE désactive toutes les sorties des scripts AGI de VICIDIAL. La mettre à STDERR enverra les sorties des scripts AGI à la CLI Asterisk. Mettre cette option à FILE enverra les sorties dans un fichiers dans le répertoire des logs. Mettre cette option à BOTH enverra les sorties à la fois vers la CLI Asterisk et dans le fichier de log. La valeur par défaut est FILE. + +
+
+
+Appel équilibré VICIDIAL -<\/B> Définir ce champ à Y permettra au serveur de placer des appels équilibrés pour les campagnes dans VICIDIAL de sorte que le niveau d'appel défini puisse être atteint même s'il n'y a aucun agent connecté dans cette campagne sur ce serveur. La valeur par défaut est N. + +
+
+
+Limite de l'équilibrage VICIDIAL -<\/B> Cette option définit le nombre de trunks à ne pas utiliser pour l'équilibrage des appels VICIDIAL. Par exemple si vous avez 40 trunks vicidial et la limite d'équilibrage VICIDIAL définie à 10 vous ne pourrez utiliser que 30 trunks pour l'équilibrage VICIDIAL. La valeur par défaut est 0. + +
+
+
+Enregistrement Web Link - Ce paramètre permet d'outrepasser les paramètres par défaut de l'affichage de l'enregistrement de lien dans l'admin des pages web. La valeur par défaut est SERVER_IP. + +
+
+
+Autre enregistrement IP du serveur - Ce paramètre est l'endroit où vous pouvez mettre une IP de serveur de nom de machine ou d'autres qui peuvent être utilisés à la place de la server_ip dans les liens d'enregistrements au sein de l'administration des pages Web. La valeur par défaut est vide. + +
+
+
+Asterisk Active Server - Si Asterisk ne fonctionne pas sur ce serveur, ou si VICIDIAL ne devrait pas utiliser ce serveur, ou si seulement ce serveur en utilisant des scripts pour d'autres comme la trémie de chargement de script que vous souhaiteriez mettre à la N. La valeur par défaut est Y. + +
+
+
+Générer des fichiers de conf - Si vous souhaitez que le système d'auto-générer des fichiers de conf astérisque sur la base des entrées de téléphones, le transporteur et l'équilibrage de charge des entrées de configuration dans VICIDIAL puis mettre à la valeur par défaut est Y. Y. + +
+
+
+Reconstruire les fichiers conf - Si vous voulez forcer une reconstruction de la conf Asterisk fichiers ou si l'une des entrées de porte ou les téléphones ont changé, alors ceci doit être réglé sur Y. Après la conf des fichiers ont été générés et Asterisk a été rechargée alors ce sera changée pour N. La valeur par défaut est Y. + + + + + +



+ +vicidial_conf_templates TABLE

+
+
+Template ID - Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le modèle de configuration à travers le système. + +
+
+
+Nom du modèle - C'est le nom descriptif du modèle de fichier de configuration d'entrée. + +
+
+
+Template Sommaire - Ce domaine est l'endroit où vous pouvez entrer dans les paramètres spécifiques pour être utilisés par tous les téléphones et / ou les transporteurs qui sont mis à utiliser ce modèle de conf. Les champs qui ne doivent PAS être inclus dans cette zone sont: le secret, accountcode, compte, nom d'utilisateur et boîte aux lettres. + + + + + +



+ +vicidial_server_carriers TABLE

+
+
+Carrier ID - Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le transporteur pour cette entrée spécifique dans l'ensemble du système. + +
+
+
+Nom du transporteur - C'est le nom descriptif de la porte d'entrée. + +
+
+
+Inscription String - Ce domaine est l'endroit où vous pouvez entrer dans la chaîne exacte nécessaire dans le IAX ou SIP pour enregistrer le fichier de configuration pour le fournisseur. Facultatif mais fortement recommandé si votre opérateur permet l'enregistrement. + +
+
+
+Template ID - Ce champ facultatif permet de choisir un modèle de fichier de conf de ce transporteur entrée. + +
+
+
+Compte Entrée - Ce champ est utilisé si vous n'avez pas choisi un modèle à utiliser, et c'est là où vous pouvez entrer dans les paramètres du compte à utiliser pour ce transporteur. Si vous prenez en appels entrants à partir de ce transporteur tronc, vous pouvez définir le contexte = trunkinbound dans ce domaine, de sorte que vous pouvez utiliser le processus de traitement des DID dans VICIDIAL. + +
+
+
+Protocole - Ce domaine vous permet de définir le protocole à utiliser pour le transporteur d'entrée. Actuellement, seuls SIP et IAX sont soutenus. + +
+
+
+Globals String - Ce champ facultatif permet de définir une variable globale à utiliser pour le transporteur de la dialplan. + +
+
+
+Entrée Dialplan - Ce champ facultatif permet de définir un ensemble de dialplan entrées à utiliser pour ce transporteur. + +
+
+
+IP du serveur - Il s'agit du serveur que ce support est associé à enregistrer. + +
+
+
+Active - Cela définit si le transporteur sera inclus dans l'auto-générés ou non les fichiers conf. + + + + + +



+ +TABLE DES CONFERENCES

+
+
+Numéro de la conférence - Ce champ permet de mettre le numéro du meetme pour les conférences. Il est aussi recommandé que le numéro du meetme dans meetme.conf corresponde à ce numéro pour chaque entrée. C'est pour les conférences dans astGUIclient et est utilisé pour la fonction leave-3way-call dans VICIDIAL. + +
+
+
+IP du serveur - C'est le menu dans lequel vous choisissez le serveur Asterisk sur lequel sera cette conférence. + + + + + 0) + { + ?> +



+ + VICIDIAL_SERVER_MallesTABLE

+
+
+ Les trunks du serveur VICIDIAL vous permettent de limiter les lignes sortantes qui sont utilisées sur ce serveur sur une base par-campagne. Vous avez la possibilité de reserver un nombre spécifique de lignes à utiliser par seulement une campagne aussi bien que permettre à cette campagne d'utiliser plus de lignes que celles reservées si il en reste de libre, tant que le nombre maximum de ligne utilisées par Vicidial sur ce serveur est inférieur au nombre de trunks VICIDIAL maximum défini. Avoir aucun de ces réglages permet à la campagne qui appel en premier d'avoir autant de lignes qu'elle le peut sous le nombre max de lignes VICIDIAL défini. + + + + + +



+ +SYSTEM_SETTINGS TABLE

+
+
+Utiliser Non-Latin - Cette option vous permet d'utiliser les caractères UTF8 pour l'affichage web des scripts, et de ne pas utiliser des filtres d'expressions régulières latin-character-family ou de formater l'affichage. La valeur par défaut est 0. + +
+
+
+Webroot éditable - Cette option vous permet de définir si les fichiers temporaires et les fichiers d'authentification doivent être placés dans le webroot sur le serveur web. La valeur par défaut est 1. + +
+
+
+Affichage de la désactivation d'un agent VICIDIAL - Ce champ est utilisé pour selectionné quand montrer à un agent que ça session à été désactivée par le système, une action du manager ou par une mesure externe. NOT_ACTIVE désactivera l'affichage d'un message sur l'écran de l'agent. LIVE_AGENTS affichera seulement le message de désactivation quand les enregistrements vicidial_auto_calls des agents ont été modifiés, comme lors d'une déconnection forcée ou d'une déconnection de secours. + +
+
+
+Autoriser les messages SIPSAK - Si défini à 1, cela permettra aux téléphones à fonctionner correctement, le serveur enverra des messages à afficher sur l'écran du téléphone quand il est connecté à VICIDIAL. Cette fonction fonctionne seulement avec des téléphones SIP et nécessite que sipsak soit installé sur le serveur web. La valeur par défaut est 0. + +
+
+
+Agent API Active - Si définie à 1, cela permet à l'agent d'interface API pour fonctionner. La valeur par défaut est 0. + +
+
+
+URL de l'acceuil de l'administration - C'est l'URL ou l'adresse du site web ou vous voulez aller quand vous cliquez sur le lien ACCUEIL en haut de la page admin.php. + +
+
+
+Permettez le fichier journal de transfert d'agent - cette optionnotera à un fichier journal des textes sur le webserver chaque foisqu'un appel est transféré à un agent. Le défaut est 0,neutralisé. + +
+
+
+Horloge en temps Fin de la journée - Ce paramètre définit lorsque tous les utilisateurs sont automatiquement déconnecté du système timeclock. Fonctionne uniquement une fois par jour. ne doit être que 4 chiffres et 2 chiffres heures à 2 chiffres dans les minutes de 24 heures. La valeur par défaut est 0000. + +
+
+
+Dernière timeclock Auto Déconnection - Ce champ affiche la date de la dernière auto-logout. + +
+
+
+Agent Header Screen Format Date - Ce menu vous permet de choisir le format de la date qui apparaît en haut de l'écran VICIDIAL agent. Les options de ce paramètre sont les suivants: valeur par défaut est MS_DASH_24HR
+MS_DASH_24HR 2008-06-24 23:59:59 - Par défaut avec le format de la date année mois jour suivie par 24 heures,
+US_SLASH_24HR 06/24/2008 23:59:59 - Etats-Unis avec le format de la date mois jour année suivie par 24 heures,
+EU_SLASH_24HR 24/06/2008 23:59:59 - Européen de format de date avec jour mois année suivie par 24 heures,
+AL_TEXT_24HR JUN 24 23:59:59 - Texte de format de date avec abrégée mois jour suivie par 24 heures,
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Par défaut avec le format de la date année mois jour , suivies de 12 heures
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - Etats-Unis avec le format de la date mois jour année , suivies de 12 heures
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Européen de format de date avec jour mois année , suivies de 12 heures
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Texte de format de date avec abrégée mois jour , suivies de 12 heures
+ +
+
+
+Agent client Screen Format Date - Ce menu vous permet de choisir le format de la date du fuseau horaire client qui apparaît en haut de la section d'information à la clientèle agent VICIDIAL de l'écran. Les options pour ce paramètre sont les suivants: valeur par défaut est AL_TEXT_AMPM
+MS_DASH_24HR 2008-06-24 23:59:59 - Par défaut avec le format de la date année mois jour suivie par 24 heures,
+US_SLASH_24HR 06/24/2008 23:59:59 - Etats-Unis avec le format de la date mois jour année suivie par 24 heures,
+EU_SLASH_24HR 24/06/2008 23:59:59 - Européen de format de date avec jour mois année suivie par 24 heures,
+AL_TEXT_24HR JUN 24 23:59:59 - Texte de format de date avec abrégée mois jour suivie par 24 heures,
+MS_DASH_AMPM 2008-06-24 11:59:59 PM - Par défaut avec le format de la date année mois jour , suivies de 12 heures
+US_SLASH_AMPM 06/24/2008 11:59:59 PM - Etats-Unis avec le format de la date mois jour année , suivies de 12 heures
+EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Européen de format de date avec jour mois année , suivies de 12 heures
+AL_TEXT_AMPM JUN 24 11:59:59 PM - Texte de format de date avec abrégée mois jour , suivies de 12 heures
+ +
+
+
+Agent Client Téléphone Screen Format - Ce menu vous permet de choisir le format du client le numéro de téléphone qui apparaît dans la section du statut de la VICIDIAL agent écran. Les options pour ce paramètre sont les suivants: valeur par défaut est US_PARN
+US_DASH 000-000-0000 - USA tableau de bord séparés numéro de téléphone
+US_PARN (000)000-0000 - USA Numéro de tableau de bord séparés avec le code régional entre parenthèses
+MS_NODS 0000000000 - Pas de formatage
+UK_DASH 00 0000-0000 - UK tableau de bord séparés numéro de téléphone avec l'espace après le code de ville
+AU_SPAC 000 000 000 - Australia espace séparé numéro de téléphone
+IT_DASH 0000-000-000 - Italy tableau de bord séparés numéro de téléphone
+FR_SPAC 00 00 00 00 00 - France espace séparé numéro de téléphone
+ +
+
+
+Agent interface API Access Active - This option allows you to enable or disable the agent interface API. Default is 0. + +
+
+
+Caractéristiques QC Active - Cette option vous permet d'activer ou désactiver le contrôle de la qualité ou QC fonctionnalités. La valeur par défaut est 0 pour les inactifs. + +
+
+
+Auto-Outbound Dial Active - Cette option vous permet d'activer ou désactiver la numérotation automatique sortants dans VICIDIAL, la mise en ce domaine à 0 supprime les listes et FILTRES sections et de nombreux champs de la campagne Modification écrans. Manuel de l'entrée de numérotation sera encore autorisée au sein de l'agent de l'écran, mais pas de liste d'appel ne sera possible. La valeur par défaut est 1 pour les actifs. + +
+
+
+Max REMPLISSAGE demande par seconde - Ce paramètre détermine le nombre maximum d'appels qui peuvent être placés par les auto-FILL sortie d'auto-script de numérotation pour tous les serveurs, par seconde. Doit être de 1 à 200. La valeur par défaut est 40. + +
+
+
+Activer le log des QueueMetrics - Cette option vous permet de définir si VICIDIAL va insérer les données des logs dans la table queue_log comme le fait Asterisk. QueueMetrics est un programme d'analyse de statistiques autonome et non open-source. Vous devez avoir installé et configuré QueueMetrics pour activer cette option. La valeur par défaut est 0. + +
+
+
+IP du serveur QueueMetrics - C'est l'adresse IP de la base de données pour votre installation de QueueMetrics. + +
+
+
+Nom de la base de données de QueueMetrics - C'est le nom de la base de données de QueueMetrics. + +
+
+
+Login de la base de données de QueueMetrics - C'est le login utilisé pour se connecter à la base de données QueueMetrics. + +
+
+
+Mot de passe de la base de données de QueueMetrics - C'est le mot de passe utilisé pour se connecter à la base de données QueueMetrics. + +
+
+
+URL de QueueMetrics - C'est l'URL ou l'adresse du site web utilisé pour atteindre QueueMetrics. + +
+
+
+Identifiant des log de QueueMetrics - C'est l'identifiant du serveur que tout les logs VICIDIAL dans la base de données de QueueMetrics vont utiliser pour chaque enregistrement. + +
+
+
+QueueMetrics EnterQueue Prepend -<\/B> Ce champ est utilisé pour autorisé à ajouter un des champs des données de vicidial_list devant le numéro de téléphone du client pour personnaliser les rapports QueueMetrics. La valeur par défaut est NONE pour ne pas peupler n'importe quoi. + +
+
+
+Activer Vtiger Integration - Ce paramètre vous permet d'activer l'intégration avec Vtiger VICIDIAL. Actuellement, des liens vers Vtiger admin et de recherche ainsi que l'utilisateur de réplication sont les seules fonctions d'intégration disponibles. La valeur par défaut est 0. + +
+
+
+Vtiger DB IP du serveur - Il s'agit de l'adresse IP de la base de données de votre installation Vtiger. + +
+
+
+Vtiger Database Name - C'est le nom de base de données de votre base de données Vtiger. + +
+
+
+Vtiger Database Login - C'est le nom d'utilisateur utilisé pour vous connecter à votre base de données Vtiger. + +
+
+
+Vtiger Database Password - Il s'agit du mot de passe utilisé pour vous connecter à votre base de données Vtiger. + +
+
+
+Vtiger Web - Il s'agit de l'URL ou adresse du site Web utilisé pour accéder à votre installation Vtiger. + + +



+ +VICIDIAL_STATUSES TABLE

+
+
+Par l'utilisation des statuts de système, vous pouvez avoir desstatuts qui existent pour la campagne et le dans-groupe. Le statutdoit être 1-6 caractères de longueur, la description doit être 2-30caractères de longueur et sélectionnable définit si elle apparaîtdans VICIDIAL comme disposition d'agent. Human_answered le champ estemployé en calculant le pourcentage de baisse, ou le taux d'abandon.L'arrangement human_answered à Y emploiera ce statut en comptant lesappels humain-répondus. L'option de catégorie vous permet de grouperplusieurs statuts dans un catogy qui peut être employé pourl'analyse statistique. + + +



+ +VICIDIAL_STATUS_CATEGORIES TABLE

+
+
+Par l'utilisation des catégories de statut de système, vous pouvezgrouper ensemble des statuts pour tenir compte de l'analysestatistique sur un groupe de statuts. L'identification de catégoriedoit être 2-20 caractères de longueur sans les espaces, le nom doitêtre 2-50 caractères de longueur, la description est facultative etl'affichage de TimeonVDAD définit si ce statut sera un de jusqu'à 4statuts qui peuvent être calculés et montrés le temps sur lerapport de temps réel de VDAD. La vente et la catégorie Dead Lead Catégorie sont tous deux utilisés par le système de liste de suggestions lors de l'analyse de la liste des statistiques. + + + 0) + { + ?> +



+ + VICIDIAL QC ÉTAT DES CODES

+
+
+ Le contrôle de la qualité au sein du système-QC VICIDIAL a son propre ensemble de codes distincts de ceux dans le traitement des appels de fonctions VICIDIAL. QC statuse codes doit être comprise entre 2 et 8 caractères et ne contiennent pas de caractères spéciaux, comme un espace ou du côlon. Le code de statut QC description doit être comprise entre 2 et 30 caractères. + + + + +







+







+LA FIN +
+\n"; + echo "\n"; + echo "\n"; + echo ""; + + $stmt="SELECT dial_statuses,local_call_time,lead_filter_id 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]; + 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 = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + + echo "

\n"; + echo "Montrer le nombre de fiches désactivées -

\n"; + echo "CAMPAIGN: $campaign_id
\n"; + echo "LISTES: $camp_lists
\n"; + echo "STATUSES: $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,$fSQL); + + echo "

\n"; + echo "\n"; + + exit; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 = '3125551212'; + $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'; + + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + + $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = $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); + } + + $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("\n","
",$script_text); + + + echo ""; + + echo "Prévisualisation du 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) + { + echo "
\n"; + echo ""; + + echo "
AJOUTEZ UN NOUVEL UTILISATEUR
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
Numéro d'utilisateur : $NWB#vicidial_users-user$NWE
Mot de passe:$NWB#vicidial_users-pass$NWE
Nom complet: $NWB#vicidial_users-full_name$NWE
Niveau de l'utilisateur: $NWB#vicidial_users-user_level$NWE
Groupe utilisateur:
Login du téléphone: $NWB#vicidial_users-phone_login$NWE
Mot de passe du téléphone: $NWB#vicidial_users-phone_pass$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1A display the COPY USER FORM SCREEN +###################### + +if ($ADD=="1A") + { + if ($LOGmodify_users==1) + { + echo "
\n"; + echo ""; + + echo "
UTILISATEUR DE COPY\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} + + echo "\n"; + echo "\n"; + echo "
Numéro d'utilisateur : $NWB#vicidial_users-user$NWE
Mot de passe:$NWB#vicidial_users-pass$NWE
Nom complet: $NWB#vicidial_users-full_name$NWE
Source Utilisateur: $NWB#vicidial_users-user$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN +###################### + +if ($ADD==11) + { + if ($LOGmodify_campaigns==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UNE NOUVELLE CAMPAGNE\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"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID de la campagne: $NWB#vicidial_campaigns-campaign_id$NWE
Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
Description de la campagne: $NWB#vicidial_campaigns-campaign_description$NWE
Actif: $NWB#vicidial_campaigns-active$NWE
Extension du parc: $NWB#vicidial_campaigns-park_ext$NWE
Nom du fichier de mise en attente: $NWB#vicidial_campaigns-park_file_name$NWE
Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
Autoriser les closers: $NWB#vicidial_campaigns-allow_closers$NWE
Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
Niveau de l'appel automatique: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
Heure d'appel locale: $NWB#vicidial_campaigns-local_call_time$NWE
Boîte vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=12 display the COPY CAMPAIGN FORM SCREEN +###################### + +if ($ADD==12) + { + if ($LOGmodify_campaigns==1) + { + echo "
\n"; + echo ""; + + echo "
CopieUne CAMPAGNE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
ID de la campagne: $NWB#vicidial_campaigns-campaign_id$NWE
Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
Campagne De Source :$NWB#vicidial_campaigns-campaign_id$NWE
NOTE: Copie d'une campagne vous permettra de copier tous les paramètres de campagne, le capitaine que vous sélectionnez, mais il ne sera pas copier une campagne spécifique DNC liste s'il y en a un sur le maître, sélectionnez la campagne.
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=111 display the ADD NEW LIST FORM SCREEN +###################### + +if ($ADD==111) + { + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; + + echo "
ADD A NEW LIST\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID de la liste: (chiffres seulement)$NWB#vicidial_lists-list_id$NWE
Nom de la liste: $NWB#vicidial_lists-list_name$NWE
Description de la liste: $NWB#vicidial_lists-list_description$NWE
Campagne: $NWB#vicidial_lists-campaign_id$NWE
Actif: $NWB#vicidial_lists-active$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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='Y' 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('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 "
DNC NON AJOUTE - Ce numéro de téléphone est déjà dans la liste Do Not Call: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC AJOUTE: $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='LISTES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN AJOUTER LE NUMERO A LA LISTE 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] > 0) + {echo "
DNC NON AJOUTE - Ce numéro de téléphone est déjà dans la liste Do Not Call: $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 "
DNC AJOUTE: $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='LISTES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + echo "
Ajouter des numéros dans DNC LISTE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Numéros de téléphone:

(un numéro de téléphone par ligne seulement)
$NWB#vicidial_list-dnc$NWE
\n"; + } + + +###################### +# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN +###################### + +if ($ADD==1111) + { + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU GROUPE ENTRANT\n"; + echo "\n"; + echo "
\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 du groupe: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nom du groupe: $NWB#vicidial_inbound_groups-group_name$NWE
Couleur du groupe: $NWB#vicidial_inbound_groups-group_color$NWE
Actif: $NWB#vicidial_inbound_groups-active$NWE
Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Boîte vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
Affichage de l'enseigne: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1211 display the COPY INBOUND GROUP SCREEN +###################### + +if ($ADD==1211) + { + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + echo "
GROUPE D'ARRIVÉE DE COPY\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID du groupe: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nom du groupe: $NWB#vicidial_inbound_groups-group_name$NWE
Source ID du groupe: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU NE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
DID Extension: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
A Description:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1411 display the COPY DID SCREEN +###################### + +if ($ADD==1411) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
COPY DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
DID Extension: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
A Description:$NWB#vicidial_inbound_dids-did_description$NWE
Source DID:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN +###################### + +if ($ADD==11111) + { + if ($LOGmodify_remoteagents==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEL AGENT DISTANT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Début des ID utilisateurs: (nombres seulement, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Nombre de lignes: (nombres seulement)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP du serveur: $NWB#vicidial_remote_agents-server_ip$NWE
Extension externe: (numéro du dial plan pour atteindre les agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Etat: $NWB#vicidial_remote_agents-status$NWE
Campagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Groupes entrants: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=111111 display the ADD NEW USERS GROUP SCREEN +###################### + +if ($ADD==111111) + { + if ($LOGmodify_usergroups==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU GROUPE D'UTILISATEUR\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Groupe: (pas d'espace ni de ponctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (Description du groupe)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1111111 display the ADD NEW SCRIPT SCREEN +###################### + +if ($ADD==1111111) + { + if ($LOGmodify_scripts==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID du script: (pas d'espace ni de ponctuation)$NWB#vicidial_scripts-script_id$NWE
Nom du script: (titre du script)$NWB#vicidial_scripts-script_name$NWE
Commentaires du script: $NWB#vicidial_scripts-script_comments$NWE
Actif: $NWB#vicidial_scripts-active$NWE
Texte du script: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=11111111 display the ADD NEW FILTER SCREEN +###################### + +if ($ADD==11111111) + { + if ($LOGmodify_filters==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU FILTRE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID du filtre: (pas d'espace ni de ponctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nom du filtre: (courte description du filtre)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Commentaires du filtre: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtre Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=111111111 display the ADD NEW CALL TIME SCREEN +###################### + +if ($ADD==111111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UNE NOUVELLE PERIODE D'APPELS\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
Identifiant de la période d'appels: (pas d'espace ni de ponctuation)$NWB#vicidial_call_times-call_time_id$NWE
Nom de la période d'appels: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
Commentaires de la période d'appels: $NWB#vicidial_call_times-call_time_comments$NWE
Les options pour l'heure et le jour apparaitront une fois que vous aurez créé la période d'appels
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN +###################### + +if ($ADD==1111111111) + { + if ($LOGmodify_call_times==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UNE NOUVELLE PERIODE D'APPELS D'ETAT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
Identifiant de la période d'appels d'état: (pas d'espace ni de ponctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (pas d'espace ni de ponctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
Nom de la période d'appels d'état: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
Commentaires de la période d'appels d'état: $NWB#vicidial_call_times-call_time_comments$NWE
Les options pour l'heure et le jour apparaitront une fois que vous aurez créé la période d'appels
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
Shift ID: (pas d'espace ni de ponctuation)$NWB#vicidial_shifts-shift_id$NWE
Shift Nom: (brève description de l'évolution)$NWB#vicidial_shifts-shift_name$NWE
Start Time Shift:\n"; + echo "   End Time Shift:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Longueur Shift: $NWB#vicidial_shifts-shift_length$NWE
Shift-Ven:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Dimanche
\n"; + echo "Lundi
\n"; + echo "Mardi
\n"; + echo "Mercredi
\n"; + echo "Jeudi
\n"; + echo "Vendredi
\n"; + echo "Samedi
\n"; + echo "
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=11111111111 display the ADD NEW PHONE SCREEN +###################### + +if ($ADD==11111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU TELEPHONE\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extension du téléphone: $NWB#phones-extension$NWE
Nuémro dans le dial plan: (chiffres seulement)$NWB#phones-dialplan_number$NWE
Boîte vocale: (chiffres seulement)$NWB#phones-voicemail_id$NWE
CallerID sortant: (chiffres seulement)$NWB#phones-outbound_cid$NWE
Adresse IP du téléphone: (optional)$NWB#phones-phone_ip$NWE
Adresse IP de l'ordinateur: (optional)$NWB#phones-computer_ip$NWE
IP du serveur: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Mot de passe:$NWB#phones-pass$NWE
Etat: $NWB#phones-status$NWE
Compte actif: $NWB#phones-active$NWE
Type de téléphone: $NWB#phones-phone_type$NWE
Nom complet: $NWB#phones-fullname$NWE
Compagnie: $NWB#phones-company$NWE
Image: $NWB#phones-picture$NWE
Protocole client: $NWB#phones-protocol$NWE
GMT local: (Ne PAS ajuster pour DST)$NWB#phones-local_gmt$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=12111111111 display the ADD NEW PHONE ALIAS SCREEN +###################### + +if ($ADD==12111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
Ajouter un nouveau téléphone ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias ID:$NWB#phones-alias_id$NWE
Alias Nom: $NWB#phones-alias_name$NWE
Téléphone Connexions List: (comma separated)$NWB#phones-logins_list$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN +###################### + +if ($ADD==13111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
Ajouter un nouveau groupe ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Alias Groupe ID: $NWB#phones-group_alias_id$NWE
Nom du groupe Alias: $NWB#phones-group_alias_name$NWE
Nombre CallerID: $NWB#phones-caller_id_number$NWE
CallerID Nom: $NWB#phones-caller_id_name$NWE
Actif:
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=111111111111 display the ADD NEW SERVER SCREEN +###################### + +if ($ADD==111111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UN NOUVEAU SERVEUR\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID du serveur: $NWB#servers-server_id$NWE
Description du serveur: $NWB#servers-server_description$NWE
Adresse IP du serveur: $NWB#servers-server_ip$NWE
Actif: $NWB#servers-active$NWE
Version d'Asterisk: $NWB#servers-asterisk_version$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CONF TEMPLATE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $NWB#vicidial_conf_templates-template_id$NWE
Nom du modèle: $NWB#vicidial_conf_templates-template_name$NWE
Template Sommaire: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CARRIER\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Carrier ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Nom du transporteur: $NWB#vicidial_server_carriers-carrier_name$NWE
Inscription à cordes: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Entrée de compte: $NWB#vicidial_server_carriers-account_entry$NWE
Protocole: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entrée: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP du serveur: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + +###################### +# ADD=1111111111111 display the ADD NEW CONFERENCE SCREEN +###################### + +if ($ADD==1111111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
AJOUTER UNE NOUVELLE CONFERENCE\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Numéro de la conférence: (chiffres seulement)$NWB#conferences-conf_exten$NWE
IP du serveur: $NWB#conferences-server_ip$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
Numéro de la conférence: (chiffres seulement)$NWB#conferences-conf_exten$NWE
IP du serveur: $NWB#conferences-server_ip$NWE
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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") + { + 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 "
UTILISATEUR NON AJOUTE - il y a déjà un utilisateur dans le système avec ce numéro d'utilisateur\n";} + else + { + if (ereg('AUTOGENERA',$user)) + { + $user = 'AUTOGENERA'; + } + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + { + echo "
UTILISATEUR NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
user id must be between 2 and 10 characters long\n"; + echo "
le nom et le mot de passe doivent contenir au moins 2 caractères\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 "
UTILISATEUR AJOUTE: $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='UTILISATEURS', 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 = 'Active'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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") + { + 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 "
UTILISATEUR NON AJOUTE - il y a déjà un utilisateur dans le système avec ce numéro d'utilisateur\n";} + else + { + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + { + echo "
UTILISATEUR NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
user id must be between 2 and 10 characters long\n"; + echo "
le nom et le mot de passe doivent contenir au moins 2 caractères\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) 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 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='UTILISATEURS', event_type='COPY', record_id='$user', event_code='ADMIN UTILISATEUR DE COPY', 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 = 'Active'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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) + { + 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 "
CAMPAGNE NON AJOUTEE - il existe déjà une campagne dans le système avec cet ID\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 "
CAMPAIGN 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 "
CAMPAGNE NON AJOUTEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
l'ID de la campagne doit contenir entre 2 et 8 caractères\n"; + echo "
le nom de la campagne doit contenir entre 6 et 40 caractères\n"; + } + else + { + echo "
CAMPAGNE AJOUTEE: $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) 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='CAMPAGNES', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE', 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) + { + 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 "
CAMPAGNE NON AJOUTEE - il existe déjà une campagne dans le système avec cet 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 "
CAMPAGNE NON AJOUTEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
l'ID de la campagne doit contenir entre 2 et 8 caractères\n"; + echo "
source l'ID de la campagne doit contenir entre 2 et 8 caractères\n"; + } + else + { + echo "
CAMPAIGN 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) 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 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) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category 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='CAMPAGNES', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', 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';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUT DE LA CAMPAGNE NON AJOUTE - il y a déjà un statut de campagne dans le système avec ce nom\n";} + else + { + $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUT DE LA CAMPAGNE NON AJOUTE - il y a déjà un statut global dans le système avec ce nom\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) + { + echo "
STATUT DE LA CAMPAGNE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 8 caractères\n"; + echo "
le nom du statut doit contenir entre 2 et 30 caractères\n"; + } + else + { + echo "
STATUT DE LA CAMPAGNE AJOUTE: $campaign_id - $status\n"; + + $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$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='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE STATUS', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + 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 "
CAMPAIGN 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 "
RACCOURCI CLAVIER DE LA CAMPAGNE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
hotkey must be a single character between 1 and 9 \n"; + echo "
le statut doit contenir entre 1 et 8 caractères\n"; + } + else + { + echo "
RACOURCI CLAVIER DE LA CAMPAGNE AJOUTE: $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='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE HOTKEY', event_sql=\"$SQL_log\", event_notes='Etat: $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 "
RECYCLAGE DE FICHES DE LA CAMPAGNE NON AJOUTE - il y a déjà un recyclage de fiches pour cette campagne avec ce statut\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 "
CAMPAIGN LEAD RECYCLE NOT ADDED - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + echo "
le délai d'attente doit être au moins 120 secondes et moins de 43,200 secondes ou 12 heures\n"; + echo "
le nombre d'essais maximum doit être compris entre 1 et 10\n"; + } + else + { + echo "
RECYCLAGE DES FICHES DE LA CAMPAGNE AJOUTE: $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='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Etat: $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 "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF NON AJOUTE - il y a déjà un entrée pour cette campagne avec ce statut\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + } + else + { + echo "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF AJOUTE: $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='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE ALT DIAL', event_sql=\"$SQL_log\", event_notes='Etat: $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 "
CODE DE PAUSE NON AJOUTE - hay ya una entrada para esta campaña con este code\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) ) + { + echo "
CODE DE PAUSE NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + echo "
pause nom de code doit être compris entre 2 et 30 caractères\n"; + } + else + { + echo "
CODE DE PAUSE AJOUTE: $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='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Code de pause: $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 "
STATUT D'APPEL DE LA CAMPAGNE NON AJOUTE - il y a déjà un entrée pour cette campagne avec ce statut\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUT D'APPEL DE LA CAMPAGNE NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + } + else + { + echo "
STATUT D'APPEL POUR LA CAMPAGNE AJOUTE: $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='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Etat: $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) + { + 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 "
LISTE NON AJOUTEE - il y a déjà une liste avec ce nom dans le système\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or ($list_id < 100) or (strlen($list_id) > 8) ) + { + echo "
LISTE NON AJOUTEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la liste doit contenir entre 2 et 8 caractères\n"; + echo "
Le nom de la liste doit contenir au moins 2 caractères\n"; + echo "
ID de la liste must be greater than 100\n"; + } + else + { + echo "
LISTE AJOUTEE: $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='LISTES', 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) + { + 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 "
GROUPE NON AJOUTE - il y a déjà un groupe dans le système avec cet identifiant\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 "
GROUPE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID du groupe doit contenir entre 2 et 20 caractères et ne contenir aucun ' -+'.\n"; + echo "
Le nom et la couleur du groupe doivent contenir au moins 2 caractères\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) 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 "
GROUPE AJOUTE: $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 ENTRANT 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) + { + 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 "
GROUPE NON AJOUTE - il y a déjà un groupe dans le système avec cet identifiant\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 "
GROUPE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID du groupe doit contenir entre 2 et 20 caractères et ne contenir aucun ' -+'.\n"; + echo "
Le nom et la couleur du groupe doivent contenir au moins 2 caractères\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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $rslt=mysql_query($stmt, $link); + + echo "
GROUPE AJOUTE: $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 GROUPE D'ARRIVÉE DE COPY', 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 "
NE PAS AJOUTER - il ya déjà un DID dans le système avec cette ID\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 "
NE PAS AJOUTER - il ya déjà un DID dans le système avec cette extension\n";} + else + { + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) + { + echo "
NE PAS AJOUTER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
NE PAS AJOUTER - il ya déjà un DID dans le système avec cette extension\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 "
NE PAS AJOUTER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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) 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 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 COPY DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3311; + } + + +###################### +# 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 "
AGENT DISTANT NON AJOUTE - il y a déjà un agent distant avec cet identifiant\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENT DISTANT NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\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 "
AGENT DISTANT AJOUTE: $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) + { + 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 "
GROUP D'UTILISATEURS NON AJOUTE - il y a déjà un groupe d'utilisateurs avec ce nom\n";} + else + { + if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) + { + echo "
GROUPE D'UTILISATEURS NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le nom et la description du groupe doivent contenir au moins 2 caractères\n"; + } + else + { + $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAGNES-');"; + $rslt=mysql_query($stmt, $link); + + echo "
GROUPE D'UTILISATEURS AJOUTE: $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 AJOUTER UN GROUPE D'UTILISATEURS', 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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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) + { + 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 NON AJOUTE - il y a déjà un script existant avec ce nom\n";} + else + { + if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) + { + echo "
SCRIPT NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Les nom, description et texte du script doivent contenir au moins 2 caractères\n"; + } + else + { + $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','$script_text','$active');"; + $rslt=mysql_query($stmt, $link); + + echo "
SCRIPT AJOUTE: $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 AJOUTER UN 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) + { + 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 "
FILTRE NON AJOUTE - il y a déjà un filtre avec cet identifiant\n";} + else + { + if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) + { + echo "
FILTRE NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Identifiant du filtre, le nom et le SQL doivent au moins contenir 2 caractères\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='$lead_filter_sql';"; + $rslt=mysql_query($stmt, $link); + + echo "
FILTRE AJOUTE: $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='FILTRES', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN AJOUTER LE FILTRE', 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 "
DEFINITION DE LA PERIODE D'APPEL NON AJOUTEE - il existe déjà une période d'appel avec cet ID\n";} + else + { + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) + { + echo "
DEFINITION DE LA PERIODE D'APPEL NON AJOUTEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID et le nom de la période d'appel doivent contenir au moins 2 caractères\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); + + echo "
PERIODE D'APPELS AJOUTEE: $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 "
DEFINITION DE LA PERIODE D'APPELS DE L'ETAT NON AJOUTE - il existe déjà une période d'appel avec cet ID\n";} + else + { + if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) + { + echo "
DEFINITION DE LA PERIODE D'APPELS DE L'ETAT NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID, le nom et l'état de l'appel doivent contenir au moins 2 caractères\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); + + echo "
PERIODE D'APPELS D'ETAT AJOUTEE: $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) + { + 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 "
MAJ définition pas AJOUTÉS - il ya déjà un quart d'entrée avec cette 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 "
MAJ définition pas AJOUTÉS - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Shift ID et le nom doit être d'au moins 2 caractères\n"; + echo "
Start Time Shift 4 chiffres doit être de longueur et une heure valide\n"; + echo "
Shift Longueur doit être de 5 caractères de longueur et de 24 heures ou moins\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); + + echo "
SHIFT AJOUTÉS:$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) + { + 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 "
TELEPHONE NON AJOUTE - il y a déjà un téléphone dans le systéme avec cette extension/serveur\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 - il existe déjà un numéro de téléphone dans le système avec ce 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 - il existe déjà un numéro de téléphone alias dans le système avec ce login\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 "
TELEPHONE NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
TELEPHONE AJOUTE\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); + + ### 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 "
PAS DE TELEPHONE ALIAS AJOUTÉS - il existe déjà un numéro de téléphone Alias dans le système avec cette 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 "
PAS DE TELEPHONE ALIAS AJOUTÉS - il existe déjà un numéro de téléphone dans le système Connectez-vous avec cette ID\n";} + else + { + if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) + {echo "
PAS DE TELEPHONE ALIAS AJOUTÉS - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
PHONE ALIAS AJOUTÉS\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 PHONE ALIAS', 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 "
GROUPE ALIAS pas ajouté - il existe déjà un numéro de téléphone Alias dans le système avec cette ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) + {echo "
GROUPE ALIAS pas ajouté - vous ne pouvez pas utiliser des mots réservés dans le groupe des alias\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
GROUPE ALIAS pas ajouté - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
GROUPE ALIAS AJOUTÉS\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 "
SERVEUR NON AJOUTE - il y a déjà un serveur dans le système avec cet ID\n";} + else + { + if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) + {echo "
SERVEUR NON AJOUTE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
SERVEUR AJOUTE\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); + + ### 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 "
TRUNK DU SERVEUR VICIDIAL NON AJOUTE - le nombre de trunks vicidial est trop important: $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 "
TRUNK DU SERVEUR VICIDIAL NON AJOUTE - il y a déjà un trunk-serveur enregistré pour cette campagne\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) ) + { + echo "
TRUNK DU SERVEUR VICIDIAL NON AJOUTE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
la campagne doit contenir entre 3 et 8 caractères\n"; + echo "
le délai du server_ip doit contenir au moins 7 caractères\n"; + echo "
les trunks doivent être un nombre entre 0 et 9999\n"; + } + else + { + echo "
TRUNK DU SERVEUR VICIDIAL AJOUTE: $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 SERVEUR 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 "
CONF TEMPLATE pas ajouté - il existe déjà un modèle dans le système avec cette ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
CONF TEMPLATE pas ajouté - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
CONF TEMPLATE AJOUTÉS\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 "
CARRIER pas ajouté - il ya déjà un transporteur dans le système avec cette ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
CARRIER pas ajouté - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $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='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=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 "
CONFERENCE NON AJOUTEE - il y a déjà une conférence dans le système avec cet ID\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
CONFERENCE NON AJOUTEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
CONFERENCE AJOUTEE\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 CONFERENCE NON AJOUTEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
VICIDIAL CONFERENCE AJOUTEE\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';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUT DE SYSTÈME NON SUPPLÉMENTAIRE - 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';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
STATUT DE SYSTÈME NON SUPPLÉMENTAIRE - there is already a global-status in the system with this name\n";} + else + { + if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) + { + echo "
STATUT DE SYSTÈME NON SUPPLÉMENTAIRE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 8 caractères\n"; + echo "
le nom du statut doit contenir entre 2 et 30 caractères\n"; + } + else + { + echo "
STATUT DE SYSTÈME SUPPLÉMENTAIRE: $status_name - $status\n"; + + $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$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='SYSTEMSTATUSES', event_type='ADD', record_id='$status', 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 "
CATÉGORIE DE STATUT NON SUPPLÉMENTAIRE - il y a déjà une catégorie de statut dans le système avec cetteidentification: $row[0]\n";} + else + { + if ( (strlen($vsc_id) < 2) or (strlen($vsc_id) > 20) or (strlen($vsc_name) < 2) ) + { + echo "
CATÉGORIE DE STATUT NON SUPPLÉMENTAIRE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'identification doit être entre 2 et 20 caractères de longueur\n"; + echo "
le nom nommé doit être entre 2 et 50 caractères de longueur\n"; + } + else + { + echo "
STATUS CATÉGORIE 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 "
ERREUR : Il y a déjà ensemble de 4 catégories de statut àl'affichage de 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 CATÉGORIE', 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 "
QC CODE ÉTAT PAS AJOUTÉS- il existe déjà un code de statut qc dans le système avec ce nom: $row[0]\n";} + else + { + if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) + { + echo "
QC CODE ÉTAT PAS AJOUTÉS- Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
code doit être compris entre 1 et 8 caractères\n"; + echo "
nom de code doit être compris entre 2 et 30 caractères\n"; + } + else + { + echo "
QC ÉTAT CODE AJOUTEE:$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='QCSTATUSES', 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 "
UTILISATEUR NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le mot de passe et le nom complet doivent chacun contenir au moins 2 caractères\n"; + } + else + { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } + echo "
UTILISATEUR MODIFIE - 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' 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='UTILISATEURS', 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 = 'Active'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 "Vous n'avez pas la permission de voir cette page\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 "
UTILISATEUR NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le mot de passe et le nom complet doivent chacun contenir au moins 2 caractères\n"; + } + else + { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } + echo "
UTILISATEUR MODIFIE - 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' 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='UTILISATEURS', 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 = 'Active'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 "Vous n'avez pas la permission de voir cette page\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 "
UTILISATEUR NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le mot de passe et le nom complet doivent chacun contenir au moins 2 caractères\n"; + } + else + { + echo "
UTILISATEUR MODIFIE: $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' 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='UTILISATEURS', 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 = 'Active'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 "Vous n'avez pas la permission de voir cette page\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 = '8300'; + $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'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
LISTES D'ACTIFS MODIFIES"; + $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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', 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 "
CAMPAGNE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
le nom de la campagne doit contenir au moins 6 caractères\n"; + echo "
|$campaign_name|$active|\n"; + } + else + { + echo "
CAMPAGNE MODIFIEE: $campaign_id\n"; + + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + 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' where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + if ($reset_hopper == 'Y') + { + echo "
REINITIALISATION DU DISTRIBUTEUR DE FICHES DE LA CAMPAGNE\n"; + echo "
- Attendre 1 minute avant l'appel du numéro suivant\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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN 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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
STAUT DE LA CAMPAGNE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la campagne doit contenir au moins 2 caractères\n"; + echo "
Le statut de la campagne doit contenir au moins 1 caractère\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
STATUT PERSONNALISE DE LA CAMPAGNE SUPPRIME: $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='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
LE STATUT FAIT SUR COMMANDE DE CAMPAGNE A MODIFIÉ: $campaign_id - $status\n"; + + $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
RACCOURCI CLAVIER DE LA CAMPAGNE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la campagne doit contenir au moins 2 caractères\n"; + echo "
Le statut de la campagne doit contenir au moins 1 caractère\n"; + echo "
the campaign hotkey needs to be at least 1 characters in length\n"; + } + else + { + echo "
RACCOURCI CLAVIER PERSONNALISE DE LA CAMPAGNE SUPPRIME: $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='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Etat: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 = '8300'; + $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 "
LISTES D'ACTIFS MODIFIES"; + $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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', 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 "
CAMPAGNE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
le nom de la campagne doit contenir au moins 6 caractères\n"; + } + else + { + echo "
CAMPAGNE MODIFIEE: $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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + if ($reset_hopper == 'Y') + { + echo "
REINITIALISATION DU DISTRIBUTEUR DE FICHES DE LA CAMPAGNE\n"; + echo "
- Attendre 1 minute avant l'appel du numéro suivant\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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + echo "
le délai d'attente doit être au moins 120 secondes et moins de 43,200 secondes ou 12 heures\n"; + echo "
le nombre d'essais maximum doit être compris entre 1 et 10\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CODE DE PAUSE NON MODIFIE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
pause_code must be between 1 and 6 characters in length\n"; + echo "
pause_nom de code doit être compris entre 2 et 30 caractères\n"; + } + else + { + echo "
AGENT 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='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
QC SETTINGS PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
QC SETTINGS mise à jour: $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='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
SONDAGE SETTINGS PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + } + else + { + echo "
SONDAGE SETTINGS mise à jour: $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' 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='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
MÉLANGE DE LISTE NON MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
LE MÉLANGE DE LISTE A MODIFIÉ: $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 "
MÉLANGE DE LISTE NON MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
LE MÉLANGE DE LISTE A MODIFIÉ: $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 "
MÉLANGE DE LISTE NON MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
MÉLANGE DE LISTE NON MODIFIÉ: Vous ne pouvez pas supprimer la dernière entrée de list_id d'unmélange de liste\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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
LE MÉLANGE DE LISTE A MODIFIÉ: $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 "
MÉLANGE DE LISTE NON SUPPLÉMENTAIRE- Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
MÉLANGE DE LISTE NON SUPPLÉMENTAIRE- Il y a déjà un mélange de liste avec cette identification dans lesystème\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='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE LIST MIX', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MÉLANGE DE LISTE SUPPLÉMENTAIRE :$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 "
MÉLANGE DE LISTE NON SUPPRIMÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
LE MÉLANGE DE LISTE A SUPPRIMÉ :$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 "
MÉLANGE DE LISTE NON ACTIVÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='Liste Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
MÉLANGE DE LISTE ACTIVÉ: $campaign_id - $vcl_id - $vcl_name\n"; + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
LISTE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
le nom de la liste doit contenir au moins 2 caractères\n"; + } + else + { + echo "
LISTE MODIFIEE: $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' 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='LISTES', 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 "
REINITIALISATION LIST-CALLED-STATUS\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='LISTES', 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 "
ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($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 "Vous n'avez pas la permission de voir cette page\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 "
GROUPE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
le nom et la couleur du groupe doivent contenir au moins 2 caractères\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 "
GROUPE MODIFIE: $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' 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 "Vous n'avez pas la permission de voir cette page\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 "
NE MODIFIE PAS - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
did_extension must be at least 1 character in length\n"; + } + else + { + echo "
DID mise à jour: $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' 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 "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +$ADD=3311; # go to did 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 "
AGENT DISTANT NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le début de l'ID de l'utilisateur et l'extension externe doivent contenir au moins 2 caractères\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 "
AGENTS DISTANTS MODIFIES\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 "Vous n'avez pas la permission de voir cette page\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 "
GROUPE D'UTILISATEURS NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n"; + echo "
Le nom et la description du groupe doivent contenir au moins 2 caractères\n"; + } + else + { + $p=0; + $GROUP_shifts=' '; + $group_shifts_ct = count($group_shifts); + while ($p <= $group_shifts_ct) + { + $GROUP_shifts .= "$group_shifts[$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' where user_group='$OLDuser_group';"; + $rslt=mysql_query($stmt, $link); + + echo "
GROUPE D'UTILISATEURS MODIFIE\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 GROUPE D'UTILISATEURS', 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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 "Vous n'avez pas la permission de voir cette page\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 NON MODIFIE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Les nom, description et texte du script doivent contenir au moins 2 caractères\n"; + } + else + { + $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='$script_text', active='$active' where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
SCRIPT MODIFIE\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 "Vous n'avez pas la permission de voir cette page\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 ""; + + if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) + { + echo "
FILTRE NON MODIFIE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Identifiant du filtre, le nom et le SQL doivent au moins contenir 2 caractères\n"; + } + else + { + $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
FILTRE MODIFIE\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='FILTRES', 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 "Vous n'avez pas la permission de voir cette page\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 "
PERIODE D'APPELS NON MODIFIEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID et le nom de la période d'appel doivent contenir au moins 2 caractères\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 "
PERIODE D'APPELS MODIFIEE\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 "Vous n'avez pas la permission de voir cette page\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 "
PERIODE D'APPELS D'ETAT NON MODIFIEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID, le nom et l'état de l'appel doivent contenir au moins 2 caractères\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 "
PERIODE D'APPELS D'ETAT MODIFIEE\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 "Vous n'avez pas la permission de voir cette page\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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Shift ID et le nom doit être d'au moins 2 caractères\n"; + echo "
Start Time Shift 4 chiffres doit être de longueur et une heure valide\n"; + echo "
Shift Longueur doit être de 5 caractères de longueur et de 24 heures ou moins\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 "
MAJ mise à jour\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 "Vous n'avez pas la permission de voir cette page\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 "
TELEPHONE NON MODIFIE - il y a déjà un téléphone dans le système avec cette extension/server\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 "
TELEPHONE NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
TELEPHONE MODIFIE: $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' 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 MODIFIER LE TELEPHONE', event_sql=\"$SQL_log\", event_notes='IP du serveur: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
PHONE ALIAS PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
PHONE ALIAS mise à jour: $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 MODIFIER LE TELEPHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
GROUPE ALIAS PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
GROUPE ALIAS mise à jour: $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 Modifier un groupe ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
SERVEUR 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 "
SERVEUR NON MODIFIE - il y a déjà un serveur dans le système avec cet ID\n";} + else + { + if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) + {echo "
SERVEUR NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
SERVEUR MODIFIE: $server_ip\n"; + + $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' where server_id='$old_server_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); + + ### 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 MODIFIER LE SERVEUR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
TRUNK DU SERVEUR VICIDIAL NON AJOUTE - le nombre de trunks vicidial est trop important: $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 "
TRUNK DU SERVEUR VICIDIAL NON MODIFIE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
la campagne doit contenir entre 3 et 8 caractères\n"; + echo "
le délai du server_ip doit contenir au moins 7 caractères\n"; + echo "
les trunks doivent être un nombre entre 0 et 9999\n"; + } + else + { + echo "
TRINK DU SERVEUR VICIDIAL MODIFIE: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\n"; + + $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); + + ### 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='SERVERMalles', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN MODIFIER LE SERVEUR TRUNK', event_sql=\"$SQL_log\", event_notes='Campagne: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CONF TEMPLATE PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $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); + + ### 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 MODIFY CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CARRIER PAS mise à jour - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
CARRIER mise à jour: $carrier_id\n"; + + $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' 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); + + ### 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 MODIFY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +$ADD=341111111111; # go to carrier 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 "
CONFERENCE NON MODIFIEE - il y a déjà une conférence dans le système avec cette extension-serveur\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
CONFERENCE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
CONFERENCE MODIFIEE: $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 "Vous n'avez pas la permission de voir cette page\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 CONFERENCE NON MODIFIEE - il y a déjà une conférence dans le système avec cette extension-serveur\n";} + else + { + if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) + {echo "
VICIDIAL CONFERENCE NON MODIFIEE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\n";} + else + { + echo "
VICIDIAL CONFERENCE MODIFIEE: $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 "Vous n'avez pas la permission de voir cette page\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 "
REGLAGES DU SYSTEME VICIDIAL MODIFIES\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';"; + $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 "Vous n'avez pas la permission de voir cette page\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 "
STATUT DE SYSTÈME NON SUPPRIMÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut de système ne peut pas être un statut réservé :B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
le statut de système doit être au moins les caractères 1 delongueur\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='SYSTEMSTATUSES', 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 "
STATUT DE SYSTÈME NON MODIFIÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut de système doit être au moins les caractères 1 delongueur\n"; + echo "
le nom de statut de système doit être au moins les caractères 1 delongueur\n"; + } + else + { + echo "
LE STATUT DE SYSTÈME A MODIFIÉ: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='SYSTEMSTATUSES', 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 "Vous n'avez pas la permission de voir cette page\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 "
CATÉGORIE DE STATUT NON MODIFIÉE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
la catégorie de statut ne peut pas être une catégorie réservée :UNDEFINED\n"; + echo "
la catégorie de statut doit être au moins 2 caractères de longueur\n"; + } + else + { + if (ereg('delete',$stage)) + { + echo "
LA CATÉGORIE DE STATUT A SUPPRIMÉ: $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 CATÉGORIE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + if (ereg('modify',$stage)) + { + echo "
LA CATÉGORIE DE STATUT A MODIFIÉ: $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 "
ERREUR : Il y a déjà ensemble de 4 catégories de statut àl'affichage de 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 CATÉGORIE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
QC CODE ÉTAT PAS SUPPRIMÉ - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; + echo "
qc le code de statut doit être au moins de 1 caractères\n"; + } + else + { + echo "
QC ÉTAT CODE DELETED:$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 "
QC CODE ÉTAT PAS mise à jour- Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
qc le code de statut doit être au moins de 1 caractères\n"; + echo "
qc le nom de code de statut doit être au moins de 1 caractères\n"; + } + else + { + echo "
QC ÉTAT CODE mise à jour:$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 "Vous n'avez pas la permission de voir cette page\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 "
UTILISATEUR NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Utilisateur be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DE L'UTILISATEUR: $user\n"; + echo "

Cliquez ici pour supprimer cet utilisateur $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 "
CAMPAGNE NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DE LA CAMPAGNE: $campaign_id\n"; + echo "

Cliquez ici pour supprimer cette campagne $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 "
AGENTS NON DECONNECTES DE LA CAMPAGNE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA DECONNECTION DE L'AGENT: $campaign_id\n"; + echo "

Cliquez ici pour déconnecter tous les agents de $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 NON EFFACE POUR LA CAMPAGNE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE L'EFFACEMENT DE VDAC: $campaign_id\n"; + echo "

Cliquez ici pour effacer les plus vieux enregistrements LIVE dans VDAC pour $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 "
LISTE NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
List_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DE LA LISTE: $list_id\n"; + echo "

Cliquez ici pour supprimer cette liste et toutes ses fiches $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 "
IN-GROUP NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Group_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DU IN-GROUP: $group_id\n"; + echo "

Cliquer ici pour supprimer le in-group $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 "
NE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
did_id be at least 1 characters in length\n"; + } + else + { + echo "
A DELETION CONFIRMATION: $group_id\n"; + echo "

Cliquez ici pour supprimerDID $did_id


\n"; + } + +$ADD='3311'; # go to did 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 "
AGENT DISTANT NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DE L'AGENT DISTANT: $remote_agent_id\n"; + echo "

Cliquez ici pour supprimer l'agent distant $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 "
GROUPE D'UTILISATEUR NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Utilisateur_group be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DU GROUPE D'UTILISATEURS: $user_group\n"; + echo "

Cliquez ici pour supprimer le groupe d'utilisateurs $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 NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Script_id must be at least 2 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DU SCRIPT: $script_id\n"; + echo "

Cliquez ici pour supprimer le 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 "
FILTRE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'identifiant du filtre doit contenir au moins 2 caractères\n"; + } + else + { + echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; + echo "

Cliquez ici pour effacer le filtre$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 "
PERIODE D'APPELS NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la période d'appels doit contenir au moins 2 caractères\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESION DE LA PERIODE D'APPELS: $call_time_id\n"; + echo "

Cliquez ici pour supprimercall 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 "
PERIODE D'APPELS D'ETAT NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la période d'appels doit contenir au moins 2 caractères\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DE LA PERIODE D'APPELS D'ETAT: $call_time_id\n"; + echo "

Cliquez ici pour supprimerstate 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 "
MAJ pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Shift ID must be at least 2 characters in length\n"; + } + else + { + echo "
SHIFT DELETION CONFIRMATION:$shift_id\n"; + echo "

Cliquez ici pour supprimer le passage $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 "
TELEPHONE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP du serveur be at least 7 characters in length\n"; + } + else + { + echo "
CONFIRMATION DE LA SUPPRESSION DU TELEPHONE: $extension - $server_ip\n"; + echo "

Cliquez ici pour supprimer le téléphone $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 "
PHONE ALIAS pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
PHONE ALIAS DELETION CONFIRMATION: $alias_id\n"; + echo "

Cliquez ici pour supprimer le téléphone alias $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 "
GROUPE ALIAS pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Alias Groupe ID must be at least 2 characters in length\n"; + } + else + { + echo "
GROUPE ALIAS DELETION CONFIRMATION: $group_alias_id\n"; + echo "

Cliquez ici pour supprimer le groupe alias $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 "
SERVEUR NOT DELETED - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
ID du serveur be at least 2 characters in length\n"; + echo "
IP du serveur be at least 7 characters in length\n"; + } + else + { + echo "
SERVEUR DELETION CONFIRMATION: $server_id - $server_ip\n"; + echo "

Cliquez ici pour supprimer le téléphone $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 "
CONF TEMPLATE pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Template ID être d'au moins 2 caractères\n"; + } + else + { + echo "
CONF TEMPLATE DELETION CONFIRMATION: $template_id - $template_name\n"; + echo "

Cliquez ici pour supprimer le modèle 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 "
CARRIER pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Carrier ID être d'au moins 2 caractères\n"; + } + else + { + echo "
SUPPRESSION DE SUPPORT DE CONFIRMATION: $carrier_id - $carrier_name\n"; + echo "

Cliquez ici pour supprimer le transporteur $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier 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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Conference must be at least 2 characters in length\n"; + echo "
IP du serveur be at least 7 characters in length\n"; + } + else + { + echo "
CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; + echo "

Cliquez ici pour supprimer le téléphone $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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Conference must be at least 2 characters in length\n"; + echo "
IP du serveur be at least 7 characters in length\n"; + } + else + { + echo "
VICIDIAL CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; + echo "

Cliquez ici pour supprimer le téléphone $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 "
UTILISATEUR NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Utilisateur 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='UTILISATEURS', 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 "
SUPPRESSION DE L'UTILISATEUR CONFIRMEE: $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 "
CAMPAGNE NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_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 "
ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($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='CAMPAGNES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
SUPRESSION DE LA CAMPAGNE CONFIRMEE: $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 "
AGENTS NON DECONNECTES DE LA CAMPAGNE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_live_agents 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='CAMPAGNES', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
Déconnection des agents terminée: $campaign_id\n"; + echo "

\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 NON EFFACE POUR LA CAMPAGNE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Campagne_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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
DERNIER ENREGISTREMENT VDAC DE LA CAMPAGNE EFFACE: $campaign_id\n"; + echo "

\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
RECYCLAGE DES FICHES DE LA CAMPAGNE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + echo "
le délai d'attente doit être au moins 120 secondes\n"; + echo "
le nombre d'essais maximum doit être compris entre 1 et 10\n"; + } + else + { + echo "
RECYCLAGE DES FICHES DE LA CAMPAGNE SUPPRIME: $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='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF NON SUPPRIME - ce statut d'appel automatique du numéro alternatif n'est pas dans cette campagne\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + } + else + { + echo "
STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF SUPPRIME: $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='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CODE DE PAUSE DE LA CAMPAGNE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Etat: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
STATUT D'APPEL POUR CETTE CAMPAGNE NON SUPPRIME - ce statut d'appel n'est pas selectionné pour cette campagne\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + { + echo "
STATUT D'APPEL POUR CETTE CAMPAGNE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
le statut doit contenir entre 1 et 6 caractères\n"; + } + else + { + echo "
STATUT D'APPEL POUR CETTE CAMPAGNE SUPPRIME: $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='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Etat: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
LISTE NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
ENLEVER LES FICHES DU VIEUX DISTRIBUTEUR DE FICHES DE LA CAMAPGNE ($list_id)\n"; + $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
SUPPRIMER LES FICHES DE LA LISTE DE LA TABLE 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='LISTES', 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 "
SUPPRESSION DE LA LISTE CONFIRMEE: $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 "
IN-GROUP NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
SUPPRESSION DU IN-GROUP TERMINEE: $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 "
NE PAS SUPPRIMER - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
A DELETION ACCOMPLIES: $did_id\n"; + echo "

\n"; + } + + $ADD='1300'; # go to did 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 "
AGENT DISTANT NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
SUPPRESSION DE L'AGENT DISTANT CONFIRMEE: $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 "
GROUPE D'UTILISATEUR NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Utilisateur_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 GROUPE D'UTILISATEURS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
SUPPRESSION DU GROUPE D'UTILISATEURS TERMINEE: $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 NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
SUPPRESSION DU SCRIPT TERMINEE: $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 "
FILTRE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'identifiant du filtre doit contenir au moins 2 caractères\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='FILTRES', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE FILTRES', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EFFACEMENT DU FILTRE TERMINE: $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 "
PERIODE D'APPELS NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la période d'appels doit contenir au moins 2 caractères\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 "
SUPPRESSION DE LA PERIODE D'APPELS TERMINEE: $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 "
PERIODE D'APPELS D'ETAT NON SUPPRIMEE - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
L'ID de la période d'appels doit contenir au moins 2 caractères\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 "Règle d'état supprimée: $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 "
SUPPRESSION DE LA PERIODE D'APPELS D'ETAT TERMINEE: $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 "
MAJ pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 "
SHIFT DELETION ACHEVES: $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 "
TELEPHONE NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP du serveur 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); + + ### 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 "
SUPPRESSION DU TELEPHONE TERMINEE: $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 "
PHONE ALIAS pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\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 DELETE PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
PHONE ALIAS DELETION ACCOMPLIES: $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 "
GROUPE ALIAS pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Alias Groupe ID 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 DELETE GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
GROUPE ALIAS DELETION ACCOMPLIES: $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 "
SERVEUR NOT DELETED - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
ID du serveur be at least 2 characters in length\n"; + echo "
IP du serveur 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 "
SERVEUR 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 "
TRUNK DU SERVEUR VICIDIAL NON SUPPRIME - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
la campagne doit contenir entre 3 et 8 caractères\n"; + echo "
le délai du server_ip doit contenir au moins 7 caractères\n"; + } + else + { + echo "
TRUNK DU SERVEUR VICIDIAL SUPPRIME: $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='SERVERMalles', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE SERVEUR TRUNK', event_sql=\"$SQL_log\", event_notes='Campagne: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
CONF TEMPLATE pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Template ID être d'au moins 2 caractères\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 DELETE CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONF TEMPLATE DELETION ACCOMPLIES: $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 "
CARRIER pas supprimé - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Carrier ID être d'au moins 2 caractères\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 DELETE CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CARRIER SUPPRESSION ACCOMPLIES: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier 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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP du serveur 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 - Veuillez retourner en arrière et vérifier les données que vous avez saisies\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP du serveur 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 * from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $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]; + + if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) + { + echo "
Vous n'avez pas les permissions pour modifier cet utilisateur: $row[1]\n"; + } + else + { + echo "
MODIFIER UN ENREGISTREMENT D'UTILISATEURS: $row[1]\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"; + + if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) + { + 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"; + 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"; + + 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 "
Numéro d'utilisateur : $row[1]$NWB#vicidial_users-user$NWE
Mot de passe:$NWB#vicidial_users-pass$NWE
Nom complet: $NWB#vicidial_users-full_name$NWE
Niveau de l'utilisateur: $NWB#vicidial_users-user_level$NWE
Groupe utilisateur: $NWB#vicidial_users-user_group$NWE
Login du téléphone: $NWB#vicidial_users-phone_login$NWE
Mot de passe du téléphone: $NWB#vicidial_users-phone_pass$NWE
Actif: $NWB#vicidial_users-active$NWE
OPTIONS DE L'INTERFACE DE L'AGENT:
L'agent choisit les Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
Racourccis clavier actifs: $NWB#vicidial_users-hotkeys_active$NWE
Rappels de service programmés: $NWB#vicidial_users-scheduled_callbacks$NWE
Rappels de service d'agent-seulement: $NWB#vicidial_users-agentonly_callbacks$NWE
Appel manuel de l'agent: $NWB#vicidial_users-agentcall_manual$NWE
Enregistrement Vicidial: $NWB#vicidial_users-vicidial_recording$NWE
Transferts Vicidial: $NWB#vicidial_users-vicidial_transfers$NWE
Closer Default Blended: $NWB#vicidial_users-closer_default_blended$NWE
Ecrasement de l'enregistrment VICIDIAL:$NWB#vicidial_users-vicidial_recording_override$NWE
Modifications des données des clients pour l'agent: $NWB#vicidial_users-alter_custdata_override$NWE
Alter Agent Client Téléphone Override:$NWB#vicidial_users-alter_custphone_override$NWE
Agent de l'exécution Shift Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alerte Enabled: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Rangs De Campagne :$NWB#vicidial_users-campaign_ranks$NWE
\n"; + echo "\n"; + echo "$RANKcampaigns_list"; + echo "
\n"; + echo "
Groupes entrants: $NWB#vicidial_users-closer_campaigns$NWE
\n"; + echo "\n"; + echo "$RANKgroups_list"; + echo "
\n"; + echo "
QC Enabled:$NWB#vicidial_users-qc_enabled$NWE
QC Niveau de l'utilisateur:$NWB#vicidial_users-qc_user_level$NWE
QC Pass:$NWB#vicidial_users-qc_pass$NWE
QC Finition:$NWB#vicidial_users-qc_finish$NWE
QC Comité:$NWB#vicidial_users-qc_commit$NWE
OPTIONS DE L'INTERFACE D'ADMINISTRATION:
Voir les rapports: $NWB#vicidial_users-view_reports$NWE
Changer les options de l'interface de l'agent: $NWB#vicidial_users-alter_agent_interface_options$NWE
Modifier les utilisateurs: $NWB#vicidial_users-modify_sections$NWE
Changer l'agent de campagne: $NWB#vicidial_users-change_agent_campaign$NWE
Supprimer les utilisateurs: $NWB#vicidial_users-delete_users$NWE
Modifier les groupes d'utilisateurs: $NWB#vicidial_users-modify_sections$NWE
Supprimer les groupes utilisateurs: $NWB#vicidial_users-delete_user_groups$NWE
Modifier les listes: $NWB#vicidial_users-modify_sections$NWE
Supprimer les listes: $NWB#vicidial_users-delete_lists$NWE
Charger des fiches: $NWB#vicidial_users-load_leads$NWE
Modifier les fiches: $NWB#vicidial_users-modify_leads$NWE
Listes de téléchargement: $NWB#vicidial_users-modify_leads$NWE
Rapports d'exportation: $NWB#vicidial_users-export_reports$NWE
Modifier les campagnes: $NWB#vicidial_users-modify_sections$NWE
Détails de la campagne: $NWB#vicidial_users-campaign_detail$NWE
Supprimer les campagnes: $NWB#vicidial_users-delete_campaigns$NWE
Modifier les In-Groups: $NWB#vicidial_users-modify_sections$NWE
Supprimer les in-groups: $NWB#vicidial_users-delete_ingroups$NWE
Modifier DiDs:$NWB#vicidial_users-modify_sections$NWE
Supprimer DiDs:$NWB#vicidial_users-delete_ingroups$NWE
Modifier les agents distants: $NWB#vicidial_users-modify_sections$NWE
Supprimer les agents distants: $NWB#vicidial_users-delete_remote_agents$NWE
Modifier les scripts: $NWB#vicidial_users-modify_sections$NWE
Supprimer les scriptss: $NWB#vicidial_users-delete_scripts$NWE
Modifier les filtres: $NWB#vicidial_users-modify_sections$NWE
Supprimer le filtres: $NWB#vicidial_users-delete_filters$NWE
Accès administateur de l'AGC: $NWB#vicidial_users-ast_admin_access$NWE
Supprimer les téléphones AGC: $NWB#vicidial_users-ast_delete_phones$NWE
Modifier la période d'appelss: $NWB#vicidial_users-modify_call_times$NWE
SupprimerPériodes d'appels: $NWB#vicidial_users-delete_call_times$NWE
Modifier les serveurs: $NWB#vicidial_users-modify_sections$NWE
Agent API d'accès:$NWB#vicidial_users-vdc_agent_api_access$NWE
Ajouter Log timeclock Record: $NWB#vicidial_users-add_timeclock_log$NWE
Modifier timeclock journal Record: $NWB#vicidial_users-modify_timeclock_log$NWE
Supprimer timeclock journal Record: $NWB#vicidial_users-delete_timeclock_log$NWE
Shift Manager exécution Override: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; + + if ($LOGdelete_users > 0) + { + echo "

SUPPRIMER CET UTILISATEUR\n"; + } + echo "

Cliquez ici pour la feuille de présence de l'utilisateur\n"; + echo "

Cliquez ici pour les statuts utilisateur\n"; + echo "

Cliquez ici pour les statistiques de l'utilisateur\n"; + echo "

Cliquez ici pour l'utilisateur de plusieurs jours le statut de détails rapport\n"; + echo "

Cliquez ici pour les rappels reservés à cet utilisateur\n"; + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce record
\n"; + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=31 modify campaign info in the system - Detail view +###################### + +if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed + +if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAGNES",$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 * 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]; + + 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 * 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]: Basic Détail StatutsHotKeysLead RecyclingAuto Alt DialListe MixSondagePause CodesQC Real-Time
\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"; + 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 "SUPPRIMER\n"; + } + } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + 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"; + + echo "\n"; + + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + 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"; + + 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"; + } + else + { + 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 de la campagne: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
Description de la campagne: $NWB#vicidial_campaigns-campaign_description$NWE
Campagne Changement Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Actif: $NWB#vicidial_campaigns-active$NWE
Extension du parc: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Formulaire Web: $NWB#vicidial_campaigns-web_form_address$NWE
Formulaire Web Public: $NWB#vicidial_campaigns-web_form_target$NWE
Autoriser les closers: $NWB#vicidial_campaigns-allow_closers$NWE
Permettez d'arrivée et mélangé :$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Statut d'appel$o: \n"; + + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Etat:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordre de la liste: $NWB#vicidial_campaigns-lead_order$NWE
Liste Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtre de la fiche: $NWB#vicidial_campaigns-lead_filter_id$NWE
Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
Forcer la réinitialisation du distributeur de fiches: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
Niveau de l'appel automatique: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       ADAPTER LE DEPASSEMENT
Valable seulement pour les contrôles: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Pourcentage limite d'abandon: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Adaptation maximum du niveau de l'appel: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Heure max du serveur: 4 chiffres seulement $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapter le modificateur d'intensité: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Différence cible du niveau d'appel: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferts concurents: $NWB#vicidial_campaigns-concurrent_transfers$NWE
File d'attente de priorité: $NWB#vicidial_campaigns-queue_priority$NWE
Appeler automatiquement le numéro alternatif: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Appeler l'agent suivant : $NWB#vicidial_campaigns-next_agent_call$NWE
Heure d'appel locale: $NWB#vicidial_campaigns-local_call_time$NWE
Délai de tentative d'appel: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Préfixe de numérotation: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omettre le phone code: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID de la campagne: $NWB#vicidial_campaigns-campaign_cid$NWE
Exten VDAD de la campagne: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extension d'enregistrement de la campagne: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Enregistrement de la campagne: $NWB#vicidial_campaigns-campaign_recording$NWE
Nom du fichier d'enregistrement de la campagne: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Délai d'enregistrement: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Lancer l'appel: $NWB#vicidial_campaigns-get_call_launch$NWE
Message de répondeur: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD envoyé au VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
CPD AMD Action: $NWB#vicidial_campaigns-cpd_amd_action$NWE
DTMF Transfert-Conf 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
numéro de Transfer-Conf 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
DTMF Transfert-Conf 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
numéro de Transfer-Conf 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Appel du numéro alternatif: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Rappels de service programmés: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Temps avant abandon de l'appel: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Drop d'action:$NWB#vicidial_campaigns-drop_action$NWE
Extension du port sûr: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Boîte vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop de transfert du Groupe:$NWB#vicidial_campaigns-drop_inbound_group$NWE
Temps de conclusion: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Message de conclusion: $NWB#vicidial_campaigns-wrapup_message$NWE
Utiliser la liste DNC interne: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Utilisez la liste de campagne DNC: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentCodes De PauseActif: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campagne Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Désactiver la modification des données d'un client$NWB#vicidial_campaigns-disable_alter_custdata$NWE
Désactiver Alter clientèle Téléphone:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Autoriser la connection dans les distributeurs vides: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Agent Chef de file d'attente d'affichage:$NWB#vicidial_campaigns-display_queue_count$NWE
Identification Manuelle De Liste De Cadran :$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manuelle Filter:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Agent de copie d'écran du Presse-papiers: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agent Screen Extended Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Way Outbound Call CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Way Call Préfixe de numérotation: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Groupe Alias permis: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Groupe par défaut Alias: $NWB#vicidial_campaigns-default_group_alias$NWE
Vtiger Recherche Catégorie: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Vtiger Créer Enregistrement d'appel: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Vtiger Créer Lead Enregistrement: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Vtiger Screen Login: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
Groupes entrants autorisés:
"; + echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; + echo "$groups_list"; + echo "
Groupe De Transfert De Défaut :$NWB#vicidial_campaigns-default_xfer_group$NWE
Groupes Laissés De Transfert :
"; + 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 "
LISTES DANS CETTE CAMPAGNE:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIFLAST CALL DATEMODIFIER
$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]MODIFIER

\n"; + + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

\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,$fSQL); + echo " - CACHER

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

"; + } + + $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 "Cette campagne a $hopper_leads fiches dans le distributeur de fiches

\n"; + echo "Cliquez ici pour voir quelles fiches sont dans le distributeur à l'instant

\n"; + echo "Cliquez ici pour voir une VDAD rapport de cette campagne

\n"; + } + echo "Cliquez ici pour voir les rappels réservés de cette campagne

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

Cliquez ici pour voir Admin chages à cette campagne
\n"; + } + echo "
\n"; + } + + + ##### CAMPAIGN CUSTOM STATUSES ##### + 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 "
STATUTS PERSONNALISES DANS CETTE CAMPAGNE:   $NWB#vicidial_campaign_statuses$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT * 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 "
ETATDESCRIPTIONSELECTIONABLERÉPONSE HUMAINESUPPRIMER
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$rowx[0]
\n"; + echo "\n"; + echo "         \n"; + echo "   \n"; + echo "SUPPRIMER\n"; + echo "
\n"; + + echo "
AJOUTER UN NOUVEAU STATUT DE CAMPAGNE PERSONNALISE
\n"; + echo "\n"; + echo "\n"; + echo "Etat:   \n"; + echo "Description:   \n"; + echo "Selectionnable:   \n"; + echo "Réponse de l'homme:   \n"; + echo "Catégorie :\n"; + echo "  
\n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPAIGN HOTKEYS ##### + if ($SUB==23) + { + echo "
PERSONNALISER LES RACCOURCIS CLAVIER DE CETTE CAMPAGNE:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT * 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 "
RACCOURCI CLAVIERETATDESCRIPTIONSUPPRIMER
$rowx[1]$rowx[0]$rowx[2]SUPPRIMER
\n"; + + echo "
AJOUTER UN NOUVEAU RACCOURCI CLAVIER PERSONNALISE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Hotkey:   \n"; + echo "Etat:   \n"; + echo "
\n"; + echo "

\n"; + } + + ##### CAMPAIGN 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 * 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 "

FICHES EN RECYCLAGES DANS CETTE CAMPAGNE:   $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 "
ETATDELAI DE TENTATIVENOMBRE MAX DE TENTATIVESLIMITE AU FILSACTIF SUPPRIMER
  $RECYCLE_status[$o]
\n"; + echo "\n"; + echo "\n"; + echo "
$recycle_limit   SUPPRIMER
\n"; + + echo "
AJOUTER UN NOUVEAU RECYCLAGE DE FICHES DE LA CAMAPGNE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Etat:   \n"; + echo "Délai d'attente: \n"; + echo "Nombre max de tentatives: \n"; + echo "
\n"; + + echo "

\n"; + echo "
\n"; + echo "* Lead compte active des listes de prises dans la campagne ne.\n"; + } + + ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### + if ($SUB==26) + { + echo "

APPEL AUTOMATIQUE DU NUMERO ALTERNATIF POUR CETTE CAMPAGNE:   $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 "
STATUSESSUPPRIMER
$AADstatuses[$o]SUPPRIMER
\n"; + + echo "
AJOUTER UN NOUVEAU STATUT D'APPEL AUTOMATIQUE DU NUMERO ALTERNATIF
\n"; + echo "\n"; + echo "\n"; + echo "Etat:   \n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPAIGN CODES DE PAUSE ##### + if ($SUB==27) + { + echo "

CODES DE PAUSE DES AGENTS POUR CETTE CAMPAGNE:   $NWB#vicidial_pause_codes$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT * 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 "
CODES DE PAUSEFACTURABLEMODIFIERSUPPRIMER
$rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  \n"; + echo "
SUPPRIMER
\n"; + + echo "
AJOUTER UN NOUVEAU CODE DE PAUSE
\n"; + echo "\n"; + echo "\n"; + echo "Code de pause: \n"; + echo "Nom du code de pause: \n"; + echo "   Facturable: \n"; + echo "
\n"; + + echo "

\n"; + } + + ##### CAMPAIGN 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 "

QC SETTINGS pour cette campagne:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +# echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + echo "QC Enabled: $NWB#vicidial_campaigns-qc_enabled$NWE
QC Statut:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
QC WebForm:$NWB#vicidial_campaigns-qc_web_form_address$NWE
QC Script: $NWB#vicidial_campaigns-qc_script$NWE
QC Shift: $NWB#vicidial_campaigns-qc_shift_id$NWE
Get Lancement Record QC: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
QC Voir l'enregistrement: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; + echo "

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

SONDAGE SETTINGS pour cette campagne:
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "\n"; + + echo "
Enquête Premier fichier audio: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Enquête DTMF Digits: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Enquête Non Intéressé Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Enquête sur Opt-in audio de dossier: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Enquête Non Intéressé fichier audio: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Enquête sur la méthode: $NWB#vicidial_campaigns-survey_method$NWE
Etude de non-réponse de l'action: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Enquête Non Intéressé Etat: $NWB#vicidial_campaigns-survey_ni_status$NWE
Enquête sur la carte réponse Digit: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Sondage Enquête Xfer Extension: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Enquête sur la campagne d'enregistrement du répertoire: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Boîte vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; + echo "

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

\n"; + echo "
DECONNECTER TOUS LES AGENTS DE CETTE CAMPAGNE

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

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

SUPPRIMER CETTE CAMPAGNE\n"; + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=34 modify campaign info in the system - Basic View +###################### + +if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAGNES",$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 * 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]; + + if (ereg("DISABLED",$list_order_mix)) + {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} + else + {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} + + $stmt="SELECT * 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 * 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]: Vue basique Vue détaillée Liste Mix Ecran temps réel  
\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 "SUPPRIMER\n"; + } + } + + echo "\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 la campagne: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nom de la campagne: $NWB#vicidial_campaigns-campaign_name$NWE
Description de la campagne: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campagne Changement Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagne Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Actif: $NWB#vicidial_campaigns-active$NWE
Extension du parc: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Formulaire Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Autoriser les closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Groupe De Transfert De Défaut :$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Permettez d'arrivée et mélangé :$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Statut d'appel$o: \n"; + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Add A Dial Etat:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordre de la liste: $NWB#vicidial_campaigns-lead_order$NWE
Liste Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtre de la fiche: $NWB#vicidial_campaigns-lead_filter_id$NWE
Niveau du distributeur de fiches: $NWB#vicidial_campaigns-hopper_level$NWE
Forcer la réinitialisation du distributeur de fiches: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Méthode d'appel: $NWB#vicidial_campaigns-dial_method$NWE
Niveau de l'appel automatique: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapter le modificateur d'intensité: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Lancer l'appel: $get_call_launch
\n"; + + echo "
\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LISTES DANS CETTE CAMPAGNE:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIFLAST CALL DATEMODIFIER
$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]MODIFIER

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} + else + {$fSQL = '';} + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Cette campagne a $active_lists listes actives et $inactive_lists listes inactives

\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,$fSQL); + echo " - CACHER

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

"; + } + + + + $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 "Cette campagne a $hopper_leads fiches dans le distributeur de fiches

\n"; + echo "Cliquez ici pour voir quelles fiches sont dans le distributeur à l'instant

\n"; + echo "Cliquez ici pour voir une VDAD rapport de cette campagne

\n"; + } + echo "Cliquez ici pour voir les rappels réservés de cette campagne

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

Cliquez ici pour voir Admin chages à cette campagne
\n"; + } + + echo "
\n"; + + echo "
\n"; + + ### list of agent rank or skill-level for this campaign + echo "
\n"; + echo "
GRADES D'AGENT POUR CETTE CAMPAGNE :
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT user,campaign_rank,calls_today from vicidial_campaign_agents where campaign_id='$campaign_id'"; + $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[1]$rowx[2]

\n"; + + + echo "
DECONNECTER TOUS LES AGENTS DE CETTE CAMPAGNE

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

SUPPRIMER CETTE CAMPAGNE\n"; + } + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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-CAMPAGNES",$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) + { + ##### CAMPAIGN 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 "

MÉLANGES DE LISTE POUR CETTE CAMPAGNE :  $NWB#vicidial_campaigns-list_order_mix$NWE
\n"; + + echo "

Experimental Feature in development!!! NON-FUNCTIONAL
\n"; + + + $stmt="SELECT * 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"; + + if ($q > 9) {$AE_disabled = 'DISABLED';} + else {$AE_disabled = '';} + 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
Etat: \n"; + if ($rowx[5]=='INACTIVE') + { + echo "$rowx[5]\n"; + echo "PLACEZ À ACTIFMethod:\n"; + echo "
ID DE LA LISTEPRIORITÉ% MIXSTATUSES
\n"; + echo "\n"; + echo "List: $MIXdetailsLIST   SUPPRIMER\n"; + + + + echo " \n"; + echo "ADD   \n"; + echo "SUPPRIMER\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"; + echo "
\n"; + } + + + echo "

AJOUTER UNE NOUVELLE LISTE 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 Etat:  
\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 "
LISTES FAITES SUR COMMANDE DE STATUTS DE CAMPAGNE :\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 "
CAMPAIGNNOMSTATUSESMODIFIER
$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 STATUSES
\n"; +} + + +###################### +# ADD=33 display all campaign hotkeys +###################### +if ($ADD==33) +{ +echo "
\n"; + echo ""; + +echo "
LISTES DE LA CAMPAGNE HOTKEYS :\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 "
CAMPAIGNNOMHOTKEYSMODIFIER
$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 "
LE FIL DE CAMPAGNE RÉUTILISENT DES LISTES :\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 "
CAMPAIGNNOMLE FIL RÉUTILISEMODIFIER
$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 LE FIL RÉUTILISE
\n"; +} + + +###################### +# ADD=36 display all campaign auto-alt dial entries +###################### +if ($ADD==36) +{ +echo "
\n"; + echo ""; + +echo "
LISTES DE CADRAN DU FIL AUTO-ALT DE CAMPAGNE :\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 "
CAMPAIGNNOMAUTO-ALT DIALMODIFIER
$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 "
LISTES DES CODES DE PAUSE D'AGENT DE CAMPAGNE :\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 "
CAMPAIGNNOMCODES DE PAUSEMODIFIER
$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 CODES DE PAUSE
\n"; +} + + +###################### +# ADD=39 display all campaign list mixes +###################### +if ($ADD==39) +{ +echo "
\n"; + echo ""; + +echo "
LISTES DE MÉLANGE DE LISTE DE CAMPAGNE :\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 "
CAMPAIGNNOMLIST MIXMODIFIER
$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 * from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_id = $row[2]; + $active = $row[3]; + $list_description = $row[4]; + $list_changedate = $row[5]; + $list_lastcalldate = $row[6]; + + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT * 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 * 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 + + + echo "
MODIFIER UN ENREGISTREMENT DE LA LISTE: $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 "
ID de la liste: $row[0]$NWB#vicidial_lists-list_id$NWE
Nom de la liste: $NWB#vicidial_lists-list_name$NWE
Description de la liste: $NWB#vicidial_lists-list_description$NWE
Campagne: $NWB#vicidial_lists-campaign_id$NWE
Actif: $NWB#vicidial_lists-active$NWE
Réinitialiser les statuts des fiches appelées pour cette liste: $NWB#vicidial_lists-reset_list$NWE
Date de changement de la liste: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
Liste Date Last Call: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; + + echo "
\n"; + echo "
STATUTS DANS CETTE LISTE:
\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 "
ETATNOM DU STATUTAPPELENON APPELE
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SOUS TOTAUX$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + echo "
\n"; + echo "
ZONES DE TEMPS DANS CETTE LISTE:
\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 "
GMT OFFSET NOW (heure locale)APPELENON APPELE
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SOUS TOTAUX$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,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,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 "
NOMBRE D'APPELES DANS CETTE LISTE:
\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"';} + 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 "
ETATNOM DU STATUT$firstSOUS TOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

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

Cliquez ici pour voir tous les CallBack Détient dans cette liste

\n"; + echo "

Cliquez ici pour télécharger la liste

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

SUPPRIMER CETTE LISTE\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à cette liste
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + +###################### +# ADD=3111 modify in-group info in the system +###################### + +if ($ADD==3111) +{ + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * 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]; + + + ##### 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 "
MODIFIER UN ENREGISTREMENT DE GROUPES: $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 "\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"; + + 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 * 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 du groupe: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nom du groupe: $NWB#vicidial_inbound_groups-group_name$NWE
Couleur du groupe: $NWB#vicidial_inbound_groups-group_color$NWE
Actif: $NWB#vicidial_inbound_groups-active$NWE
Formulaire Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Appeler l'agent suivant : $NWB#vicidial_inbound_groups-next_agent_call$NWE
File d'attente de priorité: $NWB#vicidial_inbound_groups-queue_priority$NWE
Affichage de l'enseigne: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Lancer l'appel: $NWB#vicidial_inbound_groups-get_call_launch$NWE
DTMF Transfert-Conf 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
numéro de Transfer-Conf 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
DTMF Transfert-Conf 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
numéro de Transfer-Conf 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Temps avant abandon de l'appel: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Drop d'action:$NWB#vicidial_inbound_groups-drop_action$NWE
Extension d'abandon: $NWB#vicidial_inbound_groups-drop_exten$NWE
Boîte vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop de transfert du Groupe:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Temps D'Appel :$NWB#vicidial_inbound_groups-call_time_id$NWE
Après Action D'Heures :$NWB#vicidial_inbound_groups-after_hours_action$NWE
Après Nom de fichier De Message D'Heures :$NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Après Prolongation D'Heures :$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Après Des Heures Boîte vocale :$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Après les heures d'ouverture de transfert de Groupe:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Nom de fichier Bienvenu De Message :$NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Play Message de bienvenue:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Musique Sur Le Contexte De Prise :$NWB#vicidial_inbound_groups-moh_context$NWE
Sur Le Nom de fichier De Message de sollicitation De Prise :$NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
Sur L'Intervalle De Message de sollicitation De Prise :$NWB#vicidial_inbound_groups-prompt_interval$NWE
Jouer en ligne Lieu:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Hold estimée Play Time:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Hold Time Option:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Hold Time Option Seconds:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Hold Time Option Extension:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Hold Time Option de messagerie vocale:$NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Hold Time Option de transfert en groupe:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Hold Time Option Callback Filename:$NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Option Callback Liste ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Prolongation Alerte D'Agent :$NWB#vicidial_inbound_groups-agent_alert_exten$NWE
L'Alerte D'Agent Retardent :$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Groupe De Transfert De Défaut :$NWB#vicidial_inbound_groups-default_xfer_group$NWE
Groupe par défaut Alias: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Hold Recall transfert en groupe:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
Pas de délai d'appel Route:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
En groupe enregistrement Override:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
En groupe d'enregistrement du fichier:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Stats Pourcentage des appels dans les X secondes 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Stats Pourcentage des appels dans les X secondes 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
 
Inbound Groupe QC Paramètres:
QC Enabled: $NWB#vicidial_inbound_groups-qc_enabled$NWE
QC Statut:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC WebForm:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#vicidial_inbound_groups-qc_script$NWE
QC Shift: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
Get Lancement Record QC: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
QC Voir l'enregistrement: $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 "
AGENT RANKS FOR THIS ENTRANT GROUP:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT user,group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id'"; + $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[1]$rowx[2]

\n"; + + echo "

\n"; + + echo "
Cliquez ici pour voir un rapport de ce groupe d'entrants

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

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; + echo "

SUPPRIMER CE IN-GROUP\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce groupe en\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + +###################### +# ADD=3311 modify did info in the system +###################### + +if ($ADD==3311) +{ + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from vicidial_inbound_dids where did_id='$did_id';"; + $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]; + + + $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 "
Modifier un DID RECORD:$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 "
DID Extension:$NWB#vicidial_inbound_dids-did_pattern$NWE
A Description:$NWB#vicidial_inbound_dids-did_description$NWE
Actif: $NWB#vicidial_inbound_dids-did_active$NWE
Route de DID:$NWB#vicidial_inbound_dids-did_route$NWE
Extension:$NWB#vicidial_inbound_dids-extension$NWE
Extension Contexte:$NWB#vicidial_inbound_dids-exten_context$NWE
Boîte vocale:$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Téléphone Extension:$NWB#vicidial_inbound_dids-phone$NWE
IP du serveur: $NWB#vicidial_inbound_dids-server_ip$NWE
Utilisateur Agent:$NWB#vicidial_inbound_dids-user$NWE
Unavailable Action utilisateur:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Utilisateur Settings En Route-Group:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-ID du groupe: $NWB#vicidial_inbound_dids-group_id$NWE
In-Call Groupe Handle Méthode:$NWB#vicidial_inbound_dids-call_handle_method$NWE
En groupe Agent Méthode de recherche:$NWB#vicidial_inbound_dids-agent_search_method$NWE
In-Liste du groupe ID:$NWB#vicidial_inbound_dids-list_id$NWE
En-groupe ID de la campagne:$NWB#vicidial_inbound_dids-campaign_id$NWE
En-groupe Téléphone Code:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; + echo "

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

SUPPRIMER CETTE DID\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce DID
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + +###################### +# ADD=31111 modify remote agents info in the system +###################### + +if ($ADD==31111) +{ + if ($LOGmodify_remoteagents==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFIER UN ENREGISTREMENT D'AGENT DISTANT: $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 "
Début des ID utilisateurs: (nombres seulement, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Nombre de lignes: (nombres seulement)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP du serveur: $NWB#vicidial_remote_agents-server_ip$NWE
Extension externe: (numéro du dial plan pour atteindre les agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Etat: $NWB#vicidial_remote_agents-status$NWE
Campagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Groupes entrants: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; + + + if ($LOGdelete_remote_agents > 0) + { + echo "

SUPPRIMER CET AGENT DISTANT\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à cette télécommande agent
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=311111 modify user group info in the system +###################### + +if ($ADD==311111) +{ + if ($LOGmodify_usergroups==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * 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]; + + echo ""; + + echo "
MODIFIER UN ENREGISTREMENT DE GROUPE D'UTILISATEURS\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 "
Groupe: (pas d'espace ni de ponctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (Description du groupe)$NWB#vicidial_user_groups-group_name$NWE
Force timeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Shift exécution: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campagnes autorisées:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; + echo "$campaigns_list
 "; + echo "
Groupe de changements:
$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 "
 
QC permis Campagnes:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
QC permis l'arrivée des groupes:
$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 "
UTILISATEURS APPARTENANT A CE GROUPE D'UTILISATEURS: $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 "
USERFULL NAMENIVEAUACTIF
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + + + echo "

Cliquez ici pour voir tous les CallBack Détient dans ce groupe d'utilisateurs

\n"; + echo "

Cliquez ici pour voir le statut timeclock pour ce groupe d'utilisateurs

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

SUPPRIMER CE GROUPE \n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce groupe d'utilisateurs
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 * 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 = $row[3]; + $active = $row[4]; + echo ""; + + echo "
MODIFIER UN SCRIPT\n"; + echo "\n"; + echo "\n"; + echo "
ID du script: $script_id$NWB#vicidial_scripts-script_name$NWE
Nom du script: (titre du script)$NWB#vicidial_scripts-script_name$NWE
Commentaires du script: $NWB#vicidial_scripts-script_comments$NWE
Actif: $NWB#vicidial_scripts-active$NWE
Texte du script:

Prévisualisation du script
"; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + + if ($LOGdelete_scripts > 0) + { + echo "

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

Cliquez ici pour voir Admin chages de ce script
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 * 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 = $row[3]; + echo ""; + + echo "
MODIFIER UN FILTRE\n"; + echo "\n"; + echo "\n"; + echo "
ID du filtre:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nom du filtre: (courte description du filtre)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Commentaires du filtre: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtre 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 "
TEST SUR LA CAMPAGNE:
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + if ($LOGdelete_filters > 0) + { + echo "

SUPPRIMER CE FILTRE\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce filtre\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "Règle d'état ajoutée: $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 "Règle d'état supprimée: $state_rule
\n"; + } + +$ADD=311111111; +} +else +{ +echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière."; +} + +} + + +###################### +# 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 * 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 "
MODIFIER UNE PERIODE D'APPELS\n"; +echo "\n"; +echo "\n"; +echo "
Identifiant de la période d'appels: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Nom de la période d'appels: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
Commentaires de la période d'appels: $NWB#vicidial_call_times-call_time_comments$NWE
Début par défaut: Fin par défaut: $NWB#vicidial_call_times-ct_default_start$NWE
Début le dimanche: Fin le dimanche: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le lundi: Fin le lundi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le mardi: Fin le mardi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le mercredi: Fin le mercredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Jeudi Start: Fin le jeudi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le vendredi: Fin le vendredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le samedi: Fin le samedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Activer les définitions des états des périodes d'appels pour cet enregistrement:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "Add state call time rule:


\n"; +echo "CAMPAGNES UTILISANT CETTE PERIODE D'APPELS:
\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 "ENTRANT 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 "

SUPPRIMER CETTE DEFINITION DE PERIODE D'APPEL\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce temps de garde\n"; + } +} +else +{ +echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière."; +} + +} + + +###################### +# 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 * 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 "
MODIFIER UNE PERIODE D'APPELS D'ETAT
\n"; +echo "\n"; +echo "\n"; +echo "
Identifiant de la période d'appels: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
Nom de la période d'appels d'état: (courte description de la période d'appel)$NWB#vicidial_call_times-call_time_name$NWE
Commentaires de la période d'appels d'état: $NWB#vicidial_call_times-call_time_comments$NWE
Début par défaut: Fin par défaut: $NWB#vicidial_call_times-ct_default_start$NWE
Début le dimanche: Fin le dimanche: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le lundi: Fin le lundi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le mardi: Fin le mardi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le mercredi: Fin le mercredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Jeudi Start: Fin le jeudi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le vendredi: Fin le vendredi: $NWB#vicidial_call_times-ct_sunday_start$NWE
Début le samedi: Fin le samedi: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; +echo "PERIODE D'APPELS UTILISANT CET ETAT DE PERIODE D'APPELS:
\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 "

SUPPRIMER CETTE DEFINITION DE PERIODE D'APPEL D'ETAT\n"; + } + +} +else +{ +echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière."; +} + +} + + + +###################### +# ADD=331111111 modify shift definition info in the system +###################### + +if ($ADD==331111111) +{ + +if ($LOGmodify_call_times==1) +{ +echo "
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFIER UN DEPLACEMENT\n"; +echo "\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Shift ID:$shift_id
Shift Nom: (brève description de l'évolution)$NWB#vicidial_shifts-shift_name$NWE
Start Time Shift:\n"; +echo "   End Time Shift:\n"; +echo " $NWB#vicidial_shifts-shift_start_time$NWE
Longueur Shift: $NWB#vicidial_shifts-shift_length$NWE
Shift-Ven:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; +echo "Dimanche
\n"; +echo "Lundi
\n"; +echo "Mardi
\n"; +echo "Mercredi
\n"; +echo "Jeudi
\n"; +echo "Vendredi
\n"; +echo "Samedi
\n"; +echo "
\n"; + +echo "


\n"; +echo "Groupes d'utilisateurs UTILISANT CE SHIFT:
\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 "

SUPPRIMER CETTE DEFINITION SHIFT\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce changement\n"; + } +} +else +{ +echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière."; +} + +} + + +###################### +# ADD=31111111111 modify phone record in the system +###################### + +if ($ADD==31111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
MODIFIER UN TELEPHONE: $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 "
Extension du téléphone: $NWB#phones-extension$NWE
Nuémro dans le dial plan: (chiffres seulement)$NWB#phones-dialplan_number$NWE
Boîte vocale: (chiffres seulement)$NWB#phones-voicemail_id$NWE
CallerID sortant: (chiffres seulement)$NWB#phones-outbound_cid$NWE
Adresse IP du téléphone: (optional)$NWB#phones-phone_ip$NWE
Adresse IP de l'ordinateur: (optional)$NWB#phones-computer_ip$NWE
IP du serveur: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Mot de passe:$NWB#phones-pass$NWE
Etat: $NWB#phones-status$NWE
Compte actif: $NWB#phones-active$NWE
Type de téléphone: $NWB#phones-phone_type$NWE
Nom complet: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Compagnie: $NWB#phones-company$NWE
Image: $NWB#phones-picture$NWE
Nouveaux messages: $row[14]$NWB#phones-messages$NWE
Anciens messages: $row[15]$NWB#phones-old_messages$NWE
Protocole client: $NWB#phones-protocol$NWE
GMT local: (Ne PAS ajuster pour DST)$NWB#phones-local_gmt$NWE
Login du manager: $NWB#phones-ASTmgrUSERNAME$NWE
Mot de passe du manager: $NWB#phones-ASTmgrSECRET$NWE
Utilisateur par défaut de VICIDIAL: $NWB#phones-login_user$NWE
Mot de passe par défaut de VICIDIAL: $NWB#phones-login_pass$NWE
Campagne par défaut de VICIDIAL: $NWB#phones-login_campaign$NWE
Extension du parc: $NWB#phones-park_on_extension$NWE
Extension de la conférence: $NWB#phones-conf_on_extension$NWE
Extension du parc VICIDIAL: $NWB#phones-VICIDIAL_park_on_extension$NWE
Fichier du parc VICIDIAL: $NWB#phones-VICIDIAL_park_on_filename$NWE
Préfixe du moniteur: $NWB#phones-monitor_prefix$NWE
Extension d'enregistrement: $NWB#phones-recording_exten$NWE
Extension de la boîte vocale: $NWB#phones-voicemail_exten$NWE
Extension de VmailDump: $NWB#phones-voicemail_dump_exten$NWE
Extension du context: $NWB#phones-ext_context$NWE
Cannal d'envoi DTMF: $NWB#phones-dtmf_send_extension$NWE
Groupe d'appels sortants: $NWB#phones-call_out_number_group$NWE
Localisation du navigateur: $NWB#phones-client_browser$NWE
Répertoire d'installation: $NWB#phones-install_directory$NWE
URL du CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL par défaut de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Log des appels: $NWB#phones-AGI_call_logging_enabled$NWE
Changement d'utilisateur: $NWB#phones-user_switching_enabled$NWE
En conférence: $NWB#phones-conferencing_enabled$NWE
Raccrochage administrateur: $NWB#phones-admin_hangup_enabled$NWE
Détournement administrateur: $NWB#phones-admin_hijack_enabled$NWE
Moniteur administrateur: $NWB#phones-admin_monitor_enabled$NWE
Parc d'appel: $NWB#phones-call_parking_enabled$NWE
Contrôle de mise à jour: $NWB#phones-updater_check_enabled$NWE
Log AF: $NWB#phones-AFLogging_enabled$NWE
Queue activée: $NWB#phones-QUEUE_ACTION_enabled$NWE
Popup du CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Bouton de la boîte vocale: $NWB#phones-voicemail_button_enabled$NWE
Rafraichissement rapide: $NWB#phones-enable_fast_refresh$NWE
Taux du rafraichissement rapide: (in ms)$NWB#phones-fast_refresh_rate$NWE
MySQL persistant: $NWB#phones-enable_persistant_mysql$NWE
Appel automatique du numéro suivant: $NWB#phones-auto_dial_next_number$NWE
Arrêter l'enregistrement après chaque appel: $NWB#phones-VDstop_rec_after_each_call$NWE
Activer les messages SIPSAK: $NWB#phones-enable_sipsak_messages$NWE
Serveur DBX: (PrimaireDB Server)$NWB#phones-DBX_server$NWE
Base de données DBX: (PrimaireServer Database)$NWB#phones-DBX_database$NWE
Utilisateur DBX: (PrimaireDB Login)$NWB#phones-DBX_user$NWE
Mot de passe DBX: (PrimaireDB Secret)$NWB#phones-DBX_pass$NWE
Port DBX: (PrimaireDB Port)$NWB#phones-DBX_port$NWE
Serveur DBY: (SecondaireDB Server)$NWB#phones-DBY_server$NWE
Base de données DBY: (SecondaireServer Database)$NWB#phones-DBY_database$NWE
Utilisateur DBY: (SecondaireDB Login)$NWB#phones-DBY_user$NWE
Mot de passe DBY: (SecondaireDB Secret)$NWB#phones-DBY_pass$NWE
Port DBY: (SecondaireDB Port)$NWB#phones-DBY_port$NWE
Template ID: $NWB#phones-template_id$NWE
Conf Override: $NWB#phones-conf_override$NWE
\n"; + + echo "

Cliquez ici pour les statistiques des téléphones\n"; + + if ($LOGast_delete_phones > 0) + { + echo "

SUPPRIMER CE TELEPHONE\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=32111111111 modify phone alias record in the system +###################### + +if ($ADD==32111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * from phones_alias where alias_id='$alias_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "
A MODIFIER TELEPHONE ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias ID:$row[0] $NWB#phones-alias_id$NWE
Alias Nom: $NWB#phones-alias_name$NWE
Télé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 "
TELEPHONES PORTABLES DANS CETTE 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 "
LOGINEXTENSIONSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

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

SUPPRIMER CETTE PHONE ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce téléphone alias
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
Modifier un groupe ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Alias Groupe ID: $row[0] $NWB#phones-group_alias_id$NWE
Nom du groupe Alias: $NWB#phones-group_alias_name$NWE
Nombre CallerID: $NWB#phones-caller_id_number$NWE
CallerID Nom: $NWB#phones-caller_id_name$NWE
Actif:
\n"; + + + if ($LOGast_delete_phones > 0) + { + echo "

Supprimer ce groupe ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce groupe alias
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 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]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); + + echo "
MODIFIER UN SERVEUR: $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 "
ID du serveur: $NWB#servers-server_id$NWE
Description du serveur: $NWB#servers-server_description$NWE
Adresse IP du serveur: $NWB#servers-server_ip$NWE
Actif: $NWB#servers-active$NWE
Système de charge: $sysload - $cpu%   $NWB#servers-sysload$NWE
Live Chaînes: $channels_total   $NWB#servers-channels_total$NWE
Disk Usage: $disk_usage   $NWB#servers-disk_usage$NWE
Version d'Asterisk: $NWB#servers-asterisk_version$NWE
Nombre max de trunks VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Max demande par seconde: $NWB#servers-outbound_calls_per_second$NWE
Equilibrage des appels VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Limite de l'équilibrage VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Hôte telnet: $NWB#servers-telnet_host$NWE
Port telnet: $NWB#servers-telnet_port$NWE
Utilisateur manager: $NWB#servers-ASTmgrUSERNAME$NWE
Mot de passe du manager: $NWB#servers-ASTmgrSECRET$NWE
Utilisateur de mise à jour manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Utilisateur manager pour l'écoute: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Utilisateur manager pour l'envoi: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT local: (Ne PAS ajuster pour DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
Extension AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexte par défaut: $NWB#servers-ext_context$NWE
Performances du système: $NWB#servers-sys_perf_log$NWE
Logs du serveur: $NWB#servers-vd_server_logs$NWE
Sortie des AGI: $NWB#servers-agi_output$NWE
Enregistrement Web Link: $NWB#servers-recording_web_link$NWE
Alternate Recording IP du serveur: $NWB#servers-alt_server_ip$NWE
Active Server Asterisk: $NWB#servers-active_asterisk_server$NWE
Générer des fichiers de conf: $NWB#servers-generate_vicidial_conf$NWE
Reconstruire les fichiers de configuration: $NWB#servers-rebuild_conf_files$NWE
\n"; + + + ### vicidial server trunk records for this server + echo "

LES MallesVICIDIAL POUR CE SERVEUR:   $NWB#vicidial_server_trunks$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT * 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 "
CAMPAGNE Malles RESTRICTION DELETE
$rowx[1]
\n"; + echo "\n"; + echo "\n"; + echo "
SUPPRIMER
\n"; + + echo "
AJOUTER UN NOUVEAU TRUNK SERVEUR VICIDIAL
\n"; + echo "\n"; + echo "\n"; + echo "Malles:
\n"; + echo "CAMPAGNE:
\n"; + echo "RESTRICTION:
\n"; + echo "
\n"; + + echo "

\n"; + + + ### list of carriers on this server + echo "
\n"; + echo "
SUPPORTS DE CE SERVEUR:
\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 IDNOMREGISTRATIONACTIF
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + + ### list of phones on this server + echo "
\n"; + echo "
TELEPHONES SUR CE SERVEUR:
\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 "
EXTENSIONNOMACTIF
$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 "
CONFERENCEEXTENSION
$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 CONFERENCEEXTENSION
$rowx[0]$rowx[2]

\n"; + + + echo "
\n"; + + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Ce serveur a $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; + echo "Ce serveur a $active_phones téléphones actifs et $inactive_phones téléphones inactifs

\n"; + echo "Ce serveur a $active_confs active conferences

\n"; + echo "Ce serveur a $active_vdconfs active vicidial conferences

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

SUPPRIMER CE SERVEUR\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce serveur
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "
A MODIFIER CONF TEMPLATE RECORD: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $template_id
Nom du modèle: $NWB#vicidial_conf_templates-template_name$NWE
Template Sommaire: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
PHONES UTILISANT CE CONF TEMPLATE:
\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 "
EXTENSIONNOMSERVERACTIF
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
SUPPORTS UTILISANT CE CONF TEMPLATE:
\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 "
CARRIERNOMSERVERACTIF
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

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

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

Cliquez ici pour voir Admin chages à ce modèle de conf
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 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]; + + echo "
MODIFIER UN SUPPORT D'ENREGISTREMENT: $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 "
Carrier ID: $carrier_id
Nom du transporteur: $NWB#vicidial_server_carriers-carrier_name$NWE
Inscription à cordes: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Entrée de compte: $NWB#vicidial_server_carriers-account_entry$NWE
Protocole: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entrée: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP du serveur: $NWB#vicidial_server_carriers-server_ip$NWE
Actif: $NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

SUPPRIMER CETTE CARRIER\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages à ce transporteur
\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=3111111111111 modify conference record in the system +###################### + +if ($ADD==3111111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * 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 "
MODIFIER UNE CONFERENCE: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Conférence: $NWB#conferences-conf_exten$NWE
IP du serveur: $NWB#conferences-server_ip$NWE
Extension courante:
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

SUPPRIMER CETTE CONFERENCE\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + +###################### +# ADD=31111111111111 modify vicidial conference record in the system +###################### + +if ($ADD==31111111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT * 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 "
Conférence: $NWB#conferences-conf_exten$NWE
IP du serveur: $NWB#conferences-server_ip$NWE
Extension courante:
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

SUPPRIMER CETTE CONFERENCE VICIDIAL\n"; + } + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 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]; + + echo "
MODIFIER LES REGLAGES DU SYSTEME 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 "
Version: $version
DB Schema Version: $db_schema_version
Auto Utilisateur-add Value: $auto_user_add_value
Date d'installation: $install_date
Utiliser Non-Latin: $NWB#settings-use_non_latin$NWE
Webroot éditable: $NWB#settings-webroot_writable$NWE
Affichage de la désactivation d'un agent VICIDIAL: $NWB#settings-vicidial_agent_disable$NWE
Autoriser les messages SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
URL de l'accueil de l'administration: $NWB#settings-admin_home_url$NWE
Permettez Le Fichier journal De Transfert D'Agent: $NWB#settings-enable_agc_xfer_log$NWE
Horloge en temps Fin de la journée:$NWB#settings-timeclock_end_of_day$NWE
Dernière timeclock Auto Déconnection: $timeclock_last_reset_date
Pull QC Dernière Heure: $qc_last_pull_time
Agent Header Screen Format Date: $NWB#settings-vdc_header_date_format$NWE
Agent client Screen Format Date: $NWB#settings-vdc_customer_date_format$NWE
Agent Client Téléphone Screen Format: $NWB#settings-vdc_header_phone_format$NWE
Agent API Active:$NWB#settings-vdc_agent_api_active$NWE
QC Active Caractéristiques: $NWB#settings-qc_features_active$NWE
Auto Outbound Dial-Actif: $NWB#settings-outbound_autodial_active$NWE
Max REMPLISSAGE demande par seconde: $NWB#settings-outbound_calls_per_second$NWE
Activer le log des QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP du serveur QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nom de la base de données QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
Login de la base de données QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Mot de passe de la base de données QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
Identifiant des log de QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
Préfixe EnterQueue QueueMetrics: $NWB#settings-queuemetrics_eq_prepend$NWE
Activer Vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Cliquez ici pour synchroniser les utilisateurs avec Vtiger\n"; + echo "
Vtiger DB IP du serveur: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Mot de passe:$NWB#settings-vtiger_pass$NWE
Vtiger Web: $NWB#settings-vtiger_url$NWE
\n"; + echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Cliquez ici pour voir Admin chages pour les réglages du système
\n"; + } + + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + + + + +###################### +# ADD=321111111111111 modify vicidial system statuses +###################### + +if ($ADD==321111111111111) +{ + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
\n"; + echo "STATUTS DE VICIDIAL DANS CE SYSTÈME :  $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 * 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 "
ETATDESCRIPTIONSELECT-
ABLE
L'HOMME
REPONSE
CATÉGORIEMODIFY/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 "SUPPRIMER\n"; + } + else + { + echo "SUPPRIMER\n"; + } + echo "
\n"; + + echo "
AJOUTEZ LE NOUVEAU STATUT DE SYSTÈME
\n"; + echo "\n"; + echo "Etat:   \n"; + echo "Description:
\n"; + echo "Selectionnable:   \n"; + echo "Réponse de l'homme:   \n"; + echo "Catégorie :\n"; + echo "  
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + + + +###################### +# ADD=331111111111111 modify vicidial status categories +###################### + +if ($ADD==331111111111111) +{ + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
\n"; + echo "VICIDIAL ÉTAT CATEGORIES:   $NWB#vicidial_status_categories$NWE
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT * 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 "
CATÉGORIENOMSTATUTS DE CETTE CATEGORIE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$Avsc_id[$p]
\n"; + echo "$CATstatuses"; + echo "
TO VDAD Afficher:     Vente Catégorie:     Dead Lead Catégorie:  
Description:
        \n"; + echo "   SUPPRIMER
 
\n"; + + echo "
AJOUTEZ LA NOUVELLE CATÉGORIE DE STATUT
\n"; + echo "\n"; + echo "Category ID:   \n"; + echo "Name:  
\n"; + echo "TimeOnVDAD Afficher:   \n"; + echo "Vente Catégorie:   \n"; + echo "Dead Lead Catégorie:  
\n"; + echo "Description:   \n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Vous n'avez pas la permission de voir cette page\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 "VICIDIAL QC ÉTAT DANS CE SYSTEME DE CODES:  $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 CODEDESCRIPTIONMODIFY/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 "SUPPRIMER\n"; + } + else + { + echo "SUPPRIMER\n"; + } + echo "
\n"; + + echo "
ADD NEW QC Code de statut
\n"; + echo "\n"; + echo "Etat:   \n"; + echo "Description:
\n"; + echo "
\n"; + + echo "

\n"; + + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } +} + + + + + + +###################### +# ADD=550 search form +###################### + +if ($ADD==550) +{ +echo "
\n"; +echo ""; + +echo "
RECHERCHER UN UTILISATEUR
\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "
Numéro d'utilisateur :
Nom complet:
Niveau de l'utilisateur:
Groupe utilisateur:
\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 = "where $SQL";} + + $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; +# echo "\n|$stmt|\n"; + $rslt=mysql_query($stmt, $link); + $people_to_print = mysql_num_rows($rslt); + +echo "
RESULTATS DE LA RECHERCHE:\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]MODIFIER | STATISTIQUES | ETAT | 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='LIVE' and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
Utilisateur($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='LIVE' and callback_time < '$past_week_date';"; + $rslt=mysql_query($stmt, $link); + echo "
Utilisateur($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='LIVE' 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='LIVE' 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 "
CAMPAIGN 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='LIVE' 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='LIVE' 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='LIVE' 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='LIVE' 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 "
GROUPE D'UTILISATEURS 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,'; $NIVEAUlink='stage=NIVEAUUP';} + + $stmt="SELECT * 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 CAMPAGNEENTRY DATECALLBACK DATEUSERRECIPIENTETATGROUP
$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 "
LISTE DES UTILISATEURS: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   Afficher uniquement les utilisateurs actifs\n"; + } + else + { + $SQLstatus = "where active='Y'"; + echo "   Afficher tous les utilisateurs\n"; + } + + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $NIVEAUlink='stage=NIVEAUDOWN'; + $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("NIVEAUUP",$stage)) {$SQLorder='order by user_level asc'; $NIVEAUlink='stage=NIVEAUDOWN';} + if (eregi("NIVEAUDOWN",$stage)) {$SQLorder='order by user_level desc'; $NIVEAUlink='stage=NIVEAUUP';} + 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 $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 "
USER IDFULL NAMENIVEAUGROUPACTIFLIENS
$row[0]$row[1]$row[2]$row[3]$row[4]
MODIFIER | STATISTIQUES | ETAT | 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 "
LISTE DES CAMPAGNES:\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 "
CAMPAIGN ID
NOM
ACTIVE   DIAL PROCEDE   NIVEAU   RESPONSABLE DE COMMANDE   DIAL STATUTS   MODIFIER
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]MODIFIER
\n"; + } + + +###################### +# ADD=100 display all lists +###################### +if ($ADD==100) + { + echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 group by list_id $SQLorder"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
LISTE DES LISTES:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + 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 "\n"; + $lists_printed .= "'$row[0]',"; + $o++; + } + + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id 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 "\n"; + $o++; + } + + echo "
ID DE LA LISTENOM DE LA LISTEDESCRIPTIONABOUTIT COUNTACTIFLAST CALL DATECAMPAIGNMODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFIER
\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 "
LISTE DES GROUPES ENTRANTS:\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-GROUPNOMPRIORITÉACTIFTIMECOLORMODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4]  MODIFIER
\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 "
LISTE DES GROUPES ENTRANTS:\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 "
#DIDDESCRIPTIONACTIFROUTEMODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4]MODIFIER
\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 "
LISTE DES AGENTS DISTANTS:\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 "
USERLINESSERVEUR   CONF-EXTEN   STATUS   CAMPAIGN   MODIFIER
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFIER
\n"; + } + + +###################### +# ADD=100000 display all user groups +###################### +if ($ADD==100000) + { + 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 "
LISTE DES GROUPES D'UTILISATEURS:\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 "
GROUPE D'UTILISATEURSGROUP NAMEForce timeclock   MODIFIER
$row[0] $row[1] $row[2]MODIFIER
\n"; + } + + +###################### +# ADD=1000000 display all scripts +###################### +if ($ADD==1000000) + { + 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 "
LISTE DES 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 "
SCRIPT IDNom du scriptACTIVE   MODIFIER
$row[0] $row[1] $row[2]MODIFIER
\n"; + } + + +###################### +# ADD=10000000 display all filters +###################### +if ($ADD==10000000) + { + 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 "
LISTE DES FILTRES DE FICHES:\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 NAMEMODIFIER
$row[0] $row[1]MODIFIER
\n"; + } + + +###################### +# ADD=100000000 display all call times +###################### +if ($ADD==100000000) + { + 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 "
LISTE DES PERIODES D'APPELS:\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 "
CALLTIME IDCALLTIME NOMDémarrage par défautDEFAULT STOPMODIFIER
$row[0] $row[1] $row[2] $row[3] MODIFIER
\n"; + } + +###################### +# ADD=1000000000 display all state call times +###################### +if ($ADD==1000000000) + { + 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 "
LISTE DES PERIODES D'APPELS D'ETAT:\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 "
CALLTIME IDCALLTIME STATECALLTIME NOMDémarrage par défautDEFAULT STOPMODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFIER
\n"; + } + +###################### +# ADD=130000000 display all shifts +###################### +if ($ADD==130000000) + { + 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 "
SHIFT inscriptions:\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 "
SHIFT IDSHIFT NOMSHIFT STARTSHIFT LONGUEURSEMAINEMODIFIER
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFIER
\n"; + } + +###################### +# ADD=10000000000 display all phones +###################### +if ($ADD==10000000000) + { + 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 "
LISTE DES TELEPHONES:\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 "
EXTENPROTOSERVERDIAL PLANETATNOMVMAILLIENS
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFIER | STATISTIQUES
\n"; + } + +###################### +# ADD=12000000000 display all phones alias +###################### +if ($ADD==12000000000) + { + 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 "
TÉLÉLISTE DE TELEPHONESE ALIASAGES:\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 "
ALIAS IDAliasTÉLÉLISTE DE TELEPHONESE ConnexionsMODIFIER
$row[0]$row[1]$row[2]MODIFIER
\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 "
GROUPE ALIAS LISTAGES:\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 "
ALIAS ID GROUPGROUPE NOM ALIASCID NUMÉROCID NOMACTIFMODIFIER
$row[0]$row[1]$row[2]$row[3]$row[4]MODIFIER
\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 "
LISTE DES SERVEURS:\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 "
SERVEUR IDNOMSERVEUR IPACTIFASTERISKMallesGMTMODIFIER
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFIER
\n"; + } + +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + 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 "
CONF TEMPLATE LISTEAGES:\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 "
Template IDNom du modèleMODIFIER
$row[0]$row[1]MODIFIER
\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 "
CARRIER LISTEAGES:\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 "
Carrier IDNom du transporteurIP du serveurProtocolInscriptionActiveMODIFIER
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]MODIFIER
\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 "
LISTE DES CONFERENCES:\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 "
CONFERENCESERVEUR IPEXTENSIONMODIFIER
$row[0]$row[1]$row[2]MODIFIER
\n"; + } + +###################### +# ADD=10000000000000 display all vicidial conferences +###################### +if ($ADD==10000000000000) + { + 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 LISTE DES CONFERENCES:\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 "
CONFERENCESERVEUR IPEXTENSIONMODIFIER
$row[0] $row[1] $row[2]MODIFIER
\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 "
ADMIN CHANGE LOG: (Mise à 10.000 dossiers)\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('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 "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 from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; + +?> +
+ + +
\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 "
ADMIN CHANGE LOG: Les modifications apportées par $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('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"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +if ($ADD==720000000000000) + { + 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 "
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) + { + $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"; + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + 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]); + 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"; + } + } + + +###################### +# 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;"; + $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]; + + ?> + + + + + + VICIDIAL: Stats Rapports Server et + VICIDIAL: Stats Rapports Server et

+ +

+		
+		 $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 "
SERVERDESCRIPTIONIPACTLOADCHANDISKSORTANTENTRANT
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
\n"; + } + else + { + echo "Vous n'avez pas la permission de voir cette page\n"; + exit; + } + } + + + + + +echo "
\n"; +echo "
\n"; + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "
\n"; +echo "

"; +echo "VERSION: $admin_version
"; +echo "CONSTRUCTION: $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 * 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 * 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) #### Dimanche heure locale + { + 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) #### Lundi heure locale + { + 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) #### Mardi heure locale + { + 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) #### Mercredi heure locale + { + 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) #### Jeudi heure locale + { + 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) #### Vendredi heure locale + { + 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) #### Samedi heure locale + { + 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) #### Dimanche heure locale + { + 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) #### Lundi heure locale + { + 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) #### Mardi heure locale + { + 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) #### Mercredi heure locale + { + 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) #### Jeudi heure locale + { + 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) #### Vendredi heure locale + { + 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) #### Samedi heure locale + { + 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); + + $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) $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 "Cette campagne a $active_leads fiches à appeler dans ces listes\n"; + } + else + { + echo "aucun statut d'appel selectionnés pour cette campagne\n"; + } + } + else + { + echo "pas de listes actives pour cette campagne\n"; + } + } +else + { + echo "pas de listes actives pour cette campagne\n"; + } +##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### +} +?> diff --git a/LANG_www/vicidial_fr/admin_header.php b/LANG_www/vicidial_fr/admin_header.php new file mode 100644 index 00000000..96afeacd --- /dev/null +++ b/LANG_www/vicidial_fr/admin_header.php @@ -0,0 +1,932 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Utilisateurs     Campagnes     Listes     Scripts     Filtres     In-Groups     Groupes d'utilisateurs     Agents distants     Admin     Rapports  
+ 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 French
+ +
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + + + + 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) { + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # pink + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} # pink + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} # pink + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} # pink + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink + else {$status_sh=''; $status_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + + + + +
WIDTH=160> + SIZE=>Utilisateurs +
+   >Voir les utilisateurs +
+   >Ajouter un nouvel utilisateur +
+   >Utilisateur De Copie +
+   >Rechercher un utilisateur +
+   >Statistiques utilisateur +
+   >Utilisateur Status +
+   >Feuille de temps
> + SIZE=>Campagnes +
>   SIZE=>Campagnes principale
>   SIZE=>Statuts
>   SIZE=>HotKeys
>   SIZE=>Recyclage Plomb
>   SIZE=>Auto-Alt Dial
>   SIZE=>Liste Mix
>   SIZE=>Pause Codes
> SIZE=>Listes
  + > Voir les listes +
  + > Ajouter une nouvelle liste +
  + > Rechercher une fiche +
  + > Ajouter un numéro à la liste DNC +
  + > Charger de nouvelles fiches +
> + SIZE=> Scripts +
  + > Voir les scripts +
  + > Ajouter un nouveau script +
> SIZE=> Filtres
  + > Voir les filtres +
  + > Ajouter un nouveau filtre +
> + SIZE=> In-Groups +
  + > Voir les In-Groups +
  + > Ajouter un nouveau In-Group +
  + > Dans-Groupe De Copie +
  + > Voir DiDs +
  + > Ajouter une nouvelle DID +
  + > CopieDID +
> + SIZE=> Groupes d'utilisateurs +
  + > Voir les groupes d'utilisateurs +
  + > Ajouter un nouveau groupe d'utilisateurs +
  + > Rapport horaire du groupe +
  + > Bulk Change Group +
> + SIZE=> Agents distants +
  + > Voir les agents distants +
  + > Ajouter un nouvel agent distant +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Période d'appels
>   + SIZE=> Shifts
>   + SIZE=> Téléphones
>   + SIZE=> Modèles
>   + SIZE=> Carriers
>   + SIZE=> Serveurs
>   + SIZE=> Conférences
>   + SIZE=> Réglages du système
>   + SIZE=>Statuts De Système
> + SIZE=> Rapports +
+
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) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + \n"; + echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière.\n"; + } + +if (strlen($reports_hh) > 1) { + ?> +> + + + + +\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 * 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 * 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); @@ -336,10 +429,13 @@ else $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 * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -349,7 +445,7 @@ else $tsr = "$row[4]"; $vendor_id = "$row[5]"; $list_id = "$row[7]"; - $campaign_id = "$row[8]"; + $gmt_offset_now = "$row[8]"; $phone_code = "$row[10]"; $phone_number = "$row[11]"; $title = "$row[12]"; @@ -371,7 +467,7 @@ else $security = "$row[28]"; # $comments = "$row[29]"; # - echo "
Call information: $first_name $last_name - $phone_number

\n"; + echo "
Informations sur l'appel: $first_name $last_name - $phone_number

\n"; echo "\n"; echo "\n"; echo "\n"; @@ -379,7 +475,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -387,22 +483,23 @@ else echo "\n"; echo "
ACCUEIL | Horloge en temps | Déconnection  
>   > Voir les campagnes     |     > Ajouter une nouvelle campagne     |     > Campagne De Copie     |     > Menu temps-réel des campagnes
  > Voir les périodes d'appels  | > Ajouter une période d'appels  | > Voir les périodes d'appels d'états  | > Ajouter une nouvelle période d'appels d'état
  > Voir les changements  | > Add A New Shift
  > Voir les téléphones  | > Ajouter un nouveau téléphone  | > Téléphone Alias Liste  | > Ajouter un nouveau téléphone Alias  | > Groupe Alias Liste  | > Ajouter un nouveau groupe Alias
  > Voir les conférences   |   > Ajouter une nouvelle conférence   |   > Voir les conférences VICIDIAL   |   > Ajouter une nouvelle conférence VICIDIAL
  > Voir les serveurs   |   > Ajouter un nouveau serveur
  > Afficher les modèles   |   > Ajouter un nouveau modèle
  > Show Carriers   |   > Add A New Carrier
  > Réglages du système
  >Statuts De Système   |   >Catégories De Statut   |   >Codes d'état QC
  >Statistiques utilisateur   |   >Utilisateur Status   |   >Feuille de temps   |   >Jours Etat
>  
+ LICENSE: GPLv2 +# AST GUI database administration modify lead in vicidial_list +# admin_modify_lead.php +# +# this is the administration lead information modifier screen, the administrator +# 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 # - # 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 # require("dbconnect.php"); @@ -19,6 +40,8 @@ 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"];} @@ -79,8 +102,8 @@ if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} 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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} @@ -93,40 +116,50 @@ 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); - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier 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 -# -# 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 -# - $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); - - $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); +############################################# +##### 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); - $auth=$row[0]; + $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");} @@ -139,7 +172,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -173,31 +206,32 @@ $browser = getenv("HTTP_USER_AGENT"); -VICIDIAL ADMIN: Lead record modification +ADMINISTRATION DE VICIDIAL: Modification de l'enregistrement de la fiche
VICIDIAL ADMIN: Lead record modification
\n"; +echo "ADMINISTRATION DE VICIDIAL: Modification de l'enregistrement de la fiche
\n"; if ($end_call > 0) { -$call_length = ($STARTtime - $call_began); - - ### 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) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . 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); - ### 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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $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) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "information modified

\n"; - echo "\n"; + echo "Informations modifiées

\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 @@ -226,18 +260,39 @@ $call_length = ($STARTtime - $call_began); echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; } - ### update last record in vicidial_agent_log and vicidial_log tables + ### 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 { @@ -281,6 +336,7 @@ else if ($lead_count > 0) { + ##### grab vicidial_log records ##### $stmt="select * 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); @@ -306,10 +362,47 @@ else $call_log .= "
$row[11] $row[3] $row[2] $row[1]
$row[1] $row[15]
$y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
$row[3] $row[2] $row[1]   $row[14]
  $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 "\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     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Fronter: $tsr     ID de la liste: $list_id
Nom:   \n"; + echo " Prénom:
Adresse1 :
Adresse2 :
Adresse3 :
Ville :
Etat:   \n"; + echo " Code postal:
Province :
Country :
Alt Phone :
Province:
Pays :
Main Phone :
Téléphone alternatif :
Email :
Security :
Comments :
Sécurité:
Commentaires :
Disposition: (with $log_campaign statuses)
Modify agent and vicidial logs
Modifiervicidial log
Modifieragent log
Modifiercloser log
Add closer log record
\n"; echo "


\n"; @@ -474,7 +575,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UtilisateurID: \n"; echo "
\n"; } else @@ -484,7 +585,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UtilisateurID: \n"; echo "
\n"; } } @@ -502,7 +603,7 @@ else } else { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; + echo "ECHEC de la vérification de la fiche pour l'id $lead_id       $NOW_TIME\n

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

\n"; } @@ -512,9 +613,9 @@ echo "

\n"; echo "
\n"; -echo "CALLS TO THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "APPELS VERS CETTE FICHE:\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
\n"; +echo "\n"; echo "$call_log\n"; @@ -522,8 +623,8 @@ echo "
# DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD HANGUP REASON
\n"; echo "

\n"; echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT
\n"; +echo "\n"; echo "$closer_log\n"; @@ -531,13 +632,23 @@ echo "
# DATE/TIME LENGTH STATUS TSR CAMPAGNE LIST LEAD WAIT HANGUP REASON
\n"; echo "

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

\n"; + + echo "RECORDINGS FOR THIS LEAD:\n"; echo "\n"; echo "\n"; - $stmt="select * 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); +$stmt="select * 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); $u=0; while ($logs_to_print > $u) @@ -549,6 +660,30 @@ echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD2) + { + $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 @@ -587,7 +722,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n


\n\n"; -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; +echo "\n\n\n


\ntemps d'exécution du script: $RUNtime seconds
"; ?> diff --git a/LANG_www/vicidial/admin_search_lead.php b/LANG_www/vicidial_fr/admin_search_lead.php similarity index 57% rename from LANG_www/vicidial/admin_search_lead.php rename to LANG_www/vicidial_fr/admin_search_lead.php index ff814159..3926ea41 100644 --- a/LANG_www/vicidial/admin_search_lead.php +++ b/LANG_www/vicidial_fr/admin_search_lead.php @@ -1,17 +1,23 @@ LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php +# admin_search_lead.php +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead +# AST GUI database administration search for lead info +# admin_modify_lead.php +# +# this is the administration lead information modifier 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 # require("dbconnect.php"); @@ -27,13 +33,20 @@ if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_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"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} 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"];} $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); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -57,7 +70,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -93,25 +106,50 @@ $browser = getenv("HTTP_USER_AGENT"); -VICIDIAL ADMIN: Lead Search - -Lead Lookup - - +ADMINISTRATION DE VICIDIAL: Recherche de fiches <? -echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Lead search<BR>\n"; + +##### 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"); -if ( (!$vendor_id) and (!$phone) and (!$lead_id) ) + + + +echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user<BR>\n"; + + +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) { echo date("l F j, Y G:i:s A"); echo "\n<br><br><center>\n"; echo "<form method=post name=search action=\"$PHP_SELF\">\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; - echo "<b>Please enter a:<br> Vendor ID(vendor lead code): <input type=text name=vendor_id size=10 maxlength=10> or \n"; - echo "<br><b>a Home Phone Number: <input type=text name=phone size=10 maxlength=10> or\n"; - echo "<br><b>a lead ID: <input type=text name=lead_id size=10 maxlength=10> <br><br>\n"; - echo "<input type=submit name=submit value=SUBMIT></b>\n"; + echo "<b>Veuillez entrer un:<br> Vendor ID(code vendeur de la fiche): <input type=text name=vendor_id size=10 maxlength=10> or \n"; + echo "<br><b>un numéro de téléphone du domicile: <input type=text name=phone size=20 maxlength=16> or\n"; + echo "<br><b>ID de la fiche: <input type=text name=lead_id size=10 maxlength=10> or\n"; + echo "<br><b>status: <input type=text name=status size=7 maxlength=6>   \n"; + echo "<b>list ID: <input type=text name=list_id size=15 maxlength=14>   \n"; + echo "<b>user: <input type=text name=user size=15 maxlength=20> <br><br>\n"; + echo "<input type=submit name=submit value=VALIDER></b>\n"; echo "</form>\n</center>\n"; echo "</body></html>\n"; exit; @@ -138,8 +176,32 @@ else } else { - print "ERROR: you must search for something! Go back and search for something"; - exit; + 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 * from vicidial_list where $statusSQL $list_idSQL $userSQL order by modify_date desc limit 1000"; + } + else + { + print "ERROR: you must search for something! Go back and search for something"; + exit; + } } } } @@ -154,8 +216,8 @@ else { echo date("l F j, Y G:i:s A"); echo "\n<br><br><center>\n"; - echo "<b>The search variables you entered are not active in the system</b><br><br>\n"; - echo "<b>Please go back and double check the information you entered and submit again</b>\n"; + echo "<b>Les variables de recherche que vous avez entré ne sont pas actives dans le système</b><br><br>\n"; + echo "<b>Veuillez revenir en arrière et verifier les informations que vous avez saisi et valider de nouveau</b>\n"; echo "</center>\n"; echo "</body></html>\n"; exit; @@ -167,12 +229,12 @@ else echo "<TR BGCOLOR=BLACK>\n"; echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LEAD ID</B></FONT></TD>\n"; - echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>STATUS</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ETAT</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>VENDOR ID</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST AGENT</B></FONT></TD>\n"; - echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LIST ID</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>ID DE LA LISTE</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>PHONE</B></FONT></TD>\n"; - echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>NAME</B></FONT></TD>\n"; + echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>NOM</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>CITY</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>SECURITY</B></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>LAST CALL</B></FONT></TD>\n"; @@ -182,13 +244,14 @@ else { $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]\">$row[0]</a></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"; @@ -197,11 +260,19 @@ else 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[2]</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 MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } @@ -211,10 +282,10 @@ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n<br><br><br>\n<a href=\"$PHP_SELF\">NEW SEARCH</a>"; +echo "\n\n\n<br><br><br>\n<a href=\"$PHP_SELF\">NOUVELLE RECHERCHE</a>"; -echo "\n\n\n<br><br><br>\nscript runtime: $RUNtime seconds"; +echo "\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds"; ?> diff --git a/LANG_www/vicidial_fr/call_report_export.php b/LANG_www/vicidial_fr/call_report_export.php new file mode 100644 index 00000000..21d06ca4 --- /dev/null +++ b/LANG_www/vicidial_fr/call_report_export.php @@ -0,0 +1,513 @@ +<? +# 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) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Login ou mot de passe invalide 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"; + exit; + } + + + if ($RUNcampaign > 0) + { + $export_campaign_rows=''; + $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 from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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); + + $export_campaign_rows .= "$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]\r\n"; + $i++; + } + } + } + + if ($RUNgroup > 0) + { + $export_group_rows=''; + $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 from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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) + { + 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); + + $export_group_rows .= "$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]\r\n"; + $i++; + } + } + } + + + 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 EXPORTATION DE RAPPORT ENGAGE', 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(); + + echo "$export_campaign_rows$export_group_rows"; + } + 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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>VICIDIAL: Appels d'exportation Rapport"; + + ##### 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>Appels d'exportation Rapport</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\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\">"; + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campagnes:</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>Groupes entrants:</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>Listes:</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>Statuts:</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>Groupes d'utilisateurs:</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=VALIDER VALUE=VALIDER>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial/count.htm b/LANG_www/vicidial_fr/count.htm similarity index 100% rename from LANG_www/vicidial/count.htm rename to LANG_www/vicidial_fr/count.htm diff --git a/LANG_www/agc/dbconnect.php b/LANG_www/vicidial_fr/dbconnect.php similarity index 85% rename from LANG_www/agc/dbconnect.php rename to LANG_www/vicidial_fr/dbconnect.php index 723d3c59..dae8cc7a 100644 --- a/LANG_www/agc/dbconnect.php +++ b/LANG_www/vicidial_fr/dbconnect.php @@ -43,7 +43,7 @@ $link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); if (!$link) { die('MySQL connect ERROR: ' . mysql_error()); } -mysql_select_db("$VARDB_database",$link); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; @@ -51,8 +51,10 @@ $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; $WeBRooTWritablE = '1'; -$non_latin = '0'; # set to 1 for UTF rules, overridden by system_settings -$flag_channels=0; -$flag_string = 'VICIast20'; - +$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/LANG_www/vicidial_fr/fcstats.php b/LANG_www/vicidial_fr/fcstats.php new file mode 100644 index 00000000..2f7dc3cd --- /dev/null +++ b/LANG_www/vicidial_fr/fcstats.php @@ -0,0 +1,600 @@ +<? +# fcstats.php +# +# Copyright (C) 2009 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$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 "Login ou mot de passe invalide: |$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;"; +$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> + +<? +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>VICIDIAL: In-Group Fronter-Closer Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFIER | RAPPORTS \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK VALIDER\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 "VICIDIAL: In-Group Fronter-Closer Stats                      $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 "| AGENT                    |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 "| AGENT                    | 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/LANG_www/vicidial/group_hourly_stats.php b/LANG_www/vicidial_fr/group_hourly_stats.php similarity index 77% rename from LANG_www/vicidial/group_hourly_stats.php rename to LANG_www/vicidial_fr/group_hourly_stats.php index 607f2fd7..6c3da44c 100644 --- a/LANG_www/vicidial/group_hourly_stats.php +++ b/LANG_www/vicidial_fr/group_hourly_stats.php @@ -1,12 +1,13 @@ LICENSE: GPLv2 -### +# group_hourly_stats.php +# +# Copyright (C) 2009 Matt Florell 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 # require("dbconnect.php"); @@ -22,8 +23,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -38,7 +39,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -67,7 +68,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -104,14 +105,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL ADMIN: Group Hourly Stats + +ADMINISTRATION DE VICIDIAL: Statistiques du groupe par heures <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + +##### 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"); + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> + + <CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: Group Hourly Stats <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Statistiques du groupe par heures <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> @@ -160,10 +182,10 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; echo "<br><center>\n"; -echo "<B>TSR HOUR COUNTS: <a href=\"./admin.php?ADD=3111&group_id=$group\">$group</a> | $status | $date_with_hour | $date_no_hour</B>\n"; +echo "<B>NOMBRE D'HEURES DE 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 CALLS</td><td align=right><font size=2>   $status DAY</td><td align=right><font size=2>     </td></tr>\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 DES APPELS</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; @@ -180,7 +202,7 @@ echo "<tr><td><font size=2>TSR </td><td align=left><font size=2>ID </td><td alig 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]\">MODIFY</a> | <a href=\"./user_stats.php?user=$VDuser[$o]\">STATS</a></td></tr>\n"; + echo "<td align=right><font size=1><a href=\"./admin.php?ADD=3&user=$VDuser[$o]\">MODIFIER</a> | <a href=\"./user_stats.php?user=$VDuser[$o]\">STATISTIQUES</a></td></tr>\n"; $total_calls = ($total_calls + $VDtotal[$o]); $hour_calls = ($hour_calls + $VDcount[$o]); $day_calls = ($day_calls + $VDday[$o]); @@ -197,7 +219,7 @@ echo "</TABLE></center>\n"; echo "<br><br>\n"; - echo "<br>Please enter the group you want to get hourly stats for: <form action=$PHP_SELF method=POST>\n"; + echo "<br>Veuillez entrez le groupe pour lequel vous souhaitez avoir les statistiques horaires : <form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=DB value=$DB>\n"; echo "group: <select size=1 name=group>\n"; @@ -217,7 +239,7 @@ echo "<br><br>\n"; 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=SUBMIT>\n"; + echo "<input type=submit name=submit value=VALIDER>\n"; echo "<BR><BR><BR>\n"; @@ -228,13 +250,13 @@ $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 "<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds</font>"; ?> -</TD></TR><TABLE> +</TD></TR></TABLE> </body> </html> diff --git a/LANG_www/vicidial/help.gif b/LANG_www/vicidial_fr/help.gif similarity index 100% rename from LANG_www/vicidial/help.gif rename to LANG_www/vicidial_fr/help.gif diff --git a/LANG_www/vicidial_fr/list_download.php b/LANG_www/vicidial_fr/list_download.php new file mode 100644 index 00000000..794b783d --- /dev/null +++ b/LANG_www/vicidial_fr/list_download.php @@ -0,0 +1,130 @@ +<? +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Login ou mot de passe invalide 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 * 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); + + 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]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial/listloader.pl b/LANG_www/vicidial_fr/listloader.pl similarity index 97% rename from LANG_www/vicidial/listloader.pl rename to LANG_www/vicidial_fr/listloader.pl index d926368b..b8f9e064 100644 --- a/LANG_www/vicidial/listloader.pl +++ b/LANG_www/vicidial_fr/listloader.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 -### +# +# listloader.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # # CHANGES @@ -18,6 +17,8 @@ # 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 # ### begin parsing run-time options ### @@ -148,6 +149,23 @@ $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';"; @@ -547,14 +565,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial/listloaderMAIN.php b/LANG_www/vicidial_fr/listloaderMAIN.php similarity index 87% rename from LANG_www/vicidial/listloaderMAIN.php rename to LANG_www/vicidial_fr/listloaderMAIN.php index bb292c36..6a1faa20 100644 --- a/LANG_www/vicidial/listloaderMAIN.php +++ b/LANG_www/vicidial_fr/listloaderMAIN.php @@ -1,7 +1,7 @@ <? # listloaderMAIN.php # -# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2008 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 @@ -40,7 +40,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -78,7 +78,7 @@ $browser = getenv("HTTP_USER_AGENT"); ?><HTML> <HEAD> -<TITLE>VICIDIAL: Lead Loader Module +VICIDIAL: Module de chargement de fiches diff --git a/LANG_www/vicidial/listloader_rowdisplay.pl b/LANG_www/vicidial_fr/listloader_rowdisplay.pl similarity index 96% rename from LANG_www/vicidial/listloader_rowdisplay.pl rename to LANG_www/vicidial_fr/listloader_rowdisplay.pl index 3f8695c0..bbfc8170 100644 --- a/LANG_www/vicidial/listloader_rowdisplay.pl +++ b/LANG_www/vicidial_fr/listloader_rowdisplay.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl - -### listloader_rowdisplay.pl version 0.2 *DBI-version* -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### +# +# listloader_rowdisplay.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson LICENSE: AGPLv2 +# # # CHANGES # diff --git a/LANG_www/vicidial/listloader_super.pl b/LANG_www/vicidial_fr/listloader_super.pl similarity index 95% rename from LANG_www/vicidial/listloader_super.pl rename to LANG_www/vicidial_fr/listloader_super.pl index 167fff5e..3af97f37 100644 --- a/LANG_www/vicidial/listloader_super.pl +++ b/LANG_www/vicidial_fr/listloader_super.pl @@ -1,9 +1,8 @@ #!/usr/bin/perl - -### listloader_super.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 -### +# +# listloader_super.pl version 2.0.5 +# +# Copyright (C) 2008 Matt Florell,Joe Johnson LICENSE: AGPLv2 # # # CHANGES @@ -17,6 +16,8 @@ # 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 # ### begin parsing run-time options ### @@ -149,21 +150,38 @@ $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 ##### +########################################### - ### 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(); + +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; @@ -549,14 +567,14 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $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),"; + $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'),"; $multi_insert_counter++; } diff --git a/LANG_www/vicidial/new_listloader_superL.php b/LANG_www/vicidial_fr/new_listloader_superL.php similarity index 80% rename from LANG_www/vicidial/new_listloader_superL.php rename to LANG_www/vicidial_fr/new_listloader_superL.php index 629321ed..81dbd790 100644 --- a/LANG_www/vicidial/new_listloader_superL.php +++ b/LANG_www/vicidial_fr/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2009 Matt Florell,Joe Johnson LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -19,11 +19,17 @@ # 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 # # 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.0.4'; -$build = '70510-1518'; +$version = '2.0.5-29'; +$build = '90310-2128'; require("dbconnect.php"); @@ -43,10 +49,11 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} 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"];} @@ -113,10 +120,28 @@ if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_co # $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); - +} $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -125,6 +150,7 @@ $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]; @@ -138,12 +164,15 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$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); @@ -184,7 +213,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   \"HELP\""; +$NWE = "')\">\"AIDE\""; $secX = date("U"); $hour = date("H"); @@ -231,7 +260,7 @@ $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; function macfontfix($fontsize) { @@ -274,7 +303,7 @@ function openNewWindow(url) { } function ShowProgress(good, bad, total, dup, post) { parent.lead_count.document.open(); - parent.lead_count.document.write('
Current file status:
Good:'+good+'
Bad:'+bad+'
Total:'+total+'
   
Duplicate:'+dup+'
Postal Match:'+post+'
'); + parent.lead_count.document.write('
Statut du fichier courant:
Good:'+good+'
Bad:'+bad+'
Total:'+total+'
   
Duplicate:'+dup+'
Postal Match:'+post+'
'); parent.lead_count.document.close(); } function ParseFileName() { @@ -288,46 +317,56 @@ function ParseFileName() { } } -VICIDIAL ADMIN: Lead Loader +ADMINISTRATION DE VICIDIAL: Lead Loader - + + +
"; +?> + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - + - - + + - - + + - - + + - + - + - + - +
Load leads from this file:Charger les fiches depuis ce fichier:
List ID Override: (numbers only or leave blank for values in the file)ID de la liste Override: (nombres seulement or leave blank for values in the file)
Phone Code Override: (numbers only or leave blank for values in the file)Téléphone Code Override: (nombres seulement or leave blank for values in the file)
File layout to use:Standard VICIDIAL    Custom layoutDisposition du fichier à utiliser:VICIDIAL standard    Disposition personnalisée
Lead Duplicate Check: Vérification des doublons dans les fiches:
Lead Time Zone Lookup: Consultation du fuseau horaire de la fiche:
                
        BACK TO ADMINLIST LOADER-     VERSION:     BUILD:    
        RETOUR A L'ADMINISTRATIONLIST LOADER-     VERSION:     CONSTRUCTION:    
@@ -355,16 +394,16 @@ function ParseFileName() { if (count($field_check)>=5) { flush(); $file=fopen("$lead_file", "r"); - print "
Processing $delim_name-delimited file...\n"; + print "
En cours$delim_name-delimited file...\n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

"; } while (!feof($file)) { @@ -410,7 +449,7 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + # print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } if (strlen($phone_code_override)>0) @@ -514,7 +553,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -522,13 +561,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -549,20 +588,20 @@ function ParseFileName() { print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; + print "
ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
"; } } else if (!eregi(".csv", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.xls"); $file=fopen("$lead_file", "r"); - print "
Processing Excel file... \n"; + print "
En coursExcel file... \n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $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, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; @@ -578,15 +617,15 @@ function ParseFileName() { if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - print "
Processing CSV file... \n"; + print "
En coursCSV file... \n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

"; } while($row=fgetcsv($file, 1000, ",")) { @@ -729,7 +768,7 @@ function ParseFileName() { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -737,13 +776,13 @@ function ParseFileName() { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -764,8 +803,14 @@ function ParseFileName() { print ""; } -if ($leadfile && filesize($LF_path)<=8388608) { +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='LISTES', 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 ""; @@ -798,14 +843,14 @@ if ($leadfile && filesize($LF_path)<=8388608) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; + print "
En cours$delim_name-delimited file... ($tab_count|$pipe_count)\n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

\n"; } while (!feof($file)) { $record++; @@ -953,7 +998,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -961,13 +1006,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -988,7 +1033,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; + print "
ERREUR: Le fichier n'a pas le nombre de champs requis pour l'utiliser.
"; } } else if (!eregi(".csv", $leadfile_name)) { @@ -1029,15 +1074,15 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - print "
Processing CSV file... \n"; + print "
En coursCSV file... \n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

"; } while($row=fgetcsv($file, 1000, ",")) { @@ -1179,7 +1224,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; + $stmtZ = "INSERT INTO vicidial_list 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');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1187,13 +1232,13 @@ if ($leadfile && filesize($LF_path)<=8388608) { $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),"; + $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'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -1220,8 +1265,8 @@ if ($leadfile && filesize($LF_path)<=8388608) { flush(); print "\r\n"; print " \r\n"; - 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 from vicidial_list limit 1", $link); @@ -1251,15 +1296,15 @@ if ($leadfile && filesize($LF_path)<=8388608) { $field_check=explode($delimiter, $buffer); flush(); $file=fopen("$lead_file", "r"); - print "
Processing $delim_name-delimited file...\n"; + print "
En cours$delim_name-delimited file...\n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

"; } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); @@ -1267,54 +1312,23 @@ if ($leadfile && filesize($LF_path)<=8388608) { for ($i=0; $i\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"; } } else if (!eregi(".csv", $leadfile_name)) @@ -1355,68 +1369,36 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - print "
Processing CSV file... \n"; + print "
En coursCSV file... \n"; if (strlen($list_id_override)>0) { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; + print "

ID DE LA LISTE OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + print "

DÉPASSEMENT DE CODE DE TÉLÉPHONE POUR CE DOSSIER: $phone_code_override

"; } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); for ($i=0; $i\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 " \r\n"; @@ -1425,14 +1407,14 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; - print " \r\n"; + print " \r\n"; print " \r\n"; print "
VICIDIAL ColumnFile dataVICIDIAL ColonneDonnées du fichier
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
                
\r\n"; # } print ""; } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; +#} else if (filesize($leadfile)>8388608) { +# print "
ERROR: File exceeds the 8MB limit.
"; } ?> @@ -1554,17 +1536,17 @@ $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";} + if ($DBX) {print " Second Dimanche March to First Dimanche 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. + # Based on Second Dimanche March to First Dimanche 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) + # dow INTEGER Day of week (0=Dimanche, to 6=Samedi) # OPTIONAL INPUT: # timezone INTEGER hour difference UTC - local standard time # (DEFAULT is blank) @@ -1632,7 +1614,7 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) } else { $USACAN_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 7200) { $USACAN_DST=1; } else { @@ -1650,12 +1632,12 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} + if ($DBX) {print " First Dimanche April to Last Dimanche 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. + # Based on first Dimanche in April and last Dimanche in October at 2 am. #********************************************************************** $USA_DST=0; @@ -1700,7 +1682,7 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) } else { $USA_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 7200) { $USA_DST=1; } else { @@ -1719,11 +1701,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + if ($DBX) {print " Last Dimanche March to Last Dimanche 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. + # Based on last Dimanche in March and last Dimanche in October at 1 am. #********************************************************************** $GBR_DST=0; @@ -1748,7 +1730,7 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } else { $GBR_DST=1; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $GBR_DST=0; } else { @@ -1770,7 +1752,7 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } else { $GBR_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $GBR_DST=1; } else { @@ -1787,11 +1769,11 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + if ($DBX) {print " Last Dimanche October to Last Dimanche 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. + # Based on last Dimanche in October and last Dimanche in March at 1 am. #********************************************************************** $AUS_DST=0; @@ -1816,7 +1798,7 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) } else { $AUS_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $AUS_DST=1; } else { @@ -1838,7 +1820,7 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) } else { $AUS_DST=1; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $AUS_DST=0; } else { @@ -1856,12 +1838,12 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} + if ($DBX) {print " First Dimanche October to Last Dimanche 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. + # Based on first Dimanche in October and last Dimanche in March at 1 am. #********************************************************************** $AUST_DST=0; @@ -1886,7 +1868,7 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } else { $AUST_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $AUST_DST=1; } else { @@ -1923,11 +1905,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} + if ($DBX) {print " First Dimanche October to Third Dimanche 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. + # Based on first Dimanche in October and third Dimanche in March at 1 am. #********************************************************************** $NZL_DST=0; @@ -1952,7 +1934,7 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) } else { $NZL_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $NZL_DST=1; } else { @@ -1990,12 +1972,12 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + if ($DBX) {print " Third Dimanche October to Last Dimanche 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. + # Based on Third Dimanche October to Last Dimanche February at 1 am. #********************************************************************** $BZL_DST=0; @@ -2020,7 +2002,7 @@ if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) } else { $BZL_DST=0; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $BZL_DST=1; } else { @@ -2042,7 +2024,7 @@ if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) } else { $BZL_DST=1; } - } else { # local time calculations + } else { # heure locale calculations if ($ns < 3600) { $BZL_DST=0; } else { @@ -2066,4 +2048,7 @@ if (!$AC_processed) } return $gmt_offset; -} \ No newline at end of file +} + +?> +
diff --git a/LANG_www/vicidial_fr/non_agent_api.php b/LANG_www/vicidial_fr/non_agent_api.php new file mode 100644 index 00000000..2d525f39 --- /dev/null +++ b/LANG_www/vicidial_fr/non_agent_api.php @@ -0,0 +1,1419 @@ + 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 +# + +$version = '2.0.5-5'; +$build = '90118-1056'; + +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"];} + + +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); +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) + { + $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); + } + +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';} + +$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; + } + + + + +################################################################################ +### 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';"; + if ($DB) {echo "|$stmt|\n";} + $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 + { + if ($dnc_check == 'Y') + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + if ($DB) {echo "|$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') + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';"; + if ($DB) {echo "|$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; + } + } + + ### 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';"; + if ($DB) {echo "$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) {echo "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) {echo "$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;"; + if ($DB) {echo "|$stmt|\n";} + $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) {echo "$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; + } + } + + + +$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 * 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 * 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 * 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 * 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 * 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-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 == '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 * 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 * 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/LANG_www/vicidial/remote_dispo.php b/LANG_www/vicidial_fr/remote_dispo.php similarity index 80% rename from LANG_www/vicidial/remote_dispo.php rename to LANG_www/vicidial_fr/remote_dispo.php index da249fba..3f35a5f3 100644 --- a/LANG_www/vicidial/remote_dispo.php +++ b/LANG_www/vicidial_fr/remote_dispo.php @@ -1,10 +1,12 @@ LICENSE: GPLv2 -### -# 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 - +# remote_dispo.php +# +# Copyright (C) 2008 Matt Florell 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 @@ -94,8 +96,8 @@ 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"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -127,7 +129,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -157,7 +159,7 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL REMOTE: Call Disposition +VICIDIAL DISTANT: Disposition des appels \n"; ?> @@ -184,9 +186,9 @@ $call_length = ($STARTtime - $call_began); if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - echo "Call has been dispositioned       $NOW_TIME\n

\n"; + echo "L'appel a été dispositionné       $NOW_TIME\n

\n"; - echo "
\n"; + echo "
\n"; } else @@ -230,7 +232,7 @@ else $security = "$row[28]"; # $comments = "$row[29]"; # - echo "
Call information: $first_name $last_name - $phone_number

\n"; + echo "
Informations sur l'appel: $first_name $last_name - $phone_number

\n"; echo "\n"; echo "\n"; echo "\n"; @@ -244,23 +246,23 @@ 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 "\n"; - echo "\n"; - echo "\n"; - echo "\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     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Vendor ID: $vendor_id     ID de la campagne: $campaign_id
Fronter: $tsr     ID de la liste: $list_id
Nom:   \n"; + echo " Prénom:
Adresse1 :
Adresse2 :
Adresse3 :
Ville :
Etat:   \n"; + echo " Code postal:
Province :
Country :
Alt Phone :
Province:
Pays :
Téléphone alternatif :
Email :
Security :
Comments :
Sécurité:
Commentaires :
Disposition:
\n"; echo "


\n"; } else { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; + echo "ECHEC de la vérification de la fiche pour l'id $lead_id       $NOW_TIME\n

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

\n"; } @@ -304,7 +306,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n


\n\n"; -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; +echo "\n\n\n


\ntemps d'exécution du script: $RUNtime seconds
"; ?> diff --git a/LANG_www/vicidial_fr/timeclock_edit.php b/LANG_www/vicidial_fr/timeclock_edit.php new file mode 100644 index 00000000..3c2b8755 --- /dev/null +++ b/LANG_www/vicidial_fr/timeclock_edit.php @@ -0,0 +1,478 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80624-1342 - First build +# 80701-1323 - functional beta version done +# 90310-2109 - Added admin header +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Login ou mot de passe invalide: |$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 DE VICIDIAL:Horloge en temps Record Edit +<? + +##### 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>Horloge en temps Record Edit for <? echo $user ?></TD><TD ALIGN=RIGHT>   </TD></TR> + +<? + +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 "ERREUR-Il ya un problème avec les données que vous avez entré, s'il vous plaît revenir<BR>\n"; + echo "A timeclock session ne peuvent pas se chevaucher un autre timeclock session<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 "ERREUR-Il ya un problème avec les données que vous avez entré, s'il vous plaît revenir<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>GROUPE D'UTILISATEURS: </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>GROUPE D'UTILISATEURS: </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=VALIDER 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\">VICIDIAL Feuille de temps</a>\n"; +echo " - <a href=\"./user_stats.php?user=$user\">Statistiques utilisateur</a>\n"; +echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifier un utilisateur</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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +} +else +{ + +echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n"; +} +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_fr/timeclock_report.php b/LANG_www/vicidial_fr/timeclock_report.php new file mode 100644 index 00000000..139937fa --- /dev/null +++ b/LANG_www/vicidial_fr/timeclock_report.php @@ -0,0 +1,359 @@ +<? +# timeclock_report.php +# +# Copyright (C) 2009 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($order)<2) {$order='hours_down';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Login ou mot de passe invalide: |$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;"; +$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> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<TITLE>VICIDIAL: UtilisateurHorloge en temps Report + +<? + +##### 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>\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>Date Range:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Groupes d'utilisateurs:</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>Utilisateur:</B></font><BR>\n"; +echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; + +echo "<BR><BR><INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\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\">RAPPORTS</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "VICIDIAL: UtilisateurHorloge en temps 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/LANG_www/vicidial_fr/timeclock_status.php b/LANG_www/vicidial_fr/timeclock_status.php new file mode 100644 index 00000000..3dfd959b --- /dev/null +++ b/LANG_www/vicidial_fr/timeclock_status.php @@ -0,0 +1,548 @@ +<? +# timeclock_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day 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]; + $timeclock_end_of_day = $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"); +$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 "Login ou mot de passe invalide: |$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;"; +$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 DE VICIDIAL:Horloge en temps Status +<? + +##### 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>Horloge en temps Status for <? echo $user_group ?></TD><TD ALIGN=RIGHT>             +<? +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>GROUPE D'UTILISATEURS</a>\n"; +?> +</TD></TR> + + + + +<? + +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 GROUPE D'UTILISATEURS: $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 CAMPAIGN</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 + } + + 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]);} + + $s++; + } + $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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? +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 HEURE DE CONNECTION/DECONNECTION:</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>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_fr/user_group_bulk_change.php b/LANG_www/vicidial_fr/user_group_bulk_change.php new file mode 100644 index 00000000..bdd5fa48 --- /dev/null +++ b/LANG_www/vicidial_fr/user_group_bulk_change.php @@ -0,0 +1,269 @@ +<? +# 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Login ou mot de passe invalide: |$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 * 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 DE VICIDIAL: Changement de groupe d'utilisateur en vrac +<? + +##### 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>   Changement de groupe d'utilisateur en vrac</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<? + +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 Groupe utilisateur $old_group Utilisateurs changed to the $group Groupe utilisateur<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 GROUPE D'UTILISATEURS CHANGE', event_sql=\"$SQL_log\", event_notes='Old Groupe: $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 Utilisateurs changed to the $group Groupe utilisateur<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 GROUPE D'UTILISATEURS 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 Utilisateurs 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=VALIDER></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 Utilisateurs 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=VALIDER></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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_fr/user_stats.php b/LANG_www/vicidial_fr/user_stats.php new file mode 100644 index 00000000..be7c760d --- /dev/null +++ b/LANG_www/vicidial_fr/user_stats.php @@ -0,0 +1,690 @@ +<? +# user_stats.php +# +# Copyright (C) 2009 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 +# + +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["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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +$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';"; + $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 "Login ou mot de passe invalide: |$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 "Login ou mot de passe invalide: |$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> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<title>ADMINISTRATION DE VICIDIAL: Statistiques utilisateur +<? + + +##### 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>   Statistiques utilisateur for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> + + + + +<? + +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 "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n"; +echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>  \n"; +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\">VICIDIAL Feuille de temps</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">Utilisateur Status</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifier un utilisateur</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utilisateur 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>VICIDIAL TEMPS DE CONVERSATION ET ETAT:</B>\n"; + +echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>ETAT</td><td align=right><font size=2>NOMBRE</td><td align=right><font size=2>HEURES:MINUTES</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_seconds = $call_sec[$o]; + $call_hours = ($call_seconds / 3600); + $call_hours_int = round($call_hours, 2); + $call_hours_int = intval("$call_hours_int"); + $call_minutes = ($call_hours - $call_hours_int); + $call_minutes = ($call_minutes * 60); + $call_minutes_int = round($call_minutes, 0); + if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + + 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_int:$call_minutes_int</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_seconds = $total_sec; +$call_hours = ($call_seconds / 3600); +$call_hours_int = round($call_hours, 2); +$call_hours_int = intval("$call_hours_int"); +$call_minutes = ($call_hours - $call_hours_int); +$call_minutes = ($call_minutes * 60); +$call_minutes_int = round($call_minutes, 0); +if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + +echo "<tr><td><font size=2>TOTAL DES APPELS</td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; +echo "</TABLE></center>\n"; + + +##### Login and Logout time from vicidial agent interface ##### + +echo "<br><br>\n"; + +echo "<center>\n"; + +echo "<B>VICIDIAL AGENT HEURE DE CONNECTION/DECONNECTION:</B>\n"; +echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; +echo "<tr><td><font size=2>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAGNE</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</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 = ($event_seconds / 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[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_int:$event_minutes_int</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 = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); +$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><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_int:$total_login_minutes_int</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 HEURE DE CONNECTION/DECONNECTION:</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>EVENEMENT</td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HEURES:MINUTES</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 = ($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><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_int:$event_minutes_int"; + 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 = ($total_login_time / 3600); +$total_login_hours_int = round($total_login_hours, 2); +$total_login_hours_int = intval("$total_login_hours_int"); +$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";} + + 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_int:$total_login_minutes_int </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> CAMPAGNE</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td></tr>\n"; + + $stmt="select * 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 "</tr>\n"; + + } + + +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound calls for this time period ##### + +echo "<B>SORTANT 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> CAMPAGNE</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 * 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>ENTRANT/CLOSER 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> CAMPAGNE</td><td align=right><font size=2> WAIT (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 * 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; + 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[17] </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 * 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 SORTANT 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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_fr/user_status.php b/LANG_www/vicidial_fr/user_status.php new file mode 100644 index 00000000..6115d6de --- /dev/null +++ b/LANG_www/vicidial_fr/user_status.php @@ -0,0 +1,507 @@ +<? +# 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 +# + +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["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Login ou mot de passe invalide: |$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 "Login ou mot de passe invalide: |$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 * 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]; + $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 * 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 DE VICIDIAL: Utilisateur Status +<? + + +##### 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=<? echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Utilisateur Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> + + + + +<? + +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") + { + $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; + $rslt=mysql_query($stmt, $link); + + echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser<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='Horloge en temps 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='Utilisateur login time: $last_action_sec|Horloge en temps 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"; + 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 Campagne: <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 AGENT OUT\"><BR></form>\n"; + } + } + +else + { + echo "Agent is not logged in to VICIDIAL\n<BR>"; + } + +echo "\n<BR>"; + +if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) + { + echo "Utilisateur $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 "Utilisateur $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\">VICIDIAL Feuille de temps</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">Statistiques utilisateur</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifier un utilisateur</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Utilisateur 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>\ntemps d'exécution du script: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial/vdremote.php b/LANG_www/vicidial_fr/vdremote.php similarity index 76% rename from LANG_www/vicidial/vdremote.php rename to LANG_www/vicidial_fr/vdremote.php index dfe11fa3..a01dd36c 100644 --- a/LANG_www/vicidial/vdremote.php +++ b/LANG_www/vicidial_fr/vdremote.php @@ -1,7 +1,10 @@ <? # vdremote.php # -# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# make sure you have added a user to the vicidial_users MySQL table with at +# least user_level 4 to access this page the first time +# +# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # Changes # 50307-1721 - First version @@ -9,7 +12,6 @@ # 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 # -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time $version = '1.1.12'; $build = '60619-1603'; @@ -47,8 +49,8 @@ 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["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["VALIDER"])) {$VALIDER=$_GET["VALIDER"];} + elseif (isset($_POST["VALIDER"])) {$VALIDER=$_POST["VALIDER"];} if (!isset($force_logout)) {$force_logout = 0;} @@ -59,7 +61,7 @@ if ($force_logout) Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); } - echo "You have now logged out. Thank you\n"; + echo "Vous êtes maintenant déconnecté. Merci.\n"; exit; } @@ -88,7 +90,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Login ou mot de passe invalide: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -145,7 +147,7 @@ if ($ADD==61111) { echo"<META HTTP-EQUIV=Refresh CONTENT=\"5; URL=$PHP_SELF?ADD=61111&user=$user&DB=$DB\">\n"; } -echo "<!-- VERSION: $version BUILD: $build -->\n"; +echo "<!-- VERSION: $version CONSTRUCTION: $build -->\n"; ?> <STYLE type="text/css"> <!-- @@ -158,11 +160,11 @@ echo "<!-- VERSION: $version BUILD: $build -->\n"; --> </STYLE> <? -echo "<title>VICIDIAL REMOTE AGENTS: $LOGfullname - $PHP_AUTH_USER "; +echo "<title>AGENTS DISTANTS VICIDIAL: $LOGfullname - $PHP_AUTH_USER "; if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==41111) {echo "Modify Remote Agents";} +if ($ADD==31111) {echo "Modifier les agents distants";} +if ($ADD==41111) {echo "Modifier les agents distants";} if ($ADD==61111) {echo "Remote Agent Status";} if ($ADD==71111) {echo "Remote Agent Closer Stats";} @@ -242,8 +244,8 @@ if (strlen($ADD)>4) </head> <BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> <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>   VICIDIAL REMOTE AGENTS: <? echo "$PHP_AUTH_USER " ?>   <a href="<? echo $PHP_SELF ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Logout</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> -<TR BGCOLOR=#F0F5FE><TD ALIGN=LEFT COLSPAN=2><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>   <a href="./vdremote.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>MODIFY</a> | <a href="./vdremote.php?ADD=61111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>STATUS</a> | <a href="./vdremote.php?ADD=71111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>INBOUND STATS</a></TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   AGENTS DISTANTS VICIDIAL: <? echo "$PHP_AUTH_USER " ?>   <a href="<? echo $PHP_SELF ?>?force_logout=1"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=1>Déconnection</a></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TR BGCOLOR=#F0F5FE><TD ALIGN=LEFT COLSPAN=2><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>   <a href="./vdremote.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>MODIFIER</a> | <a href="./vdremote.php?ADD=61111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>ETAT</a> | <a href="./vdremote.php?ADD=71111&user=<? echo "$PHP_AUTH_USER" ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>SATISTIQUES EN ENTREE</a></TD></TR> <TR><TD ALIGN=LEFT COLSPAN=2> @@ -270,22 +272,22 @@ if ($ADD==31111) $status = $row[5]; $campaign_id = $row[6]; -echo "<br>MODIFY A REMOTE AGENTS ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n"; +echo "<br>MODIFIER UN ENREGISTREMENT D'AGENT DISTANT: $row[0]<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=ADD value=41111>\n"; echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n"; echo "<center><TABLE width=600 cellspacing=3>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>User ID Start: </td><td align=left>$user_start</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Number of Lines: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (numbers only)</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left>$row[3]</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>External Extension: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option SELECTED>ACTIVE</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left>$campaign_id</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Inbound Groups: </td><td align=left>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Début des ID utilisateurs: </td><td align=left>$user_start</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Nombre de lignes: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (nombres seulement)</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>IP du serveur: </td><td align=left>$row[3]</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Extension externe: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Etat: </td><td align=left><select size=1 name=status><option SELECTED>ACTIF</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Campagne: </td><td align=left>$campaign_id</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Groupes entrants: </td><td align=left>\n"; echo "$groups_list"; echo "</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit value=submit></td></tr>\n"; echo "</TABLE></center>\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; +echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; } @@ -301,18 +303,18 @@ if ($ADD==41111) echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "<br>REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n";} + {echo "<br>AGENT DISTANT NON MODIFIE - Veuillez revenir en arrière et vérifier les données que vous avez saisies\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 "<br>REMOTE AGENTS MODIFIED\n"; + echo "<br>AGENTS DISTANTS MODIFIES\n"; ### LOG CHANGES TO LOG FILE ### $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); + fwrite ($fp, "$date|MODIFY AGENTS DISTANTS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); fclose($fp); } @@ -328,22 +330,22 @@ if ($ADD==41111) $status = $row[5]; $campaign_id = $row[6]; -echo "<br>MODIFY A REMOTE AGENTS ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n"; +echo "<br>MODIFIER UN ENREGISTREMENT D'AGENT DISTANT: $row[0]<form action=$PHP_SELF method=POST>\n"; echo "<input type=hidden name=ADD value=41111>\n"; echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n"; echo "<center><TABLE width=600 cellspacing=3>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>User ID Start: </td><td align=left>$user_start</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Number of Lines: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (numbers only)</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left>$row[3]</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>External Extension: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option SELECTED>ACTIVE</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left>$campaign_id</td></tr>\n"; -echo "<tr bgcolor=#B6D3FC><td align=right>Inbound Groups: </td><td align=left>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Début des ID utilisateurs: </td><td align=left>$user_start</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Nombre de lignes: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (nombres seulement)</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>IP du serveur: </td><td align=left>$row[3]</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Extension externe: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (number dialed to reach agents [i.e. 913125551212])</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Etat: </td><td align=left><select size=1 name=status><option SELECTED>ACTIF</option><option>INACTIVE</option><option SELECTED>$status</option></select></td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Campagne: </td><td align=left>$campaign_id</td></tr>\n"; +echo "<tr bgcolor=#B6D3FC><td align=right>Groupes entrants: </td><td align=left>\n"; echo "$groups_list"; echo "</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit value=submit></td></tr>\n"; echo "</TABLE></center>\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; +echo "NOTE: Il peut prendre jusqu'à 30 secondes pour que les chagements soumis sur cette écran soient pris en compte\n"; } @@ -359,7 +361,7 @@ if ($ADD==61111) echo "<FONT FACE=\"Courier\" COLOR=BLACK SIZE=2><PRE>"; if ( (strlen($server_ip) < 2) or (strlen($user) < 2) ) - {echo "<br>REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} + {echo "<br>ERREUR AGENTS DISTANT - Veuillez revenir en arrière et verifier les données que vous avez saisies\n";} else { @@ -393,7 +395,7 @@ if ($ADD==61111) if (eregi("READY|PAUSED",$row[4])) { $row[3]=''; - $row[5]=' - WAITING - '; + $row[5]=' - PATIENTEZ -'; $row[6]=$row[7]; } $extension = sprintf("%-10s", $row[0]); @@ -437,16 +439,16 @@ if ($ADD==61111) } echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i agents logged in on server $server_ip\n\n"; + echo " $i agents connectés sur ce serveur $server_ip\n\n"; - echo " <SPAN class=\"yellow\"><B> </SPAN> - 5 minutes or more on call</B>\n"; - echo " <SPAN class=\"orange\"><B> </SPAN> - Over 10 minutes on call</B>\n"; + echo " <SPAN class=\"yellow\"><B> </SPAN> - En appel depuis 5 minutes ou plus</B>\n"; + echo " <SPAN class=\"orange\"><B> </SPAN> - En appel depuis plus de 10 minutes</B>\n"; } else { echo "**************************************************************************************\n"; - echo "********************************* NO AGENTS ON CALLS *********************************\n"; + echo "********************************* AUCUN AGENT EN APPEL*********************************\n"; echo "**************************************************************************************\n"; } } @@ -466,12 +468,12 @@ if ($ADD==71111) echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n"; echo "<INPUT TYPE=HIDDEN NAME=ADD VALUE=\"71111\">\n"; echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n"; - echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n"; + echo "<INPUT TYPE=Submit NAME=VALIDER VALUE=VALIDER>\n"; echo "</FORM>\n\n"; echo "<FONT FACE=\"Courier\" COLOR=BLACK SIZE=2><PRE>"; if ( (strlen($server_ip) < 2) or (strlen($user) < 2) ) - {echo "<br>REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} + {echo "<br>ERREUR AGENTS DISTANT - Veuillez revenir en arrière et verifier les données que vous avez saisies\n";} else { @@ -500,13 +502,13 @@ if ($ADD==71111) $in_time_MS = "$in_time_M_int:$in_time_SEC"; $in_time_MS = sprintf("%7s", $in_time_MS); - echo "VICIDIAL: Remote Agent inbound stats $NOW_TIME\n\n"; + echo "VICIDIAL: Statistiques des agents distants en entrée $NOW_TIME\n\n"; echo "\n"; - echo "Total calls taken $query_date: $in_calls\n"; - echo "Total talk time on $query_date: $in_time_MS (minutes:seconds)\n"; + echo "Total des appels pris $query_date: $in_calls\n"; + echo "Temps total de conversation$query_date: $in_time_MS (minutes:seconds)\n"; echo "\n"; echo "\n"; - echo "Call list for $query_date:\n"; + echo "Liste d'appel pour $query_date:\n"; echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; @@ -549,16 +551,16 @@ if ($ADD==71111) } echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agents logged in on server $server_ip\n\n"; + # echo " $i agents connectés sur ce serveur $server_ip\n\n"; - # echo " <SPAN class=\"yellow\"><B> </SPAN> - 5 minutes or more on call</B>\n"; - # echo " <SPAN class=\"orange\"><B> </SPAN> - Over 10 minutes on call</B>\n"; + # echo " <SPAN class=\"yellow\"><B> </SPAN> - En appel depuis 5 minutes ou plus</B>\n"; + # echo " <SPAN class=\"orange\"><B> </SPAN> - En appel depuis plus de 10 minutes</B>\n"; } else { echo "**************************************************************************************\n"; - echo "********************************* NO CALLS ON THIS DAY *******************************\n"; + echo "********************************* PAS D'APPELS CE JOUR*******************************\n"; echo "**************************************************************************************\n"; } } @@ -578,7 +580,7 @@ $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 "<font size=0>\n\n\n<br><br><br>\ntemps d'exécution du script: $RUNtime seconds</font>"; ?> diff --git a/LANG_www/vicidial_fr/vicidial_admin_web_logo.gif b/LANG_www/vicidial_fr/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/LANG_www/vicidial_fr/vicidial_admin_web_logo.gif differ diff --git a/LANG_www/vicidial_fr/vicidial_admin_web_logo_small.gif b/LANG_www/vicidial_fr/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/LANG_www/vicidial_fr/vicidial_admin_web_logo_small.gif differ diff --git a/LANG_www/vicidial_fr/vicidial_sales_viewer.php b/LANG_www/vicidial_fr/vicidial_sales_viewer.php new file mode 100644 index 00000000..6845d08e --- /dev/null +++ b/LANG_www/vicidial_fr/vicidial_sales_viewer.php @@ -0,0 +1,236 @@ +<? header("Pragma: no-cache"); +# +# vicidial_sales_viewer.php - VICIDIAL administration page +# +# +# Copyright (C) 2009 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# + +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"];} + +?> +<html> +<head> +<title>VICIDIAL recent sales lookup + + + + + +
"; +?> + +
+ + + + + + + + + + + + + + + + + + + + + +
Vicidial SORTANT recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a VICIDIAL 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)
Campagne 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/LANG_www/vicidial_fr/vtiger_search.php b/LANG_www/vicidial_fr/vtiger_search.php new file mode 100644 index 00000000..5e9c9761 --- /dev/null +++ b/LANG_www/vicidial_fr/vtiger_search.php @@ -0,0 +1,788 @@ + 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 +# +# 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 +# + +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 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]; + } +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; + +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;} + + + + + +########################################################################## +##### 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 + { + 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) + { + 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]; + + 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/LANG_www/vicidial_fr/vtiger_user.php b/LANG_www/vicidial_fr/vtiger_user.php new file mode 100644 index 00000000..695c1622 --- /dev/null +++ b/LANG_www/vicidial_fr/vtiger_user.php @@ -0,0 +1,316 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# + +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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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/LANG_www/vicidial/welcome.php b/LANG_www/vicidial_fr/welcome.php similarity index 64% rename from LANG_www/vicidial/welcome.php rename to LANG_www/vicidial_fr/welcome.php index f0bad6d9..14645614 100644 --- a/LANG_www/vicidial/welcome.php +++ b/LANG_www/vicidial_fr/welcome.php @@ -1,20 +1,21 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # -echo "VICIDIAL Welcome\n"; +echo "VICIDIAL Bienvenue\n"; echo "\n"; echo "\n"; -echo "




"; +echo "




"; echo ""; -echo ""; +echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "
Welcome Bienvenue
 
Agent Login
 
Horloge en temps
 
Administration
 
\n"; diff --git a/LANG_www/vicidial_fr/welcome_demo.php b/LANG_www/vicidial_fr/welcome_demo.php new file mode 100644 index 00000000..49c0e470 --- /dev/null +++ b/LANG_www/vicidial_fr/welcome_demo.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_fr/welcome_languages.php b/LANG_www/vicidial_fr/welcome_languages.php new file mode 100644 index 00000000..a89bbfcb --- /dev/null +++ b/LANG_www/vicidial_fr/welcome_languages.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/LANG_www/vicidial_it/AST_CLOSER_service_level.php b/LANG_www/vicidial_it/AST_CLOSER_service_level.php new file mode 100644 index 00000000..d78a2e5c --- /dev/null +++ b/LANG_www/vicidial_it/AST_CLOSER_service_level.php @@ -0,0 +1,956 @@ + 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 +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +$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); +$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 "Utentename/Password non validi: |$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 from vicidial_inbound_groups;"; +$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++; + } +?> + + + + + +\n"; +echo "VICIDIAL: VDAD Closer Service Level Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo " to \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFICA | REPORT \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\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 "VICIDIAL: Closer Service-Level Stats                      $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 "|                                    TOTALI | $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 TOTALI 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 TOTALI GRAPH ###
+
+	$char_counter=0;
+ 	### BEGIN CALLS TOTALI 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 TOTALI 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 "---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI\n";
+echo "+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
+echo "|    TIME     |       |  % OF CALLS GROUPED BY HOLD TIME (SEC)  | |   AVERAGE TIME BEFORE RISPOSTA (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/LANG_www/vicidial_it/AST_CLOSERstats.php b/LANG_www/vicidial_it/AST_CLOSERstats.php index 839490f5..40b400a5 100644 --- a/LANG_www/vicidial_it/AST_CLOSERstats.php +++ b/LANG_www/vicidial_it/AST_CLOSERstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -18,6 +18,8 @@ # 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 # require("dbconnect.php"); @@ -43,6 +45,7 @@ if (isset($_GET["DB"])) {$DB=$_GET["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';} ############################################# @@ -61,6 +64,17 @@ while ($i < $qm_conf_ct) ##### 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); +if ($gmt_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $local_gmt = $row[0]; + $epoch_offset = ($local_gmt * 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'");} @@ -73,7 +87,7 @@ $auth=$row[0]; { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -149,7 +163,14 @@ while ($i < $statcats_to_print) \n"; -echo "VICIDIAL: Estadísticas de VDAD Closer\n"; +echo "VICIDIAL: Estadísticas de VDAD Closer\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + if ($DB > 0) { echo "
\n"; @@ -162,7 +183,7 @@ if ($DB > 0) echo "
\n"; echo "
\n"; echo "\n"; -echo "Date Range:
\n"; +echo "Date:
\n"; echo "\n"; echo " to \n"; echo "
\n"; @@ -215,7 +236,7 @@ echo "
\n\n";
 if ($groups_to_print < 1)
 {
 echo "\n\n";
-echo "PER FAVORE SELEZIONA UN GRUPPO INBOUND E UN INTERVALLO DI TEMPO, POI PREMI INVIA\n";
+echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
 }
 
 else
@@ -329,15 +350,15 @@ else
 	$average_call_seconds = round($average_call_seconds, 0);
 	$average_call_seconds =	sprintf("%10s", $average_call_seconds);
 	}
-$ANSWEREDcalls  =	sprintf("%10s", $rowy[0]);
-if ( ($ANSWEREDcalls < 1) or ($TOTALcalls < 1) )
-	{$ANSWEREDpercent = '0';}
+$RISPOSTAEDcalls  =	sprintf("%10s", $rowy[0]);
+if ( ($RISPOSTAEDcalls < 1) or ($TOTALcalls < 1) )
+	{$RISPOSTAEDpercent = '0';}
 else
 	{
-	$ANSWEREDpercent = (($ANSWEREDcalls / $TOTALcalls) * 100);
-	$ANSWEREDpercent = round($ANSWEREDpercent, 0);
+	$RISPOSTAEDpercent = (($RISPOSTAEDcalls / $TOTALcalls) * 100);
+	$RISPOSTAEDpercent = round($RISPOSTAEDpercent, 0);
 	}
-if ( ($rowy[0] < 1) or ($ANSWEREDcalls < 1) )
+if ( ($rowy[0] < 1) or ($RISPOSTAEDcalls < 1) )
 	{$average_answer_seconds = '         0';}
 else
 	{
@@ -347,9 +368,9 @@ else
 	}
 
 
-echo "Llamadas totales tomadas in to this In-Gruppo:        $TOTALcalls\n";
+echo "Totale chiamate a prendere in questo gruppo:        $TOTALcalls\n";
 echo "Average Call Length for all Calls:            $average_call_seconds seconds\n";
-echo "Answered Calls:                               $ANSWEREDcalls  $ANSWEREDpercent%\n";
+echo "Answered Calls:                               $RISPOSTAEDcalls  $RISPOSTAEDpercent%\n";
 echo "Average queue time for Answered Calls:        $average_answer_seconds seconds\n";
 echo "Calls taken into the IVR for this In-Gruppo:   $IVRcalls\n";
 
@@ -381,15 +402,15 @@ else
 	$average_hold_seconds = round($average_hold_seconds, 0);
 	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
 	}
-if ( ($ANSWEREDcalls < 1) or ($DROPcalls < 1) )
-	{$DROP_ANSWEREDpercent = '0';}
+if ( ($RISPOSTAEDcalls < 1) or ($DROPcalls < 1) )
+	{$DROP_RISPOSTAEDpercent = '0';}
 else
 	{
-	$DROP_ANSWEREDpercent = (($DROPcalls / $ANSWEREDcalls) * 100);
-	$DROP_ANSWEREDpercent = round($DROP_ANSWEREDpercent, 0);
+	$DROP_RISPOSTAEDpercent = (($DROPcalls / $RISPOSTAEDcalls) * 100);
+	$DROP_RISPOSTAEDpercent = round($DROP_RISPOSTAEDpercent, 0);
 	}
 
-echo "Totale Chiamate ABBATTUTE: $DROPcalls  $DROPpercent%               drop/answered: $DROP_ANSWEREDpercent%\n";
+echo "Totale Chiamate ABBATTUTE: $DROPcalls  $DROPpercent%               drop/answered: $DROP_RISPOSTAEDpercent%\n";
 echo "Average hold time for DROP Calls:             $average_hold_seconds seconds\n";
 
 
@@ -416,20 +437,20 @@ if (strlen($group_SQL)>3)
 	$row=mysql_fetch_row($rslt);
 	$answer_sec_pct_rt_stat_two = $row[0];
 
-	if ( ($ANSWEREDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
+	if ( ($RISPOSTAEDcalls > 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 / $ANSWEREDcalls) * 100);
+		$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RISPOSTAEDcalls) * 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 / $ANSWEREDcalls) * 100);
+		$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RISPOSTAEDcalls) * 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/Llamadas totales tomadas in to this In-Group):  $ANSWEREDpercent%\n";
-echo "ACR (Dropped/Answered):                                $DROP_ANSWEREDpercent%\n";
+echo "GDE (Answered/Llamadas totales tomadas in to this In-Group):  $RISPOSTAEDpercent%\n";
+echo "ACR (Dropped/Answered):                                $DROP_RISPOSTAEDpercent%\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";
 
@@ -520,7 +541,7 @@ echo "Average QUEUE Length across all calls:        $average_total_queue_seconds
 $TOTALcalls = 0;
 
 echo "\n";
-echo "---------- CALL HOLD TIME BREAKDOWN IN SECONDS\n";
+echo "---------- INVITO HOLD TIME RIPARTIZIONE IN SECONDI\n";
 echo "+-------------------------------------------------------------------------------------------+------------+\n";
 echo "|     0     5    10    15    20    25    30    35    40    45    50    55    60    90   +90 | TOTAL      |\n";
 echo "+-------------------------------------------------------------------------------------------+------------+\n";
@@ -537,19 +558,19 @@ while ($i < $reasons_to_print)
 	$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] > 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++;
 	}
@@ -600,19 +621,19 @@ while ($i < $reasons_to_print)
 	$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] > 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++;
 	}
@@ -647,7 +668,7 @@ echo "+-------------------------------------------------------------------------
 $BDansweredCALLS = 0;
 
 echo "\n";
-echo "           CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\n";
+echo "           CALL RISPOSTAED 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";
@@ -665,19 +686,19 @@ while ($i < $reasons_to_print)
 	
 	### 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] > 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++;
 	}
@@ -855,7 +876,7 @@ echo "----------+---------------------------------------------------------------
 $TOTALcalls = 0;
 
 echo "\n";
-echo "---------- CALL HANGUP REASON STATS\n";
+echo "---------- INVITO hangup MOTIVO STATS\n";
 echo "+----------------------+------------+\n";
 echo "| HANGUP REASON        | CALLS      |\n";
 echo "+----------------------+------------+\n";
@@ -897,7 +918,7 @@ $TOTALcalls = 0;
 echo "\n";
 echo "---------- CALL STATUS STATS\n";
 echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
-echo "| STATUS | DESCRIZIONE          | CATEGORY             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
+echo "| STATUS | DESCRIZIONE          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
 echo "+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
 
 
@@ -1041,9 +1062,9 @@ echo "+------------------------------------------------------+------------+-----
 #########  STATUS CATEGORY STATS
 
 echo "\n";
-echo "---------- CUSTOM STATUS CATEGORY STATS\n";
+echo "---------- CUSTOM STATUS CATEGORIA STATS\n";
 echo "+----------------------+------------+--------------------------------+\n";
-echo "| CATEGORY             | CALLS      | DESCRIZIONE                    |\n";
+echo "| CATEGORIA             | CALLS      | DESCRIZIONE                    |\n";
 echo "+----------------------+------------+--------------------------------+\n";
 
 $TOTCATcalls=0;
@@ -1173,69 +1194,86 @@ echo "---------- STATISTICHE 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",$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)
 	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
+	$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;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
+	$drop_count[$i] = $Fdrop[$i];
 	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL);";
-	$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_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL);";
-	$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_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL);";
-	$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_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
-	$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)
@@ -1362,7 +1400,6 @@ while ($i <= 96)
 	$h++;
 	}
 
-
 echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n\n";
 
 
@@ -1370,26 +1407,18 @@ echo "+------+------------------------------------------------------------------
 
 
 
-##############################
-#########  CALL ANSWERED TIME BREAKDOWN IN SECONDS
-
-$BDansweredCALLS = 0;
-
+##### Answered wait time breakdown
 echo "\n";
-echo "---------- CALL ANSWERED TIME BREAKDOWN IN SECONDS\n";
+echo "---------- CALL RISPOSTAED 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;
@@ -1415,68 +1444,55 @@ while ($i <= 96)
 		else {$SQLtimeEND = "$hourEND:00:00";}
 		}
 
-	$ad_0=0; $ad_5=0; $ad10=0; $ad15=0; $ad20=0; $ad25=0; $ad30=0; $ad35=0;
-	$ad40=0; $ad45=0; $ad50=0; $ad55=0; $ad60=0; $ad90=0; $ad99=0; $BDansweredCALLS=0; 
 
-	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date $SQLtime' and call_date < '$query_date $SQLtimeEND' and  campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE') group by queue_seconds;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$reasons_to_print = mysql_num_rows($rslt);
-	$j=0;
-	while ($j < $reasons_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
+	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';}
 
-		$BDansweredCALLS = ($BDansweredCALLS + $row[0]);
-
-		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]);}
-		$j++;
-		}
-
-	$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);
-
-	$BDansweredCALLS =		sprintf("%10s", $BDansweredCALLS);
-
-	echo "|$time| $ad_0 $ad_5 $ad10 $ad15 $ad20 $ad25 $ad30 $ad35 $ad40 $ad45 $ad50 $ad55 $ad60 $ad90 $ad99 | $BDansweredCALLS |\n";
+	$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 "|TOTALI| $answeredTOTALs\n";
+echo "|TOTALI|                                                                                           | $BDansweredCALLS |\n";
 echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
 
 
+
 $ENDtime = date("U");
 $RUNtime = ($ENDtime - $STARTtime);
 echo "\nRun Time: $RUNtime seconds\n";
@@ -1484,7 +1500,9 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 
 
+
 ?>
 
+
diff --git a/LANG_www/vicidial_it/AST_IVRfilter.php b/LANG_www/vicidial_it/AST_IVRfilter.php new file mode 100644 index 00000000..6dbc3474 --- /dev/null +++ b/LANG_www/vicidial_it/AST_IVRfilter.php @@ -0,0 +1,248 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# 90310-2054 - Admin header +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +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 "Utentename/Password non validi: |$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 "Date:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "REPORT\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='INBOUND_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='INBOUND_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='INBOUND_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='INBOUND_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='INBOUND_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 AGENT   | $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 "|               TOTALI:| $total | $Utotal |\n";
+echo "+----------------------+---------+---------+\n";
+
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+
+
+
+
+?>
+
+
+ + diff --git a/LANG_www/vicidial_it/AST_IVRstats.php b/LANG_www/vicidial_it/AST_IVRstats.php index 3a5fe5a2..81f71938 100644 --- a/LANG_www/vicidial_it/AST_IVRstats.php +++ b/LANG_www/vicidial_it/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 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 # require("dbconnect.php"); @@ -26,8 +27,8 @@ 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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} @@ -64,7 +65,7 @@ $auth=$row[0]; { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -175,7 +176,14 @@ else } echo "\n"; -echo "VICIDIAL: IVR Stats\n"; +echo "VICIDIAL: IVR Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "\n";echo "\n"; -$stmt="SELECT admin_home_url from system_settings;"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; - -?> -
-
"; + if ($DB > 0) { echo "
\n"; @@ -186,13 +194,13 @@ if ($DB > 0) } echo "
\n"; -echo "
\n"; +echo "\n"; @@ -232,7 +240,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "   \n"; +echo "   \n"; echo "
\n"; echo "\n"; -echo "Date Range:
\n"; +echo "Date:
\n"; echo "\n"; echo " to \n"; echo "
\n"; -echo "Inbound Groups: \n"; +echo "Gruppi Inbound: \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "           "; -echo "MODIFY | "; -echo "REPORTS | "; -echo "CLOSER REPORT \n"; +echo "MODIFICA | "; +echo "REPORT | "; +echo "INFORME CLOSER \n"; echo "\n"; echo "
\n"; echo "\n\n"; @@ -242,7 +250,7 @@ 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";
+echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
 }
 
 else
@@ -502,7 +510,7 @@ echo "+--------+--------+--------+--------+------+------+\n";
 #########  TIME STATS
 
 echo "\n";
-echo "---------- TIME STATS\n";
+echo "---------- STATISTICHE TEMPO\n";
 
 echo "\n";
 
@@ -560,7 +568,7 @@ else
 	}
 
 echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS TAKEN INTO THIS IVR\n";
+echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE TAKEN INTO THIS IVR\n";
 
 $k=1;
 $Mk=0;
@@ -671,5 +679,6 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 ?>
 
+
diff --git a/LANG_www/vicidial_it/AST_VDADstats.php b/LANG_www/vicidial_it/AST_VDADstats.php index 66d134fb..ac06fcd5 100644 --- a/LANG_www/vicidial_it/AST_VDADstats.php +++ b/LANG_www/vicidial_it/AST_VDADstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat @@ -15,6 +15,8 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -74,7 +76,7 @@ $auth=$row[0]; { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -88,15 +90,34 @@ 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";} -$groups_to_print = mysql_num_rows($rslt); +$campaigns_to_print = mysql_num_rows($rslt); $i=0; -while ($i < $groups_to_print) +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_SQLand = "and campaign_id IN($group_SQL)"; + $group_SQL = "where campaign_id IN($group_SQL)"; + } + $stmt="select vsc_id,vsc_name from vicidial_status_categories;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -125,35 +146,62 @@ while ($i < $statcats_to_print) \n"; -echo "VICIDIAL: VDAD Stats\n"; +echo "VICIDIAL: VDAD Stats\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + echo "
\n"; +echo "
Date:
"; echo "\n"; +echo "\n"; echo "\n"; -echo " to \n"; -echo "\n"; +echo "
Campagnas:
"; +echo "\n"; +echo "
Shift:
"; echo "\n"; +echo "

\n"; echo "\n"; -echo "           MODIFICA | REPORT \n"; +echo "
        "; +echo ""; +if (strlen($group[0]) > 1) + { + echo " MODIFICA | \n"; + echo " REPORT \n"; + } +else + { + echo " CAMPAIGNS | \n"; + echo " REPORT \n"; + } +echo "
"; echo "
\n\n"; echo "
\n\n";
 
 
-if (!$group)
+if (strlen($group[0]) < 1)
 {
 echo "\n\n";
 echo "PER FAVORE SELEZIONA UNA CAMPAGNA E UNA DATA, POI PREMI INVIA\n";
@@ -191,7 +239,7 @@ echo "\n";
 echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALI\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -213,7 +261,7 @@ echo "Durata Media per Tutte Le Chiamate In Secondi: $average_hold_seconds\n";
 echo "\n";
 echo "---------- ABBATTUTE\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -243,7 +291,8 @@ while ($p < $statuses_to_print)
 	$q++;
 	$p++;
 	}
-$stmt = "SELECT status,status_name,human_answered,category from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "';";
+
+$stmt = "SELECT distinct status,status_name,human_answered,category from vicidial_campaign_statuses $group_SQL;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $statuses_to_print = mysql_num_rows($rslt);
@@ -265,11 +314,11 @@ while ($p < $statuses_to_print)
 $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' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN($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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
-$ANSWERcalls =	$row[0];
+$RISPOSTAcalls =	$row[0];
 
 if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
 	{$DROPpercent = '0';}
@@ -279,12 +328,12 @@ else
 	$DROPpercent = round($DROPpercent, 2);
 	}
 
-if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
-	{$DROPANSWERpercent = '0';}
+if ( ($DROPcalls < 1) or ($RISPOSTAcalls < 1) )
+	{$DROPRISPOSTApercent = '0';}
 else
 	{
-	$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
-	$DROPANSWERpercent = round($DROPANSWERpercent, 2);
+	$DROPRISPOSTApercent = (($DROPcallsRAW / $RISPOSTAcalls) * 100);
+	$DROPRISPOSTApercent = round($DROPRISPOSTApercent, 2);
 	}
 
 if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
@@ -297,30 +346,33 @@ else
 	}
 
 echo "Totale Chiamate ABBATTUTE: $DROPcalls  $DROPpercent%\n";
-echo "Percentuale Di Chiamate ABBATTUTE Su Chiamate Con Risposta:   $DROPcalls / $ANSWERcalls  $DROPANSWERpercent%\n";
+echo "Percentuale Di Chiamate ABBATTUTE Su Chiamate Con Risposta:   $DROPcalls / $RISPOSTAcalls  $DROPRISPOSTApercent%\n";
 echo "Durata Media Chiamate ABBATTUTE in secondi:    $average_hold_seconds\n";
 
 
-
-
-
-$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
+$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'";
-if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
+	$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
-$TOTALanswers = ($row[0] + $ANSWERcalls);
+$TOTALanswers = ($row[0] + $RISPOSTAcalls);
 
 
-$stmt = "SELECT sum(wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where campaign_id='" . mysql_real_escape_string($group) . "' and event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -328,14 +380,14 @@ $agent_non_pause_sec = $row[0];
 
 if ($agent_non_pause_sec > 0)
 	{
-	$AVG_ANSWERagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
-	$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
+	$AVG_RISPOSTAagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
+	$AVG_RISPOSTAagent_non_pause_sec = round($AVG_RISPOSTAagent_non_pause_sec, 2);
 	}
 else
-	{$AVG_ANSWERagent_non_pause_sec=0;}
-$AVG_ANSWERagent_non_pause_sec = sprintf("%10s", $AVG_ANSWERagent_non_pause_sec);
+	{$AVG_RISPOSTAagent_non_pause_sec=0;}
+$AVG_RISPOSTAagent_non_pause_sec = sprintf("%10s", $AVG_RISPOSTAagent_non_pause_sec);
 
-echo "Productivity Rating:                          $AVG_ANSWERagent_non_pause_sec\n";
+echo "Productivity Rating:                          $AVG_RISPOSTAagent_non_pause_sec\n";
 
 
 
@@ -343,7 +395,7 @@ echo "Productivity Rating:                          $AVG_ANSWERagent_non_pause_s
 echo "\n";
 echo "---------- NESSUNA RISPOSTA AUTO-DIAL\n";
 
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);";
+$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','B') and (length_in_sec <= 60 or length_in_sec is null);";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -376,12 +428,12 @@ echo "Durata Media Chiamate Senza Risposta in secondi:       $average_na_seconds
 $TOTALcalls = 0;
 
 echo "\n";
-echo "---------- CALL HANGUP REASON STATS\n";
+echo "---------- INVITO hangup MOTIVO STATS\n";
 echo "+----------------------+------------+\n";
 echo "| HANGUP REASON        | CALLS      |\n";
 echo "+----------------------+------------+\n";
 
-$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
+$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) {echo "$stmt\n";}
@@ -395,7 +447,7 @@ while ($i < $reasons_to_print)
 
 	$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           ';}
+	if (ereg("NONE",$reason))	{$reason = 'NO RISPOSTA           ';}
 	if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER            ';}
 
 	echo "| $reason | $REASONcount |\n";
@@ -422,12 +474,12 @@ echo "\n";
 echo "---------- CALL STATUS STATS\n";
 echo "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
 echo "|        |                      |                      |            |      CALL TIME                   |AGENT TIME|\n";
-echo "| STATUS | DESCRIZIONE          | CATEGORY             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
+echo "| STATUS | DESCRIZIONE          | CATEGORIA             | CALLS      | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
 echo "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
 
 
 ## 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' and  campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000;";
+$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' $group_SQLand 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) 
@@ -438,7 +490,7 @@ if ($Ctally_to_print > 0)
 
 
 ## get counts and time totals for all statuses in this campaign
-$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END'  $group_SQLand group by status;";
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -594,9 +646,9 @@ echo "+------------------------------------------------------+------------+-----
 #########  STATUS CATEGORY STATS
 
 echo "\n";
-echo "---------- CUSTOM STATUS CATEGORY STATS\n";
+echo "---------- CUSTOM STATUS CATEGORIA STATS\n";
 echo "+----------------------+------------+--------------------------------+\n";
-echo "| CATEGORY             | CALLS      | DESCRIZIONE                    |\n";
+echo "| CATEGORIA             | CALLS      | DESCRIZIONE                    |\n";
 echo "+----------------------+------------+--------------------------------+\n";
 
 
@@ -638,7 +690,7 @@ echo "+--------------------------+------------+----------+--------+\n";
 echo "| AGENT                    | CALLS      | TEMPO M   | MEDIA M |\n";
 echo "+--------------------------+------------+----------+--------+\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' and  campaign_id='" . mysql_real_escape_string($group) . "' 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;";
+$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) {echo "$stmt\n";}
@@ -717,7 +769,7 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+$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) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -753,14 +805,14 @@ $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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -768,42 +820,42 @@ while ($i <= 96)
 	$i++;
 
 
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "';";
+	$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' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
+	$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);
@@ -954,5 +1006,6 @@ echo "\nRun Time: $RUNtime seconds\n";
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php index 2189b9a3..ca5bf158 100644 --- a/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php @@ -37,7 +37,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } diff --git a/LANG_www/vicidial_it/AST_admin_log_display.php b/LANG_www/vicidial_it/AST_admin_log_display.php index 10bb7261..1bc446ca 100644 --- a/LANG_www/vicidial_it/AST_admin_log_display.php +++ b/LANG_www/vicidial_it/AST_admin_log_display.php @@ -50,7 +50,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -106,7 +106,7 @@ echo "\n\n"; echo "
\n\n";
 
 
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
+echo "VICIDIAL ADMIN Change Log                             $NOW_TIME\n";
 
 #passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
 passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
diff --git a/LANG_www/vicidial_it/AST_agent_days_detail.php b/LANG_www/vicidial_it/AST_agent_days_detail.php
new file mode 100644
index 00000000..2d1321cb
--- /dev/null
+++ b/LANG_www/vicidial_it/AST_agent_days_detail.php
@@ -0,0 +1,601 @@
+    LICENSE: AGPLv2
+#
+# CHANGES
+#
+# 90206-2202 - First build
+# 90225-1051 - Added CSV download option
+# 90310-0752 - Added admin header
+#
+
+
+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["INVIA"]))					{$INVIA=$_GET["INVIA"];}
+	elseif (isset($_POST["INVIA"]))		{$INVIA=$_POST["INVIA"];}
+
+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);
+$i=0;
+while ($i < $qm_conf_ct)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$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 "Utentename/Password non validi: |$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 "VICIDIAL: Agent Giorni di stato\n";
+	echo "";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+	echo "\n";
+	echo "\n";
+	echo "
\n";
+	}
+
+if (strlen($group[0]) < 1)
+	{
+	echo "\n";
+	echo "SELEZIONA UN UTENTE E DATA A TEMPO E CLICCA SOPRA INVIA\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 "VICIDIAL: Agent Days Dettagliata: $user                     $NOW_TIME\n";
+
+		echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENT Dettagliatas -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Days Dettagliata: $user                     $NOW_TIME\n";
+		$file_output .= "Intervallo Di Tempo: $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 "CALL 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "| TOTALI     | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
+		echo "+------------+--------+--------+--------+$statusesHEAD\n";
+
+		echo "\n\n
"; + } + else + { + $file_output .= "TOTALI,$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 "
Date:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campagnas:
"; +echo "\n"; +echo "
Utente:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; +echo ""; +if (strlen($user) > 1) + { + echo " DOWNLOAD | \n"; + echo " UTENTE | \n"; + echo " USER STATS | \n"; + } +else + {echo " USERS | \n";} +echo "REPORT \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/LANG_www/vicidial_it/AST_agent_performance.php b/LANG_www/vicidial_it/AST_agent_performance.php
index e687e172..578dc978 100644
--- a/LANG_www/vicidial_it/AST_agent_performance.php
+++ b/LANG_www/vicidial_it/AST_agent_performance.php
@@ -40,7 +40,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
diff --git a/LANG_www/vicidial_it/AST_agent_performance_detail.php b/LANG_www/vicidial_it/AST_agent_performance_detail.php
index 4b68381a..03ce999b 100644
--- a/LANG_www/vicidial_it/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_it/AST_agent_performance_detail.php
@@ -1,7 +1,7 @@
     LICENSE: AGPLv2
+# Copyright (C) 2009  Matt Florell     LICENSE: AGPLv2
 #
 # CHANGES
 #
@@ -15,6 +15,7 @@
 # 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
 #
 
 require("dbconnect.php");
@@ -32,6 +33,8 @@ 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"];}
@@ -39,8 +42,11 @@ if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
 if (isset($_GET["INVIA"]))					{$INVIA=$_GET["INVIA"];}
 	elseif (isset($_POST["INVIA"]))		{$INVIA=$_POST["INVIA"];}
 
+
 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;";
@@ -71,7 +77,7 @@ $auth=$row[0];
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -120,7 +126,14 @@ while ($i < $user_groups_to_print)
 
 \n";
-echo "VICIDIAL: Agent Performance\n";
+echo "VICIDIAL: Agent Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + echo "
\n"; echo "\n"; echo "\n"; @@ -252,7 +265,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; @@ -318,6 +331,8 @@ while ($m < $k) if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} else {$Sdispo_avg=0;} + $RAWuser = $Suser; + $RAWcalls = $Scalls; $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) @@ -427,12 +442,47 @@ while ($m < $k) $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $Toutput = "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + + $TOPsorted_output[$m] = $Toutput; + + if ($stage == 'ID') + {$TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} + if ($stage == 'CALLS') + {$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|CALLS",$stage)) + {echo "$Toutput";} + $m++; } ### END loop through each user ### + +### BEGIN sort through output to display properly ### +if (ereg("ID|TIME|CALLS",$stage)) + { + if (ereg("ID",$stage)) + {sort($TOPsort, SORT_NUMERIC);} + if (ereg("TIME|CALLS",$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=''; @@ -493,7 +543,8 @@ while ($n < $j) $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} - $TOTtotDISPO_M = ($TOTtotDISPO / 60); + if ($TOTtotDISPO < 1) {$TOTtotDISPO_M = '0';} + else {$TOTtotDISPO_M = ($TOTtotDISPO / 60);} $TOTtotDISPO_M_int = round($TOTtotDISPO_M, 2); $TOTtotDISPO_M_int = intval("$TOTtotDISPO_M_int"); $TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int); @@ -504,7 +555,8 @@ while ($n < $j) $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} - $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); + if ($TOTtotPAUSE < 1) {$TOTtotPAUSE_M = '0';} + else {$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);} $TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2); $TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int"); $TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int); @@ -515,7 +567,8 @@ while ($n < $j) $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} - $TOTtotWAIT_M = ($TOTtotWAIT / 60); + if ($TOTtotWAIT < 1) {$TOTtotWAIT_M = '0';} + else {$TOTtotWAIT_M = ($TOTtotWAIT / 60);} $TOTtotWAIT_M_int = round($TOTtotWAIT_M, 2); $TOTtotWAIT_M_int = intval("$TOTtotWAIT_M_int"); $TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int); @@ -526,8 +579,8 @@ while ($n < $j) $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} - - $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); + if ($TOTtotTALK < 1) {$TOTavgTALK_M = '0';} + else {$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);} $TOTavgTALK_M_int = round($TOTavgTALK_M, 2); $TOTavgTALK_M_int = intval("$TOTavgTALK_M_int"); $TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int); @@ -538,7 +591,8 @@ while ($n < $j) $TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS); while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);} - $TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60); + if ($TOTtotDISPO < 1) {$TOTavgDISPO_M = '0';} + else {$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);} $TOTavgDISPO_M_int = round($TOTavgDISPO_M, 2); $TOTavgDISPO_M_int = intval("$TOTavgDISPO_M_int"); $TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int); @@ -549,7 +603,8 @@ while ($n < $j) $TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS); while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);} - $TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60); + if ($TOTtotPAUSE < 1) {$TOTavgPAUSE_M = '0';} + else {$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);} $TOTavgPAUSE_M_int = round($TOTavgPAUSE_M, 2); $TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M_int"); $TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int); @@ -560,7 +615,8 @@ while ($n < $j) $TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS); while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);} - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); + if ($TOTtotWAIT < 1) {$TOTavgWAIT_M = '0';} + else {$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);} $TOTavgWAIT_M_int = round($TOTavgWAIT_M, 2); $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M_int"); $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); @@ -757,13 +813,36 @@ while ($m < $k) $USERtotTOTAL_MS = "$USERtotTOTAL_M_int:$USERtotTOTAL_S"; $pfUSERtotTOTAL_MS = sprintf("%6s", $USERtotTOTAL_MS); + $BOTTOMoutput = "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n"; + + $BOTTOMsorted_output[$m] = $BOTTOMoutput; + +# if (!ereg("ID|TIME|CALLS",$stage)) +# { + echo "$BOTTOMoutput"; +# } - echo "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n"; $m++; } ### END loop through each user ### + +### BEGIN sort through output to display properly ### +#if (ereg("ID|TIME|CALLS",$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=''; @@ -859,4 +938,6 @@ echo "\n\n"; ?> +
+ \ No newline at end of file diff --git a/LANG_www/vicidial_it/AST_agent_status_detail.php b/LANG_www/vicidial_it/AST_agent_status_detail.php new file mode 100644 index 00000000..89701bb2 --- /dev/null +++ b/LANG_www/vicidial_it/AST_agent_status_detail.php @@ -0,0 +1,665 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 90206-1554 - First build +# 90225-2252 - Added CSV download option +# 90310-2030 - Admin header +# + + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 "Utentename/Password non validi: |$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++; + } +$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 + { + $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 "VICIDIAL: Agent Giorni di stato\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 "Seleziona una campagna o utente GRUPPO E DATA A TEMPO E CLICCA SOPRA INVIA\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 "VICIDIAL: Agent Status Dettagliata                     $NOW_TIME\n";
+
+		echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
+		echo "---------- AGENT Dettagliatas -------------\n\n";
+		}
+	else
+		{
+		$file_output .= "VICIDIAL: Agent Status Dettagliata                     $NOW_TIME\n";
+		$file_output .= "Intervallo Di Tempo: $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) )
+			{
+			$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 "CALL 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=$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 ( ($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 |";
+				}
+			### 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 == 'CALLS')
+			{
+			$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|CALLS|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|CALLS|CI|DNCCI",$stage))
+		{
+		if (ereg("ID",$stage))
+			{sort($TOPsort, SORT_NUMERIC);}
+		if (ereg("TIME|CALLS|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 "|  TOTALI        AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
+		echo "+----------------------------+--------+--------+--------+$statusesHEAD\n";
+
+		echo "\n\n
"; + } + else + { + $file_output .= "TOTALI,$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 "
Date:
"; +echo "\n"; +echo "\n"; +echo "
to
\n"; +echo "
Campagnas:
"; +echo "\n"; +echo "
Gruppi Utenti:
"; +echo "\n"; +echo "
Shift:
"; +echo "

\n"; +echo "\n"; +echo "
        "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " REPORT \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/LANG_www/vicidial_it/AST_agent_time_sheet.php b/LANG_www/vicidial_it/AST_agent_time_sheet.php
index 163c3487..72a95372 100644
--- a/LANG_www/vicidial_it/AST_agent_time_sheet.php
+++ b/LANG_www/vicidial_it/AST_agent_time_sheet.php
@@ -1,13 +1,14 @@
     LICENSE: AGPLv2
+# Copyright (C) 2009  Matt Florell     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
 #
 
 require("dbconnect.php");
@@ -26,6 +27,8 @@ if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
 if (isset($_GET["INVIA"]))				{$INVIA=$_GET["INVIA"];}
 	elseif (isset($_POST["INVIA"]))	{$INVIA=$_POST["INVIA"];}
 
+$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);
 
@@ -39,7 +42,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -63,15 +66,36 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 \n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "VICIDIAL ADMIN: Agent Time Sheet\n";
-echo " - User Stats\n";
-echo " - User Status\n";
-echo " - Modifica Utente\n";
+echo "VICIDIAL: Agent Time Sheet";
+
+
+##### 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 "AgentTime Sheetfor: $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 "User ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
+echo "Utente ID: <INPUT TYPE=TEXT NAME=agent SIZE=10 MAXLENGTH=20 VALUE=\"$agent\">\n";
 echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
 echo "</FORM>\n\n";
 
@@ -98,7 +122,7 @@ if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $full_name = $row[0];
 
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
+echo "VICIDIAL: AgentTime Sheet                            $NOW_TIME\n";
 
 echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
diff --git a/LANG_www/vicidial_it/AST_inboundEXTstats.php b/LANG_www/vicidial_it/AST_inboundEXTstats.php
index 1aa397b8..0986dc06 100644
--- a/LANG_www/vicidial_it/AST_inboundEXTstats.php
+++ b/LANG_www/vicidial_it/AST_inboundEXTstats.php
@@ -38,7 +38,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
diff --git a/LANG_www/vicidial_it/AST_server_performance.php b/LANG_www/vicidial_it/AST_server_performance.php
index a4d35218..eac91aba 100644
--- a/LANG_www/vicidial_it/AST_server_performance.php
+++ b/LANG_www/vicidial_it/AST_server_performance.php
@@ -1,7 +1,7 @@
 <? 
 # AST_server_performance.php
 # 
-# Copyright (C) 2008  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
+# Copyright (C) 2009  Matt Florell <vicidial@gmail.com>    LICENSE: AGPLv2
 #
 # CHANGES
 #
@@ -10,6 +10,7 @@
 # 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
 #
 
 require("dbconnect.php");
@@ -41,7 +42,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
-    echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+    echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
     exit;
 	}
 
@@ -83,7 +84,15 @@ while ($i < $servers_to_print)
 
 <? 
 echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
-echo "<TITLE>VICIDIAL: Server Performance\n";
+echo "VICIDIAL: Server Performance\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
"; + + echo "
\n"; echo "Intervallo di tempo in formato Data/Ora: \n"; echo "to \n"; @@ -329,4 +338,6 @@ echo ""; ?> +
+ \ No newline at end of file diff --git a/LANG_www/vicidial_it/AST_timeonVDAD.php b/LANG_www/vicidial_it/AST_timeonVDAD.php index faead61d..91dd7a40 100644 --- a/LANG_www/vicidial_it/AST_timeonVDAD.php +++ b/LANG_www/vicidial_it/AST_timeonVDAD.php @@ -12,6 +12,7 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -45,7 +46,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -112,7 +113,14 @@ if ($closer_display>0) \n"; echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; +echo "VICIDIAL: Time On VDAD\n"; + +$short_header=1; + +require("admin_header.php"); + +echo "
"; + echo "
";
 
 ###################################################################################
@@ -431,5 +439,6 @@ $parked_to_print = mysql_num_rows($rslt);
 
 ?>
 
+
\ No newline at end of file diff --git a/LANG_www/vicidial_it/AST_timeonVDADall.php b/LANG_www/vicidial_it/AST_timeonVDADall.php index 2c9184b1..e0d40b77 100644 --- a/LANG_www/vicidial_it/AST_timeonVDADall.php +++ b/LANG_www/vicidial_it/AST_timeonVDADall.php @@ -1,14 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell 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 (Chris Doyle) +# 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 @@ -42,8 +42,14 @@ # 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 # +$version = '2.0.5-36'; +$build = '90310-0906'; + header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); @@ -55,10 +61,12 @@ 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["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"];} @@ -92,7 +100,7 @@ if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$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); @@ -101,13 +109,14 @@ while ($i < $qm_conf_ct) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; $i++; } ##### END SETTINGS LOOKUP ##### ########################################### if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group=''; $RR=40;} +if (!isset($group)) {$group='';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name @@ -116,10 +125,19 @@ if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 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($with_inbound)) {$with_inbound='N';} # N=no, Y=yes, O=only if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes +if (!isset($with_inbound)) + { + if ($outbound_autodial_active > 0) + {$with_inbound='N';} # 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) { @@ -174,7 +192,7 @@ $auth=$row[0]; { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -185,19 +203,47 @@ $STARTtime = date("U"); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; +$stmt="select campaign_id,campaign_name 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; + $LISTgroups[$i]='ALL-ACTIVE'; + $i++; + $groups_to_print++; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; + $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++; + } +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)"; + } + +#if ( (eregi('ALL-ACTIVE',$group_string)) and ($with_inbound=='O') and ($outbound_autodial_active > 0) ) +# {$with_inbound='N';} + $stmt="select * from vicidial_user_groups;"; $rslt=mysql_query($stmt, $link); if (!isset($DB)) {$DB=0;} @@ -217,10 +263,80 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; +$select_list = ""; +$select_list .= ""; +$select_list .= "
Select Campagnas:
"; +$select_list .= ""; +$select_list .= "
(Per selezionare più di campagna 1, tenere premuto il tasto Ctrl e fare clic su)"; +$select_list .= "
"; +$select_list .= "Chiudi pannello

"; + +if ($UGdisplay > 0) + { + $select_list .= "Select Gruppo Utente:
"; + $select_list .= "

"; + } + +$select_list .= "   Inbound:
"; +$select_list .= "   "; +$select_list .= ""; +$select_list .= "VERSIONE: $version   BUILD: $build"; +$select_list .= "
"; + +$open_list = "
Scegli Opzioni di visualizzazione Relazione
"; + ?> + + + \n"; -$stmt = "select count(*) from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "' and campaign_allow_inbound='Y';"; +$stmt = "select count(*) from vicidial_campaigns where campaign_id IN($group_SQL) and campaign_allow_inbound='Y';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campagna: $group\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Campagna: $group\n"; + + $short_header=1; + + require("admin_header.php"); + +echo ""; $ingroup_detail .= ""; $ingroup_detail .= ""; - $ingroup_detail .= ""; + $ingroup_detail .= ""; $ingroup_detail .= ""; $ingroup_detail .= ""; $ingroup_detail .= ""; @@ -473,11 +569,16 @@ if (ereg('O',$with_inbound)) } - $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; + $stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(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);"; + $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);"; - $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats;"; + } + + $stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id IN($group_SQL);"; if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";} @@ -545,19 +646,19 @@ if (ereg('O',$with_inbound)) $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); if ($agent_non_pause_sec > 0) { - $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); - $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); - $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); + $AVG_RISPOSTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RISPOSTAagent_non_pause_sec = round($AVG_RISPOSTAagent_non_pause_sec, 2); + $AVG_RISPOSTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RISPOSTAagent_non_pause_sec); } else - {$AVG_ANSWERagent_non_pause_sec=0;} + {$AVG_RISPOSTAagent_non_pause_sec=0;} } else { $PCThold_sec_stat_one=0; $PCThold_sec_stat_two=0; $AVGhold_sec_answer_calls=0; - $AVG_ANSWERagent_non_pause_sec=0; + $AVG_RISPOSTAagent_non_pause_sec=0; } echo "
"; + echo "\n"; -echo "VICIDIAL Campagna: \n"; echo "\n"; echo "\n"; echo "\n"; @@ -289,47 +411,16 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "\n"; -if ($UGdisplay > 0) - { - echo "\n"; - } -if (!eregi('XXXX-ALL-ACTIVE-XXXX', $group)) - { - echo "   Inbound:         \n"; -echo "STOP | "; -echo "PIU LENTO | "; -echo "INIZIA"; -if ($group == 'XXXX-ALL-ACTIVE-XXXX') +echo "VICIDIAL Real-Time                                                                          \n"; +echo "\n"; +echo "
\n"; +echo "Scegli Opzioni di visualizzazione Relazione"; +echo "
\n"; +echo "
\n"; +echo "STOP | "; +echo "PIU LENTO | "; +echo "INIZIA"; +if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFICA | \n"; } @@ -337,8 +428,7 @@ else { echo "       MODIFICA | \n"; } -echo "RIEPILOGO | \n"; -echo "REPORT
\n"; +echo "RIEPILOGO \n"; echo "\n\n"; @@ -351,13 +441,19 @@ $multi_drop=0; if (ereg('O',$with_inbound)) { $multi_drop++; - $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + while ($ccamps_to_print > $c) + { $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaignsSQL = "'$closer_campaigns'"; + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} if ($adastats>1) @@ -428,19 +524,19 @@ if (ereg('O',$with_inbound)) $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); if ($agent_non_pause_sec > 0) { - $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); - $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); - $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); + $AVG_RISPOSTAagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_RISPOSTAagent_non_pause_sec = round($AVG_RISPOSTAagent_non_pause_sec, 2); + $AVG_RISPOSTAagent_non_pause_sec = sprintf("%01.2f", $AVG_RISPOSTAagent_non_pause_sec); } else - {$AVG_ANSWERagent_non_pause_sec=0;} + {$AVG_RISPOSTAagent_non_pause_sec=0;} } else { $PCThold_sec_stat_one=0; $PCThold_sec_stat_two=0; $AVGhold_sec_answer_calls=0; - $AVG_ANSWERagent_non_pause_sec=0; + $AVG_RISPOSTAagent_non_pause_sec=0; } if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} @@ -460,7 +556,7 @@ if (ereg('O',$with_inbound)) $ingroup_detail .= "
ANSWERS TODAY:  $answersTODAY    RISPOSTAS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
"; @@ -575,7 +676,7 @@ if (ereg('O',$with_inbound)) echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -583,7 +684,7 @@ if (ereg('O',$with_inbound)) echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -593,12 +694,12 @@ if (ereg('O',$with_inbound)) ##### NOT INBOUND ONLY ### else { - if ($group=='XXXX-ALL-ACTIVE-XXXX') + if (eregi('ALL-ACTIVE',$group_string)) { $multi_drop++; $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } else { @@ -607,24 +708,31 @@ else if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) { $multi_drop++; - $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $stmt = "select distinct closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; $rslt=mysql_query($stmt, $link); + $ccamps_to_print = mysql_num_rows($rslt); + $c=0; + while ($ccamps_to_print > $c) + { $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaignsSQL = "'$closer_campaigns'"; + $closer_campaignsSQL .= "'$closer_campaigns',"; + $c++; + } + $closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; + $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 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),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$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 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 from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $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) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="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) . "';"; + $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";} @@ -655,8 +763,8 @@ else $agent_pause_codes_active = $row[19]; - $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; - if ($group=='XXXX-ALL-ACTIVE-XXXX') + $stmt="select count(*) from vicidial_hopper where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) { $stmt="select count(*) from vicidial_hopper;"; } @@ -701,8 +809,8 @@ else } else {$diffpctONEMIN = '0.00';} - $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; - if ($group=='XXXX-ALL-ACTIVE-XXXX') + $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id IN($group_SQL);"; + if (eregi('ALL-ACTIVE',$group_string)) { $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;"; } @@ -721,7 +829,7 @@ else if ($adastats>1) { echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -782,59 +890,59 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       NASCONDI GRUPPI UTENTI"; + echo "       NASCONDI GRUPPI UTENTI"; } else { - echo "       MOSTRA GRUPPI UTENTI"; + echo "       MOSTRA GRUPPI UTENTI"; } if ($UidORname>0) { - echo "       MOSTRA ID OPERATORE"; + echo "       MOSTRA ID OPERATORE"; } else { - echo "       MOSTRA NOME OPERATORE"; + echo "       MOSTRA NOME OPERATORE"; } if ($SERVdisplay>0) { - echo "       NASCONDI INFO SERVER"; + echo "       NASCONDI INFO SERVER"; } else { - echo "       MOSTRA INFO SERVER"; + echo "       MOSTRA INFO SERVER"; } if ($CALLSdisplay>0) { - echo "       NASCONDI WAITING CALLS"; + echo "       NASCONDI WAITING CALLS"; } else { - echo "       MOSTRA WAITING CALLS"; + echo "       MOSTRA WAITING CALLS"; } if ($PHONEdisplay>0) { - echo "       NASCONDI PHONES"; + echo "       NASCONDI PHONES"; } else { - echo "       MOSTRA PHONES"; + echo "       MOSTRA PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       NASCONDI CUSTPHONES"; + echo "       NASCONDI CUSTPHONES"; } else { - echo "       MOSTRA CUSTPHONES"; + echo "       MOSTRA CUSTPHONES"; } echo ""; echo ""; @@ -847,21 +955,29 @@ echo "\n\n"; ################################################################################### if ($campaign_allow_inbound > 0) { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $stmt="select closer_campaigns from vicidial_campaigns where campaign_id IN($group_SQL);"; $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'"; + $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); - $stmtB="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 IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (campaign_id IN($group_SQL) and call_type IN('OUT','OUTBALANCE')) ) order by queue_priority desc,campaign_id,call_time;"; } else { - if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} - else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} + if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} + else {$UgroupSQL = " and campaign_id IN($group_SQL)";} - $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $groupSQL order by queue_priority desc,campaign_id,call_time;"; + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $UgroupSQL order by queue_priority desc,campaign_id,call_time;"; } if ($CALLSdisplay > 0) { @@ -933,6 +1049,21 @@ $parked_to_print = mysql_num_rows($rslt); $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='';} @@ -1027,7 +1158,7 @@ if ($campaignord=='campaignup') {$campaignord='campaigndown';} else {$campaignord='campaignup';} $Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campagna: $group $NOW_TIME\n"; +$Aecho .= "VICIDIAL: Agents Time On Calls Campagna: $group_string $NOW_TIME\n"; $HDbegin = "+"; @@ -1035,11 +1166,11 @@ $HTbegin = "|"; $HDstation = "------------+"; $HTstation = " STATION |"; $HDphone = "------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "--------------------+"; -$HTuser = " UTENTE |"; +$HTuser = " UTENTE |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " Utente Group |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1053,9 +1184,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAGNA |"; +$HTcampaign = " CAMPAGNA |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1128,12 +1259,12 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} -else {$groupSQL = " and vicidial_live_agents.campaign_id='" . mysql_real_escape_string($group) . "'";} +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 from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; +$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 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); @@ -1439,8 +1570,8 @@ $calls_to_list = mysql_num_rows($rslt); $L=''; $R=''; - if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} - if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R='';} + if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} + if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R='';} if ($SIPmonitorLINK>1) {$R=" | BARGE";} if ($IAXmonitorLINK>1) {$R=" | BARGE";} @@ -1485,7 +1616,7 @@ $calls_to_list = mysql_num_rows($rslt); $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load Average: $load_ave\n\n"; + $Aecho .= " Sistema di carico Average: $load_ave\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -1511,7 +1642,7 @@ $calls_to_list = mysql_num_rows($rslt); 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 agents in dead calls      \n"; + echo "$NFB$agent_dead$NFE agenti morti chiamate      \n"; echo "
";
 		echo "";
@@ -1526,5 +1657,6 @@ $calls_to_list = mysql_num_rows($rslt);
 
 ?>
 
+
ANSWERS TODAY:  $answersTODAY    RISPOSTAS TODAY:  $answersTODAY    (Agent non-pause time / Answers)Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
DROP PERCENT:  $drpctTODAY%    PRODUCTIVITY:  $AVG_ANSWERagent_non_pause_sec     PRODUCTIVITY:  $AVG_RISPOSTAagent_non_pause_sec    
- min   LIVELLO MAX:  $maxDIALlev   - min   LIVELLO MAX:  $maxDIALlev   ABBATTIMENTO MAX:  $DROPmax%    TARGET DIFF:  $targetDIFF     INTENSITY:  $ADAintense    
diff --git a/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php index 2c1a53b0..47c4f75d 100644 --- a/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -14,6 +14,7 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -50,7 +51,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -105,7 +106,14 @@ if (!isset($RR)) {$RR=4;} \n"; -echo "VICIDIAL: Riepilogo Di Tutte Le Campagne Aggiornato In Tempo Reale/TITLE></HEAD><BODY BGCOLOR=WHITE>\n"; +echo "<TITLE>VICIDIAL: Riepilogo Di Tutte Le Campagne Aggiornato In Tempo Reale/TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>"; + echo "<b>VICIDIAL: Riepilogo Di Tutte Le Campagne Aggiornato In Tempo Reale/b>           \n"; echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats\">STOP</a> | "; echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats\">PIU LENTO</a> | "; @@ -443,5 +451,6 @@ $k++; ?> </PRE> +</TD></TR></TABLE> </BODY></HTML> diff --git a/LANG_www/vicidial_it/AST_timeonpark.php b/LANG_www/vicidial_it/AST_timeonpark.php index adeac370..0992a27b 100644 --- a/LANG_www/vicidial_it/AST_timeonpark.php +++ b/LANG_www/vicidial_it/AST_timeonpark.php @@ -36,7 +36,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } diff --git a/LANG_www/vicidial_it/admin.php b/LANG_www/vicidial_it/admin.php index 279bd821..d707dc95 100644 --- a/LANG_www/vicidial_it/admin.php +++ b/LANG_www/vicidial_it/admin.php @@ -1,8 +1,8 @@ <? # admin.php - VICIDIAL administration page # -# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 -# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# require("dbconnect.php"); @@ -13,7 +13,7 @@ require("dbconnect.php"); ###################################################################################################### $page_width='770'; -$section_width='720'; +$section_width='750'; $header_font_size='3'; $subheader_font_size='2'; $subcamp_font_size='2'; @@ -29,22 +29,16 @@ $scripts_color = '#99FFCC'; $filters_color = '#CCCCCC'; $admin_color = '#FF99FF'; $reports_color = '#99FF33'; -#$users_color = '#FFFF99'; -#$campaigns_color = '#FFFF99'; -#$lists_color = '#FFFF99'; -#$ingroups_color = '#FFFF99'; -#$remoteagent_color ='#FFFF99'; -#$usergroups_color = '#FFFF99'; -#$scripts_color = '#FFFF99'; -#$filters_color = '#FFFF99'; -#$admin_color = '#FFFF99'; -#$reports_color = '#FFFF99'; $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'; +$subcamp_color = '#FF9933'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -61,9 +55,32 @@ $reports_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; $status_font = 'BLACK'; -$subcamp_color = '#FF9933'; $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'; +$subcamp_color = '#C6C6C6'; +### + + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -853,6 +870,90 @@ if (isset($_GET["answer_sec_pct_rt_stat_one"])) {$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($script_id)) {$script_id= strtoupper($script_id);} @@ -866,7 +967,7 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -874,7 +975,11 @@ $i=0; while ($i < $qm_conf_ct) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; $i++; } ##### END SETTINGS LOOKUP ##### @@ -1025,6 +1130,14 @@ $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); ### DIGITS and COLONS $shift_length = ereg_replace("[^\:0-9]","",$shift_length); @@ -1073,6 +1186,10 @@ $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); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); @@ -1104,6 +1221,8 @@ $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); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1113,6 +1232,7 @@ $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); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1160,8 +1280,8 @@ $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); +$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); @@ -1216,6 +1336,17 @@ $hold_time_option_voicemail = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_optio $hold_time_option_callback_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$hold_time_option_callback_filename); $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); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -1268,6 +1399,11 @@ $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); ### 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); @@ -1286,6 +1422,9 @@ $after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after $welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); $onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); $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); ### 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); @@ -1299,12 +1438,19 @@ $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); +$globals_string = ereg_replace(";","",$globals_string); +$dialplan_entry = ereg_replace(";","",$dialplan_entry); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address # $queuemetrics_url # $admin_home_url # $qc_web_form_address +# $vtiger_url ### VARIABLES not filtered at all ### # $script_text @@ -1475,16 +1621,42 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); # 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 # # 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.0.5-149'; -$build = '81107-1551'; +$admin_version = '2.0.5-172'; +$build = '90310-2203'; $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); @@ -1518,7 +1690,7 @@ while ($i < $qm_conf_ct) ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; +$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); @@ -1536,7 +1708,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -1546,48 +1718,50 @@ $browser = getenv("HTTP_USER_AGENT"); { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * 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[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]; + $stmt="SELECT * 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]; - $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]; + $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|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); fclose($fp); } } @@ -1624,18 +1798,21 @@ if ($ADD==111) {$hh='lists'; echo "Aggiungi Nuova Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} if ($ADD==1111) {$hh='ingroups'; echo "Aggiungi Nuovo Gruppo Inbound";} if ($ADD==1211) {$hh='ingroups'; echo "Copia Gruppo Inbound";} -if ($ADD==1311) {$hh='ingroups'; echo "Add New DID";} -if ($ADD==1411) {$hh='ingroups'; echo "Copy DID";} +if ($ADD==1311) {$hh='ingroups'; echo "Aggiungi nuovoDID";} +if ($ADD==1411) {$hh='ingroups'; echo "CopiaDID";} if ($ADD==11111) {$hh='remoteagent'; echo "Aggiungi Nuovo Operatore Remoto";} if ($ADD==111111) {$hh='usergroups'; echo "Aggiungi Nuovo Gruppo Utente";} if ($ADD==1111111) {$hh='scripts'; echo "Aggiungi Nuovo Script";} if ($ADD==11111111) {$hh='filters'; echo "Agiungi Nuovo Filtro";} if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Agregue El Nuevo Tiempo De la Llamada";} -if ($ADD==131111111) {$hh='admin'; $sh='times'; echo "Add New Shift";} +if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Aggiungi nuovo Shift";} if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Agregue El Nuevo Tiempo De la Llamada Del Estado";} if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI TELEFONO";} -if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI TELEFONO ALIAS";} +if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI NUOVO TELEFONO ALIAS";} +if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI NUOVO GRUPPO ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "AGGIUNGI SERVER";} +if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "ADD NEW CONF TEMPLATE";} +if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "AGGIUNGI NUOVO VETTORE";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NUEVA CONFERENCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "Creazione Nuovo Utente";} @@ -1652,24 +1829,27 @@ if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la if ($ADD==211) {$hh='lists'; echo "Creazione Nuova Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Creazione Nuovo Gruppo Inbound";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} -if ($ADD==2311) {$hh='ingroups'; echo "New DID Addition";} -if ($ADD==2411) {$hh='ingroups'; echo "New Copied DID Addition";} +if ($ADD==2311) {$hh='ingroups'; echo "Nuova aggiunta DID";} +if ($ADD==2411) {$hh='ingroups'; echo "Nuova aggiunta Copiato DID";} if ($ADD==21111) {$hh='remoteagent'; echo "Creazuibe Nuovi Operatori Remoti";} if ($ADD==211111) {$hh='usergroups'; echo "Creazione Nuovo Gruppo Utenti";} if ($ADD==2111111) {$hh='scripts'; echo "Creazione Nuovo Script";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adicio`n Del Filtro";} if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "Nueva Adicio`n Del Tiempo De la Llamada";} -if ($ADD==231111111) {$hh='admin'; $sh='times'; echo "New Shift Addition";} +if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "Nuova aggiunta Maiusc";} if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "Nueva Adicio`n Del Tiempo De la Llamada Del Estado";} if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "CREANDO telefono";} -if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "CREANDO telefono ALIAS";} +if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "Aggiunta di nuovi TELEFONO ALIAS";} +if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGENDO NUOVO GRUPPO ALIAS";} if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIo`N DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} +if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Aggiunta di nuovi CONF TEMPLATE";} +if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Aggiunta di nuovi VETTORE";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "CREANDO CONFERENCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "AGGIUNGI ESITI DI DEFAULT VICIDIAL";} if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADICIo`N DE CATEGORÍA DEL ESTADO DE VICIDIAL";} -if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL QC STATUS CODE";} +if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "AGGIUNGENDO VICIDIAL QC CODICE STATO";} if ($ADD==3) {$hh='users'; echo "Modifica Utente";} if ($ADD==30) {$hh='campaigns'; echo "Campagna Non Autorizzata";} if ($ADD==31) @@ -1678,11 +1858,11 @@ if ($ADD==31) if ($SUB==22) {echo " - Esiti";} if ($SUB==23) {echo " - Hot-Key";} if ($SUB==25) {echo " -Riciclaggio ContattiEntries";} - if ($SUB==26) {echo " - Auto Alt Dial Esiti";} + if ($SUB==26) {echo " - Alt Auto Dial Esiti";} if ($SUB==27) {echo " - Agent Codici Pausa";} if ($SUB==28) {echo " - QC";} - if ($SUB==29) {echo " - List Mixes";} - if ($SUB=='20A') {echo " - Survey";} + if ($SUB==29) {echo " - Elenco Mixes";} + if ($SUB=='20A') {echo " - Indagine";} } if ($ADD==34) { @@ -1690,11 +1870,11 @@ if ($ADD==34) if ($SUB==22) {echo " - Esiti";} if ($SUB==23) {echo " - Hot-Key";} if ($SUB==25) {echo " -Riciclaggio ContattiEntries";} - if ($SUB==26) {echo " - Auto Alt Dial Esiti";} + if ($SUB==26) {echo " - Alt Auto Dial Esiti";} if ($SUB==27) {echo " - Agent Codici Pausa";} if ($SUB==28) {echo " - QC";} - if ($SUB==29) {echo " - List Mixes";} - if ($SUB=='20A') {echo " - Survey";} + if ($SUB==29) {echo " - Elenco Mixes";} + if ($SUB=='20A') {echo " - Indagine";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Esiti Campagna";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Hot-Key Campagna";} @@ -1705,24 +1885,27 @@ if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la C if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} if ($ADD==311) {$hh='lists'; echo "Modifica Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} -if ($ADD==3311) {$hh='ingroups'; echo "Modify DID";} +if ($ADD==3311) {$hh='ingroups'; echo "ModificareDID";} if ($ADD==31111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} if ($ADD==311111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==3111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==31111111) {$hh='filters'; echo "Modifica Filtro";} if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada";} if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modifique La Lista De las Definiciones Del Estado Del Tiempo De laLlamada";} -if ($ADD==331111111) {$hh='admin'; $sh='times'; echo "Modify Shift";} +if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Modificare Maiusc";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL telefonO";} -if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL telefonO ALIAS";} +if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFICA ALIAS TELEFONO";} +if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFICA GRUPPO ALIAS";} if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFICAR EL SERVIDOR";} +if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "MODIFICA TEMPLATE CONF";} +if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICA DEL VETTORE";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFICA IMPOSTAZIONI DI SISTEMA";} if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFICA ESITI DI DEFAULT VICIDIAL";} if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFICA LE CATEGORIE DI ESITI DI VICIDIAL";} -if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC STATUS CODE";} +if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFICA VICIDIAL QC CODICE STATO";} if ($ADD=="4A") {$hh='users'; echo "Modifica Utente - Admin";} if ($ADD=="4B") {$hh='users'; echo "Modifica Utente - Admin";} if ($ADD==4) {$hh='users'; echo "Modifica Utente";} @@ -1732,50 +1915,56 @@ if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modifica Campagna HotKey"; if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modifica Campagna - Vista Generale";} if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la Campaña Reciclan";} if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Co`digo De la Pausa Del Agente";} -if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modifica Campagna QC Settings";} +if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modifica impostazioni campagna, QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} -if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modifica Campagna Survey";} +if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificare la campagna Sondaggio";} if ($ADD==411) {$hh='lists'; echo "Modifica Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} -if ($ADD==4311) {$hh='ingroups'; echo "Modify DID";} +if ($ADD==4311) {$hh='ingroups'; echo "ModificareDID";} if ($ADD==41111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} if ($ADD==411111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==4111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==41111111) {$hh='filters'; echo "Modifica Filtro";} if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada";} -if ($ADD==431111111) {$hh='admin'; $sh='times'; echo "Modify Shift";} +if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Modificare Maiusc";} if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL telefonO";} -if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFICAR EL telefonO ALIAS";} +if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFICA ALIAS TELEFONO";} +if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFICA GRUPPO ALIAS";} if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "MODIFICAR EL SERVIDOR";} if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFIQUE EL EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} +if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "MODIFICA TEMPLATE CONF";} +if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFICA DEL VETTORE";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFICA IMPOSTAZIONI DI SISTEMA";} if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFICA ESITI DI DEFAULT VICIDIAL";} if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LAS CATEGORÍAS DEL ESTADO DE VICIDIAL";} -if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC STATUS CODE";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campagna";} +if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFICA VICIDIAL QC CODICE STATO";} +if ($ADD==5) {$hh='users'; echo "EliminareUtente";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "EliminareCampagna";} if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Disconnetti Operatori";} if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==5311) {$hh='ingroups'; echo "Delete DID";} +if ($ADD==511) {$hh='lists'; echo "EliminareList";} +if ($ADD==5111) {$hh='ingroups'; echo "EliminareIn-Group";} +if ($ADD==5311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} if ($ADD==511111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==5111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==51111111) {$hh='filters'; echo "Cancella Filtro";} -if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} -if ($ADD==531111111) {$hh='admin'; $sh='times'; echo "Delete Shift";} +if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "EliminareCall Time";} +if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Elimina Maiusc";} if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelacio`n";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} -if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} +if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE TELEFONO ALIAS";} +if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "Elimina gruppo ALIAS";} if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "CANC CONF TEMPLATE";} +if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "CANC VETTORE";} 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 "Delete User";} -if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campagna";} +if ($ADD==6) {$hh='users'; echo "EliminareUtente";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "EliminareCampagna";} if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Disconnetti Operatori";} if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "El Plomo De la Cancelacio`n Recicla";} @@ -1783,24 +1972,31 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Co`digo De la Pausa Del Agente De la Cancelacio`n";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Esito Campagna Rimosso";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quito`";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==6311) {$hh='ingroups'; echo "Delete DID";} +if ($ADD==611) {$hh='lists'; echo "EliminareList";} +if ($ADD==6111) {$hh='ingroups'; echo "EliminareIn-Group";} +if ($ADD==6311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} if ($ADD==611111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==6111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==61111111) {$hh='filters'; echo "Cancella Filtro";} -if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} -if ($ADD==631111111) {$hh='admin'; $sh='times'; echo "Delete Shift";} +if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "EliminareCall Time";} +if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Elimina Maiusc";} if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelacio`n";} if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} -if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} +if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE TELEFONO ALIAS";} +if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "Elimina gruppo ALIAS";} if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL DE LA CANCELACIo`N";} +if ($ADD==621111111111) {$hh='admin'; $sh='templates'; echo "CANC CONF TEMPLATE";} +if ($ADD==621111111111) {$hh='admin'; $sh='carriers'; echo "CANC VETTORE";} 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 "Cuenta Del Plomo De Dialable";} if ($ADD==7111111) {$hh='scripts'; echo "Anteprima Script";} +if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL ADMIN Change Log";} +if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL Lutente admin CAMBIAMENTO LOG";} +if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL SEZIONE ADMIN Change Log";} +if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL DETTAGLIO ADMIN Change Log";} if ($ADD==0) {$hh='users'; echo "Lista Utenti";} if ($ADD==8) {$hh='users'; echo "Richiami Dell`Operatore";} if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Richiami Nella Campagna";} @@ -1815,11 +2011,14 @@ if ($ADD==100000) {$hh='usergroups'; echo "Gruppi Utenti";} if ($ADD==1000000) {$hh='scripts'; echo "Script";} if ($ADD==10000000) {$hh='filters'; echo "Filtri";} if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Orari Chiamata";} -if ($ADD==130000000) {$hh='admin'; $sh='times'; echo "Shifts";} +if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Turni";} if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "Tiempos De la Llamada Del Estado";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "ELENCO TELEFONI";} -if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS LIST";} +if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "ALIAS ELENCO TELEFONICO";} +if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "GRUPPO ALIAS ELENCO";} if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "ELENCO SEEVER";} +if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "CONF TEMPLATE ELENCO";} +if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "ELENCO CARRIER";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "LISTA DE CONFERENCIAS";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL LISTA DE CONFERENCIAS";} if ($ADD==550) {$hh='users'; echo "Form di Ricerca";} @@ -1900,7 +2099,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; - $RANKcampaigns_list="<tr><td>CAMPAGNA</td><td>     CLASSIFICA</td><td>     CALLS</td></tr>\n"; + $RANKcampaigns_list="<tr><td>CAMPAGNA</td><td>     CLASSIFICA</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) @@ -1915,30 +2114,40 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($campaigns_to_print > $o) { - $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$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]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else - {$calls_today=0; $SELECT_campaign_rank=0;} + {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { 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' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $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); } else { - $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $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); } @@ -1993,8 +2202,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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></tr>\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 ##### @@ -2002,7 +2214,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD ##### BEGIN get inbound groups listing for checkboxes ##### $xfer_groupsSQL=''; - if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) + 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); @@ -2051,13 +2263,14 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups = explode(" ", $closer_campaigns); } - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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>INBOUND GROUP</td><td>     CLASSIFICA</td><td>     CALLS</td></tr>\n"; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     CLASSIFICA</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($groups_to_print > $o) @@ -2071,14 +2284,17 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o=0; while ($groups_to_print > $o) { - $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$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]; + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + $group_web_vars = $row[2]; } else {$calls_today=0; $SELECT_group_rank=0;} @@ -2086,15 +2302,23 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { 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' where group_id='$group_id_values[$o]' and user='$user';"; + $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); } 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';"; + $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); } @@ -2152,8 +2376,11 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $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></tr>\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 .= " -";} @@ -2208,8 +2435,8 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $p++; } $campaigns_list.="> ALL-CAMPAIGNS - GLI UTENTI POSSONO VISUALIZZARE QUALSIASI CAMPAGNA</B><BR>\n"; - $qc_campaigns_list.="> ALL-CAMPAIGNS - USERS CAN QC ANY CAMPAIGN</B><BR>\n"; - $qc_groups_list.="> ALL-GROUPS - USERS CAN QC ANY INBOUND GROUP</B><BR>\n"; + $qc_campaigns_list.="> ALL-CAMPAIGNS - Gli utenti possono, QC OGNI CAMPAGNA</B><BR>\n"; + $qc_groups_list.="> ALL-GROUPS - Gli utenti possono QC INBOUND OGNI GRUPPO</B><BR>\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); @@ -2355,6 +2582,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Paso del telefono -</B> aquí es para donde usted puede fijar un valor del paso del telefono del defecto cuando los registros del usuario en vicidial.php. Este valor poblará los phone_pass automáticamente cuando el usuario entra con su usuario-pasar-campaña en la pantalla de la conexion de vicidial.php. +<BR> +<A NAME="vicidial_users-active"> +<BR> +<B>Attivo - </B> Questo campo definisce se lutente è attivo nel sistema e può essere utilizzato VICIDIAL risorse. Il valore di default è Y + <BR> <A NAME="vicidial_users-hotkeys_active"> <BR> @@ -2390,25 +2622,42 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Vicidial transfiere -</B> esta opcio`n puede evitar que un agente abra la transferencia - la sesio`n de la conferencia de vicidial. Si esto es lisiado, el agente no puede llamada de los terceros o la transferencia oculta cualquiera llama. -<BR> -<A NAME="vicidial_users-closer_default_blended"> -<BR> -<B>Un defecto más cercano mezclado -</B> esta opcio`n omite simplemente el checkbox mezclado en una pantalla MÁS CERCANA de la conexion. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-closer_default_blended"> + <BR> + <B>Un defecto más cercano mezclado -</B> esta opcio`n omite simplemente el checkbox mezclado en una pantalla MÁS CERCANA de la conexion. + <? + } +?> <BR> <A NAME="vicidial_users-vicidial_recording_override"> <BR> <B>Invalidacio`n de la grabacion de VICIDIAL -</B> esta opcio`n seeliminará lo que es la opcio`n en la campaña para la grabacion.LISIADO no eliminará el ajuste de la grabacion de la campaña. NUNCAinhabilitará la grabacion en el cliente. ONDEMAND es el defecto ypermite que el agente comience y pare a registrar según lonecesitado. ALLCALLS comenzará la grabacion en el cliente siempreque una llamada se envíe a un agente. ALLFORCE comenzará lagrabacion en el cliente siempre que una llamada se envíe a un agenteque no da al agente ninguna opcio`n para parar el registrar. ParaALLCALLS y ALLFORCE hay una opcio`n para utilizar la grabacionretrasa para reducir en grabaciones y carga de sistema muy cortas delrecude. +<BR> +<A NAME="vicidial_users-agent_shift_enforcement_override"> +<BR> +<B>Agente Maiusc esecuzione Sovrascrive -</B> Questa impostazione si sovrascriverà qualsiasi cosa gli utenti del gruppo di utenti ha fissato per lesecuzione Maiusc. ANDICAPPATI utilizzerà lutente gruppo. OFF non applicare a tutti i turni. INIZIO solo applicare il login, ma non riguarda un agente che è in esecuzione sul loro passaggio, se essi sono già eseguito laccesso TUTTE imporrà a turni orario di inizio e di un agente di log dopo che corrono oltre la fine del loro turno tempo. Il valore di default è disattivato. + +<BR> +<A NAME="vicidial_users-alert_enabled"> +<BR> +<B>Alert Attivato - </B> Questo campo indica se lagente ha permesso browser avvisi per quando si chiede loro in vicidial.php sessione. Il valore di default è 0 per il NO. + <BR> <A NAME="vicidial_users-vicidial_users-campaign_ranks"> <BR> -<B>La campaña alinea -</B> en esta seccio`n usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. +<B>La campaña alinea -</B> en esta seccio`n usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. Anche in questa sezione sono WEB VAR per ciascuna campagna. Questi permettono di ogni agente di avere una diversa variabile stringa che può essere aggiunto al Web Form o SCRIPT scheda URL semplicemente messa - A - web_vars - B - come si farebbe con qualsiasi altro posto campo. <BR> <A NAME="vicidial_users-closer_campaigns"> <BR> -<B>Grupos de entrada -</B> aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. Usted Tambien podrá fijar la fila, o el nivel de habilidad, en estaseccio`n para cada uno de los grupos de entrada así como poder ver elnúmero de las llamadas recibidas de cada grupo de entrada para esteagente específico. Tambien en esta seccio`n está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opcio`n seselecciona en la pantalla del en-grupo. +<B>Grupos de entrada -</B> aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. Usted Tambien podrá fijar la fila, o el nivel de habilidad, en estaseccio`n para cada uno de los grupos de entrada así como poder ver elnúmero de las llamadas recibidas de cada grupo de entrada para esteagente específico. Tambien en esta seccio`n está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opcio`n seselecciona en la pantalla del en-grupo. Anche in questa sezione sono WEB VAR per ciascuna campagna. Questi permettono di ogni agente di avere una diversa variabile stringa che può essere aggiunto al Web Form o SCRIPT scheda URL semplicemente messa - A - web_vars - B - come si farebbe con qualsiasi altro posto campo. <BR> <A NAME="vicidial_users-alter_custdata_override"> @@ -2418,7 +2667,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_users-alter_custphone_override"> <BR> -<B>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. +<B>Agente Alter clienti Telefono Sovrascrive - </B> Questa opzione sovrascrive lopzione è ciò che nella campagna per modificare il numero di telefono del cliente. NOT_ACTIVE userà qualsiasi impostazione è presente per la campagna. ALLOW_ALTER sempre per consentire lagente di modificare il numero di telefono del cliente, non importa ciò che la campagna è limpostazione. Il valore di default è NOT_ACTIVE. <BR> <A NAME="vicidial_users-alter_agent_interface_options"> @@ -2455,10 +2704,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Suprima los agentes alejados -</B> esta opcio`n si el sistema a 1 permite que el usuario suprima agentes alejados vicidial del sistema. -<BR> -<A NAME="vicidial_users-load_leads"> -<BR> -<B>La carga conduce -</B> esta opcio`n si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-load_leads"> + <BR> + <B>La carga conduce -</B> esta opcio`n si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. + <? + } +?> <BR> <A NAME="vicidial_users-campaign_detail"> @@ -2490,10 +2746,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Cambie la campaña del agente -</B> esta opcio`n si el sistema a 1 permite que el usuario altere la campaña que un agente está registrado en mientras que se registran en e`l. -<BR> -<A NAME="vicidial_users-delete_filters"> -<BR> -<B>La cancelacio`n se filtra -</B> esta opcio`n permite que el usuario pueda suprimir los filtros vicidial del plomo del sistema. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-delete_filters"> + <BR> + <B>La cancelacio`n se filtra -</B> esta opcio`n permite que el usuario pueda suprimir los filtros vicidial del plomo del sistema. + <? + } +?> <BR> <A NAME="vicidial_users-delete_call_times"> @@ -2515,57 +2778,80 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>La visio`n divulga -</B> esta opcio`n permite que el usuario visio`n losinformes de VICIDIAL. -<BR> -<A NAME="vicidial_users-qc_enabled"> -<BR> -<B>QC Enabled -</B> This option allows the user to log in to the Quality Control agent screen. +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_users-qc_enabled"> + <BR> + <B>QC Attivato - </B> Questa opzione permette allutente di accedere alla schermata di controllo della qualità agente. -<BR> -<A NAME="vicidial_users-qc_user_level"> -<BR> -<B>QC Livello Utente -</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:<BR> -1 - Modify Nothing<BR> -2 - Modify Nothing Except Status<BR> -3 - Modify All Fields<BR> -4 - Verify First Round of QC<BR> -5 - View QC Statistics<BR> -6 - Ability to Modify FINISHed records<BR> -7 - Manager Level<BR> + <BR> + <A NAME="vicidial_users-qc_user_level"> + <BR> + <B>QC Utente Livello - </B> Questa impostazione consente di definire ciò che lagente di controllo della qualità è il livello utente. Ciò dettare il livello di funzionalità per lagente nel QC sezione:<BR> + 1 - Modificare Nulla<BR> + 2 - Modificare Nulla Salvo Stato<BR> + 3 - Modificare tutti i campi<BR> + 4 - Verificare prima tornata di CQ<BR> + 5 - Vedi QC Statistiche<BR> + 6 - Capacità di modificare i record finito<BR> + 7 - Livello Manager<BR> -<BR> -<A NAME="vicidial_users-qc_pass"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_users-qc_pass"> + <BR> + <B>QC record Pass - </B> Questa opzione permette di specificare lagente di un record che ha superato il primo turno delle QC dopo aver esaminato il record. -<BR> -<A NAME="vicidial_users-qc_finish"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_users-qc_finish"> + <BR> + <B>QC record Fine - </B> Questa opzione permette di specificare lagente che ha finito di registrare il secondo turno delle QC dopo aver esaminato il passato record. -<BR> -<A NAME="vicidial_users-qc_commit"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_users-qc_commit"> + <BR> + <B>QC record Impegni - </B> Questa opzione permette di specificare lagente che un record è stato commesso in QC. Essa non può più essere modificato da chiunque. + <? + } +?> <BR> <A NAME="vicidial_users-add_timeclock_log"> <BR> -<B>Add Timeclock Log Record -</B> This option allows the user to add records to the timeclock log. +<B>Aggiungi orologio Entra record - </B> Questa opzione permette allutente di aggiungere record alla orologio Accedi. <BR> <A NAME="vicidial_users-modify_timeclock_log"> <BR> -<B>Modify Timeclock Log Record -</B> This option allows the user to modify records in the timeclock log. +<B>Modificare orologio Entra record - </B> Questa opzione permette allutente di modificare i record nella orologio Accedi. <BR> <A NAME="vicidial_users-delete_timeclock_log"> <BR> -<B>Delete Timeclock Log Record -</B> This option allows the user to delete records in the timeclock log. +<B>Elimina orologio Entra record - </B> Questa opzione consente allutente di eliminare i record nel registro orologio. <BR> <A NAME="vicidial_users-vdc_agent_api_access"> <BR> -<B>Agent API Access -</B> This option allows the account to be used with the vicidial agent API commands. +<B>Agente Accesso API - </B> Questa opzione permette laccount da utilizzare con lAPI vicidial agente comandi. + +<BR> +<A NAME="vicidial_users-manager_shift_enforcement_override"> +<BR> +<B>Shift Manager esecuzione Sovrascrive -</B> Questa impostazione, se impostato a 1 consentirà un manager per inserire il proprio utente e la password su un agente schermo per scavalcare le restrizioni al passaggio di un agente di sessione, se lagente sta tentando di accedere al di fuori del loro passaggio. Il valore di default è 0. + +<BR> +<A NAME="vicidial_users-download_lists"> +<BR> +<B>Download Liste -</B> Questa impostazione, se impostato a 1 consentirà un manager per il download cliccare sul link elenco nella parte inferiore della schermata di modifica un elenco di esportare lintero contenuto di un elenco di file di dati di un appartamento. Il valore di default è 0. + +<BR> +<A NAME="vicidial_users-export_reports"> +<BR> +<B>Rapporti Export -</B> Questa impostazione, se impostato su 1 consente di accedere a un manager di esportazione chiamata relazioni sulle relazioni schermo. Il valore di default è 0. Per la relazione chiede di esportazione, per il seguente campo è utilizzato per le esportazioni: <BR>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 + @@ -2621,7 +2907,12 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-web_form_address"> <BR> -<B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el boton de la FORMA del WEB. +<B>Forma del Web -</B> aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el boton de la FORMA del WEB. Per personalizzare la stringa di ricerca dopo il modulo web, è sufficiente avviare il modulo web con VAR e quindi lURL che si desidera utilizzare, che sostituisce le variabili con i nomi di variabile che si desidera utilizzare - A - phone_number - B -- proprio come nella sezione SCRIPT scheda. + +<BR> +<A NAME="vicidial_campaigns-web_form_target"> +<BR> +<B>Web Form-Target </B> Qui è possibile impostare la pagina web personalizzata cornice del modulo web che sarà aperto a quando lutente fa clic sul pulsante Web Form. Il valore di default è _blank. <BR> <A NAME="vicidial_campaigns-allow_closers"> @@ -2638,101 +2929,261 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Grupos permitidos de la transferencia -</B> con estos listados delcheckbox usted puede seleccionar a los grupos a quienes los agentes enesta campaña pueden transferir llamadas. Permita Closers debe serpermitido para que esta opcio`n demuestre para arriba. -<BR> -<A NAME="vicidial_campaigns-campaign_allow_inbound"> -<BR> -<B>Permita de entrada y mezclado -</B> aquí es donde usted puede fijar silos usuarios de esta campaña tendrán la opcio`n para tomar llamadasde entrada con esta campaña. Si usted desea hacer de entrada y desalida mezclada entonces esto se debe fijar a Y. Si usted deseasolamente hacer marcar de salida en esta campaña fijo` esto a N.Default es N. +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR> + <A NAME="vicidial_campaigns-campaign_allow_inbound"> + <BR> + <B>Permita de entrada y mezclado -</B> aquí es donde usted puede fijar silos usuarios de esta campaña tendrán la opcio`n para tomar llamadasde entrada con esta campaña. Si usted desea hacer de entrada y desalida mezclada entonces esto se debe fijar a Y. Si usted deseasolamente hacer marcar de salida en esta campaña fijo` esto a N.Default es N. -<BR> -<A NAME="vicidial_campaigns-dial_status"> -<BR> -<B>Estado del dial -</B> aquí es adonde usted fija los estados que usted está deseando marcar encendido dentro de las listas que son activas para la campaña abajo. Para agregar otro estado al dial, seleccio`nelo de la lista drop-downy el tecleo AGREGA. Para quitar uno de los estados del dial, chasqueencendido el acoplamiento del QUITAR al lado del estado que usteddesea quitar. + <BR> + <A NAME="vicidial_campaigns-dial_status"> + <BR> + <B>Estado del dial -</B> aquí es adonde usted fija los estados que usted está deseando marcar encendido dentro de las listas que son activas para la campaña abajo. Para agregar otro estado al dial, seleccio`nelo de la lista drop-downy el tecleo AGREGA. Para quitar uno de los estados del dial, chasqueencendido el acoplamiento del QUITAR al lado del estado que usteddesea quitar. -<BR> -<A NAME="vicidial_campaigns-lead_order"> -<BR> -<B>Orden de la lista -</B> Este menú es donde usted selecciona co`mo los plomos que emparejan los estados seleccionados arriba serán puestos en la tolva del plomo: - <BR>   - DOWN: seleziona i primi contatti caricati nella tabella vicidial_list - <BR>   - UP: seleziona gli ultimi contatti caricati nella tabella vicidial_list - <BR>   - UP PHONE: seleziona il numero di telefono piu` grande e poi scorre verso il basso - <BR>   - DOWN PHONE: seleziona il numero di telefono piu` piccolo e poi scorre verso l`alto - <BR>   - UP LAST NAME: comienzo con los nombres pasados comenzando con Z y trabajos su manera abajo - <BR>   - DOWN LAST NAME: comienzo con los nombres pasados comenzando con A y trabajos su manera para arriba - <BR>   - UP COUNT: comienzo con los plomos y los trabajos llamados su manera abajo - <BR>   - DOWN COUNT: comienzo con menos plomos y trabajos llamados su manera para arriba - <BR>   - DOWN COUNT 2nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada otro lead(Must para no tener NEW seleccionado en los estados del dial) - <BR>   - DOWN COUNT 3nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada tercer lead(Must para no tener NEW seleccionado en los estados del dial) - <BR>   - DOWN COUNT 4th NEW: comienzo con menos plomos y trabajos llamados que su manera para arriba que inserta un NEW plomo en cada adelante conduzca (no debe tener NEW seleccionado en los estados del dial) + <BR> + <A NAME="vicidial_campaigns-lead_order"> + <BR> + <B>Orden de la lista -</B> Este menú es donde usted selecciona co`mo los plomos que emparejan los estados seleccionados arriba serán puestos en la tolva del plomo: + <BR>   - DOWN: seleziona i primi contatti caricati nella tabella vicidial_list + <BR>   - UP: seleziona gli ultimi contatti caricati nella tabella vicidial_list + <BR>   - UP PHONE: seleziona il numero di telefono piu` grande e poi scorre verso il basso + <BR>   - DOWN PHONE: seleziona il numero di telefono piu` piccolo e poi scorre verso l`alto + <BR>   - UP LAST NAME: comienzo con los nombres pasados comenzando con Z y trabajos su manera abajo + <BR>   - DOWN LAST NAME: comienzo con los nombres pasados comenzando con A y trabajos su manera para arriba + <BR>   - UP COUNT: comienzo con los plomos y los trabajos llamados su manera abajo + <BR>   - DOWN COUNT: comienzo con menos plomos y trabajos llamados su manera para arriba + <BR>   - DOWN COUNT 2nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada otro lead(Must para no tener NEW seleccionado en los estados del dial) + <BR>   - DOWN COUNT 3nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada tercer lead(Must para no tener NEW seleccionado en los estados del dial) + <BR>   - DOWN COUNT 4th NEW: comienzo con menos plomos y trabajos llamados que su manera para arriba que inserta un NEW plomo en cada adelante conduzca (no debe tener NEW seleccionado en los estados del dial) -<BR> -<A NAME="vicidial_campaigns-hopper_level"> -<BR> -<B>Tolva llana -</B> este es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a trave`s en un minuto. + <BR> + <A NAME="vicidial_campaigns-hopper_level"> + <BR> + <B>Tolva llana -</B> este es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a trave`s en un minuto. -<BR> -<A NAME="vicidial_campaigns-lead_filter_id"> -<BR> -<B>Filtro del plomo -</B> este es un me`todo de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaucio`n, e`l es fácil de parar el marcar accidentalmente con la alteracio`n más leve a la declaracio`n del SQL. El defecto no es NINGUNO. + <BR> + <A NAME="vicidial_campaigns-lead_filter_id"> + <BR> + <B>Filtro del plomo -</B> este es un me`todo de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaucio`n, e`l es fácil de parar el marcar accidentalmente con la alteracio`n más leve a la declaracio`n del SQL. El defecto no es NINGUNO. -<BR> -<A NAME="vicidial_campaigns-force_reset_hopper"> -<BR> -<B>Reajuste de la fuerza de la tolva -</B> esto permite que usted limpie fuera del contenido de la tolva sobre la sumisio`n de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. + <BR> + <A NAME="vicidial_campaigns-force_reset_hopper"> + <BR> + <B>Reajuste de la fuerza de la tolva -</B> esto permite que usted limpie fuera del contenido de la tolva sobre la sumisio`n de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. -<BR> -<A NAME="vicidial_campaigns-dial_method"> -<BR> -<B>Me`todo del dial -</B> Este campo es la manera de definir co`mo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el me`todo del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y despue`s no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos me`todos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los me`todos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profe`tico. 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. + <BR> + <A NAME="vicidial_campaigns-dial_method"> + <BR> + <B>Me`todo del dial -</B> Este campo es la manera de definir co`mo el marcar debe ocurrir. Si el MANUAL entonces el auto_dial_level es bloqueado en 0 a menos que se cambie el me`todo del dial. Si COCIENTE entonces el normal marcando un número de líneas para los agentes activos. ADAPT_HARD_LIMIT marcará predictively hasta el porcentaje caído y despue`s no permitirá marcar agresivo una vez que se alcance el límite de la gota hasta que va el porcentaje abajo otra vez. ADAPT_TAPERED permite para el excedente de funcionamiento el porcentaje caído por la mitad primer de la cambio - según lo definido por el call_time seleccionado para la campaña y consigue más terminante mientras que se enciende la cambio. ADAPT_AVERAGE intenta mantener un promedio o el porcentaje caído que no impone límites duros tan agresivamente como los otros dos me`todos. Usted no puede cambiar el nivel auto del dial si usted está en cualesquiera de los me`todos del dial del ADAPTAR. Solamente el sintonizador puede cambiar el nivel del dial cuando en modo que marca profe`tico. INBOUND_MAN consente di collocare lagente manuale comporre le chiamate provenienti da una campagna elenco pur essendo in grado di prendere le chiamate in entrata tra manuale quadrante chiamate. -<BR> -<A NAME="vicidial_campaigns-auto_dial_level"> -<BR> -<B>Nivel auto del dial -</B> aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automo`vil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIo`N del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el me`todo del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. + <BR> + <A NAME="vicidial_campaigns-auto_dial_level"> + <BR> + <B>Nivel auto del dial -</B> aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automo`vil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. El checkbox de la INVALIDACIo`N del ADAPTAR permite que usted fuerceun nuevo nivel del dial aunque el me`todo del dial está en un mododel ADAPTAR. Esto es útil si hay una cambio dramática en la calidadde plomos y usted desea cambiar drástico el dial_level manualmente. -<BR> -<A NAME="vicidial_campaigns-available_only_ratio_tally"> -<BR> -<B>Solamente cuenta disponible -</B> este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. + <BR> + <A NAME="vicidial_campaigns-available_only_ratio_tally"> + <BR> + <B>Solamente cuenta disponible -</B> este campo si el sistema a Y deja haciafuera los agentes del estado de INCALL y de la COLETA al calcular elnúmero de llamadas al dial cuando no en modo de dial MANUAL. Eldefecto es N. -<BR> -<A NAME="vicidial_campaigns-adaptive_dropped_percentage"> -<BR> -<B>Límite del porcentaje de la gota -</B> este campo es donde usted fijo` ellímite del porcentaje de llamadas caídas que usted quisiera mientrasque usaba un me`todo adaptante-profe`tico del dial, NO MANUAL o delCOCIENTE. + <BR> + <A NAME="vicidial_campaigns-adaptive_dropped_percentage"> + <BR> + <B>Límite del porcentaje de la gota -</B> este campo es donde usted fijo` ellímite del porcentaje de llamadas caídas que usted quisiera mientrasque usaba un me`todo adaptante-profe`tico del dial, NO MANUAL o delCOCIENTE. -<BR> -<A NAME="vicidial_campaigns-adaptive_maximum_level"> -<BR> -<B>El máximo adapta el dial llano -</B> este campo es donde usted fijo` ellímite del límite al numbr de líneas que usted quisiera marcado poragente mientras que usaba un me`todo adaptante-profe`tico del dial, NOMANUAL o del COCIENTE. Este número puede ser más alto que el nivelauto del dial si su hardware lo apoya. El valor debe ser un númeropositivo mayor de uno y puede tener defecto 3.0 de los lugaresdecimales. + <BR> + <A NAME="vicidial_campaigns-adaptive_maximum_level"> + <BR> + <B>El máximo adapta el dial llano -</B> este campo es donde usted fijo` ellímite del límite al numbr de líneas que usted quisiera marcado poragente mientras que usaba un me`todo adaptante-profe`tico del dial, NOMANUAL o del COCIENTE. Este número puede ser más alto que el nivelauto del dial si su hardware lo apoya. El valor debe ser un númeropositivo mayor de uno y puede tener defecto 3.0 de los lugaresdecimales. -<BR> -<A NAME="vicidial_campaigns-adaptive_latest_server_time"> -<BR> -<B>El tiempo más último del servidor -</B> este campo es utilizadosolamente por el me`todo del dial de ADAPT_TAPERED. Usted debe entraren la hora y el minuto que usted parará el invitar de esta campaña,2100 significaría que usted parará el marcar de esta campaña en eltiempo del servidor de los 9PM. Esto permite que el algoritmo afiladodecida a co`mo agresivamente al dial cerca cuánto tiempo usted tienehasta que usted será el llamar acabado. + <BR> + <A NAME="vicidial_campaigns-adaptive_latest_server_time"> + <BR> + <B>El tiempo más último del servidor -</B> este campo es utilizadosolamente por el me`todo del dial de ADAPT_TAPERED. Usted debe entraren la hora y el minuto que usted parará el invitar de esta campaña,2100 significaría que usted parará el marcar de esta campaña en eltiempo del servidor de los 9PM. Esto permite que el algoritmo afiladodecida a co`mo agresivamente al dial cerca cuánto tiempo usted tienehasta que usted será el llamar acabado. -<BR> -<A NAME="vicidial_campaigns-adaptive_intensity"> -<BR> -<B>Adapte el modificante de la intensidad -</B> este campo se utiliza paraajustar la intensidad profe`tica más alta o más baja. El más altoun número positivo que usted selecciona, mayor va el sintonizadoraumentará la llamada que establece el paso cuando para arriba y máslentamente va el sintonizador disminuirá la llamada que establece elpaso cuando abajo. Cuanto más bajo es el número negativo que ustedseleccionan aquí, más lentamente el sintonizador aumentará lallamada que establece el paso y más rápidamente el sintonizadorbajará la llamada que establece el paso cuando va abajo. El defectoes 0. Este campo no es utilizado por los me`todos del dial del MANUALo del COCIENTE. + <BR> + <A NAME="vicidial_campaigns-adaptive_intensity"> + <BR> + <B>Adapte el modificante de la intensidad -</B> este campo se utiliza paraajustar la intensidad profe`tica más alta o más baja. El más altoun número positivo que usted selecciona, mayor va el sintonizadoraumentará la llamada que establece el paso cuando para arriba y máslentamente va el sintonizador disminuirá la llamada que establece elpaso cuando abajo. Cuanto más bajo es el número negativo que ustedseleccionan aquí, más lentamente el sintonizador aumentará lallamada que establece el paso y más rápidamente el sintonizadorbajará la llamada que establece el paso cuando va abajo. El defectoes 0. Este campo no es utilizado por los me`todos del dial del MANUALo del COCIENTE. -<BR> -<A NAME="vicidial_campaigns-adaptive_dl_diff_target"> -<BR> -<B>Blanco llana de la diferencia del dial -</B> este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los me`todos del dial del MANUAL o del COCIENTE. + <BR> + <A NAME="vicidial_campaigns-adaptive_dl_diff_target"> + <BR> + <B>Blanco llana de la diferencia del dial -</B> este campo se utiliza paradefinir si usted desea apuntar tener un número específico de losagentes que esperan agentes de las llamadas o el esperar de llamadas.Por ejemplo si usted siempre quisiera tener en agente del promedio unolibre tomar llamadas inmediatamente usted fijaría esto a -1, si ustedquisiera apuntar siempre tener uno invita el asimiento que espera unagente que usted fijaría esto a 1. El defecto es 0. Este campo no esutilizado por los me`todos del dial del MANUAL o del COCIENTE. -<BR> -<A NAME="vicidial_campaigns-concurrent_transfers"> -<BR> -<B>Transferencias concurrentes -</B> este ajuste se utiliza para definir elnúmero de las llamadas que se pueden enviar a los agentes en el mismotiempo. Se recomienda que este ajuste está dejado en el AUTOMo`VIL. Este campo no es utilizado por el me`todo MANUAL del dial. + <BR> + <A NAME="vicidial_campaigns-concurrent_transfers"> + <BR> + <B>Transferencias concurrentes -</B> este ajuste se utiliza para definir elnúmero de las llamadas que se pueden enviar a los agentes en el mismotiempo. Se recomienda que este ajuste está dejado en el AUTOMo`VIL. Este campo no es utilizado por el me`todo MANUAL del dial. -<BR> -<A NAME="vicidial_campaigns-queue_priority"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_campaigns-queue_priority"> + <BR> + <B>Coda di priorità - </B> Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended. -<BR> -<A NAME="vicidial_campaigns-auto_alt_dial"> -<BR> -<B>Alt-Nu`mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA me`todos del dial cuando no hay contacto en elnúmero de telefono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el me`todoMANUAL del dial. 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. + <BR> + <A NAME="vicidial_campaigns-auto_alt_dial"> + <BR> + <B>Alt-Nu`mero auto que marca -</B> este ajuste se utiliza para marcarautomáticamente campos alternos del número mientras que marca en elCOCIENTE y ADAPTA me`todos del dial cuando no hay contacto en elnúmero de telefono principal para un plomo, los estados del NA, deB, de la C.C. y de N. Este ajuste no es utilizado por el me`todoMANUAL del dial. PROROGATO alternano i numeri sono numeri caricato nel sistema al di fuori della norma portare informazioni schermo. Uso PROROGATO si possono avere centinaia di numeri di telefono per un singolo cliente record. + + <BR> + <A NAME="vicidial_campaigns-dial_timeout"> + <BR> + <B>Descanso del dial -</B> si está definido, llamadas que normalmente retraso despue`s de que el descanso definido en extensions.conf en lugar de otro descanso en esta cantidad de segundos si es menos que el descanso de extensions.conf. Esto permite descansos del dial rápidamente que cambian del servidor al servidor y a limitar los efectos a una sola campaña. Si usted está teniendo muchos de llamadas del contestador automático o de Casella Vocale usted puede desear intentar cambiar este valor entre a 21-26 y ver si los resultados mejoran. + + <BR> + <A NAME="vicidial_campaigns-campaign_vdad_exten"> + <BR> + <B>Campagna VDAD estensione -</B> Questo campo consente un trasferimento personalizzato VDAD estensione. Questo vi permette di utilizzare diversi metodi di gestione delle chiamate a seconda della tua campagna. +- 8364 - 8368 stessa +- 8365 - Will inviare la chiamata ad un solo agente sullo stesso server come la chiamata è in +- 8366 - Usato-1 per la stampa e campagne di indagine +- 8367 - Il primo a provare a inviare la chiamata a un agente sul server locale, poi si guarda su altri server + - 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on +- 8369 - Utilizzato per Segreteria di rilevamento, dopo che, lo stesso comportamento come 8368 +- 8373 - Utilizzato per Segreteria di rilevamento dopo lo stesso comportamento come 8366 + + <BR> + <A NAME="vicidial_campaigns-am_message_exten"> + <BR> + <B>Mensaje del contestador automático -</B> este campo está para entrar en una extension para cegar llamadas de la transferencia a cuando el agente consigue un contestador automático y chasca encendido el boton del mensaje del contestador automático en el marco de la conferencia de la transferencia. Usted debe fijar esto exten para arriba en el dial plan - extensions.conf - y se cerciora de que juega un archivo audio despue`s que cuelga para arriba. + + <BR> + <A NAME="vicidial_campaigns-amd_send_to_vmx"> + <BR> + <B>AMD envían a la VM exten -</B> este menú permite que usted defina si un mensaje este` dejado en un contestador automático cuando se detecta la llamada será remitido inmediatamente a la extension del Contestar-Ma`quina-Mensaje si AMD es activo y se determina que la llamada es un contestador automático. + + <BR> + <A NAME="vicidial_campaigns-cpd_amd_action"> + <BR> + <B>CPD AMD Azione - </B> Se si utilizza il Sangoma ParaXip chiamate di avanzamento di rilevamento di software allora si desidera attivare questa impostazione o limpostazione di DISPO disposizione che la chiamata come AA e appende se la chiamata è in fase di elaborazione e non è stato inviato a un agente o un messaggio che ancora invierà la richiesta alla Segreteria definito Messaggio per questa campagna. Il valore di default è ANDICAPPATI. + + <BR> + <A NAME="vicidial_campaigns-alt_number_dialing"> + <BR> + <B>El marcar nume`rico del Alt del agente -</B> esta opcio`n permite que un agente marque manualmente el número de telefono o el campo alterno address3 despue`s de que se haya llamado el número principal. + + <BR> + <A NAME="vicidial_campaigns-drop_call_seconds"> + <BR> + <B>Segundos de la llamada de la gota -</B> el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, so`lo se aplica a las llamadas desalida. + + <BR> + <A NAME="vicidial_campaigns-drop_action"> + <BR> + <B>Goccia dazione - </B> Questo menu consente di scegliere che cosa succede a una chiamata quando si è in attesa di più di quello che si trova nel campo Secondi Call Drop. Hangup semplicemente riagganciare la chiamata, inviare il messaggio di chiamare il Gota Extensions che lei ha definito di seguito, segreteria invierà la chiamata alla casella vocale che è stato definito sotto IN_GROUP e invia la chiamata in ingresso al gruppo che è definito qui di seguito + + <BR> + <A NAME="vicidial_campaigns-safe_harbor_exten"> + <BR> + <B>seguro puerto Exten -</B> este ser dial plan extension que desear seguropuerto audio archivo ser localizar en en su servidor. + + <BR> + <A NAME="vicidial_campaigns-voicemail_ext"> + <BR> + <B>Casella Vocale -</B> si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. + + <BR> + <A NAME="vicidial_campaigns-drop_inbound_group"> + <BR> + <B>Trasferimento Drop Group - </B> In caso di caduta di azione è fissato a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si raggiunge il Call Drop Secondi. + + <BR> + <A NAME="vicidial_campaigns-no_hopper_leads_logins"> + <BR> + <B>Permita Ninguno-Tolva-Conduce conexiones -</B> si el sistema a Y, permiteagentes a la conexion a la campaña incluso si no hay plomos cargadosen la tolva para esa campaña. Esta funcio`n no se necesita encampañas de CLOSER-type. El defecto es N. + + <BR> + <A NAME="vicidial_campaigns-list_order_mix"> + <BR> + <B>Mezcla de la orden de la lista -</B> elimina los campos de la orden delplomo y del estado del dial. Utilizará los parámetros de la lista ydel estado para la entrada seleccionada de la mezcla de la lista en laseccio`n del submarino de la mezcla de la lista en lugar de otro. Eldefecto es LISIADO. + + <BR> + <A NAME="vicidial_campaigns-vcl_id"> + <BR> + <B>Identificacio`n de la mezcla de la lista -</B> identificacio`n de lamezcla de la lista. Debe ser a partir de 2-20 caracteres en longitudsin los espacios o la otra puntuacio`n especial. + + <BR> + <A NAME="vicidial_campaigns-vcl_name"> + <BR> + <B>Nombre de la mezcla de la lista -</B> nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. + + <BR> + <A NAME="vicidial_campaigns-list_mix_container"> + <BR> + <B>Detalle de la mezcla de la lista -</B> la composicio`n de la entrada de lamezcla de la lista. Contiene la identificacio`n de la lista, la ordende la mezcla, los porcentajes y los estados que hacen para arriba estamezcla de la lista. Los porcentajes tienen que agregar siempre hasta100, y las listas todas tienen que ser activas y fijadas a la campañapara que la entrada de la mezcla de la orden sea activada. + + <BR> + <A NAME="vicidial_campaigns-mix_method"> + <BR> + <B>Me`todo de la mezcla de la lista -</B> el me`todo de mezclar a todas laspartes del detalle de la mezcla de la lista juntas. EVEN_MIX mezclarálos plomos de cada parte interpolada con las otras partes, como estos1.2.3.1.2.3.1.2.3. IN_ORDER pondrá los plomos en la orden en la cualse enumeran en la pantalla 1.1.1.2.2.2.3.3.3 del detalle de la mezclade la lista. La voluntad AL AZAR los puso en la orden AL AZAR1.3.2.1.1.3.2.1.3. El defecto es IN_ORDER. + + <BR> + <A NAME="vicidial_campaigns-agent_extended_alt_dial"> + <BR> + <B>Agente Screen estensione Alt Dial - </B> Questa funzione consente di agenti per laccesso esteso alternano i numeri di telefono per porta oltre la normale Alt Telefono e Address3 settori che possono essere utilizzati in VICIDIAL per i numeri di telefono al di là del numero di telefono principale. Lestensione numeri di telefono può essere selezionato automaticamente utilizzando la funzione Auto-Alt-Dial VICIDIAL in funzione delle impostazioni della campagna, ma che consentono questa funzione di agente dello schermo consentirà anche per lagente di chiamare questi numeri dal loro agente schermo così come modificare le loro informazioni. + + <BR> + <A NAME="vicidial_campaigns-survey_first_audio_file"> + <BR> + <B>Indagine primo file audio - </B> Questo è il nome del file audio che viene riprodotto non appena il cliente sceglie il telefono cellulare durante lesecuzione di un sondaggio campagna. + + <BR> + <A NAME="vicidial_campaigns-survey_dtmf_digits"> + <BR> + <B>Indagine sulle cifre DTMF - </B> Questo campo è il punto in cui definire le cifre che un cliente può premere come opzione su una campagna di indagine. cifre DTMF sono validi0123456789*# + + <BR> + <A NAME="vicidial_campaigns-survey_ni_digit"> + <BR> + <B>Indagine non interessa Digit - </B> Questo campo è dove si definisce il cliente premuto cifre che dimostrano che non sono interessati. + + <BR> + <A NAME="vicidial_campaigns-survey_ni_status"> + <BR> + <B>Indagine non interessa Stato - </B> Questo campo è se si seleziona lo stato che saranno utilizzati per non essere interessato. DNC Se viene utilizzato e la campagna è impostata per usare DNC poi il numero di telefono sarà automaticamente aggiunto alla lista VICIDIAL interno DNC.e, eventualmente, la campagna specifici DNC elenco. + + <BR> + <A NAME="vicidial_campaigns-survey_opt_in_audio_file"> + <BR> + <B>Indagine Opt-in Audio File - </B> Questo è il nome del file audio che viene riprodotto quando il cliente ha optato-in per lindagine, non hanno scelto lopt-out non ha risposto o se la non-azione-reazione è impostato su OptOut. Dopo questo file audio viene riprodotto, il metodo di indagine di azione. + + <BR> + <A NAME="vicidial_campaigns-survey_ni_audio_file"> + <BR> + <B>Indagine non interessa File audio - </B> Questo è il nome del file audio che viene riprodotto quando il cliente ha scelto lopt-out di indagine, non hanno scelto lopt-in o non ha risposto se il non-azione-reazione è impostato su OptIn. Dopo questo file audio viene riprodotto, linvito sarà appeso. + + <BR> + <A NAME="vicidial_campaigns-survey_method"> + <BR> + <B>Indagine Metodo - </B> Questa opzione definisce che cosa succede a una chiamata dopo che il cliente ha scelto lopt-in. AGENT_XFER invierà linvito al prossimo disponibili agente. Segreteria invierà la chiamata alla casella vocale che è specificato nel campo Casella Vocale. ESTENSIONE invierà al cliente di definire lestensione della Indagine Xfer Estensione campo. Hangup si bloccherà il cliente. CAMPREC_60_WAV invierà al cliente di avere una registrazione fatta con la loro risposta, questa registrazione sarà collocato in una cartella denominata come la campagna allinterno della campagna di registrazione Indagine Directory. + + <BR> + <A NAME="vicidial_campaigns-survey_no_response_action"> + <BR> + <B>Indagine n. risposta Azione - </B> Questo è dove si definisce che cosa accadrà se non vi è alcuna risposta alla domanda del sondaggio. OptIn solo inviare la chiamata al metodo di indagine, se il cliente preme un cifre DTMF. OptOut invierà al cliente al metodo di indagine, anche se non si preme uno cifre DTMF. + + <BR> + <A NAME="vicidial_campaigns-survey_response_digit_map"> + <BR> + <B>Indagine risposta Digit Mappa - </B> Questa è la sezione in cui è possibile definire una descrizione per andare a ciascuna opzione cifre DTMF che il cliente può scegliere. + + <BR> + <A NAME="vicidial_campaigns-survey_xfer_exten"> + <BR> + <B>Indagine Xfer Estensione - </B> Se il metodo di indagine è stato selezionato ESTENSIONE quindi chiamare il cliente sarebbe stata destinata a questo dialplan estensione. + + <BR> + <A NAME="vicidial_campaigns-survey_camp_record_dir"> + <BR> + <B>Indagine campagna di registrazione Repertorio - </B> Se il metodo di indagine è stato selezionato CAMPREC_60_WAV allora la risposta dei clienti vengono registrati e messi in una directory di nome, dopo la campagna allinterno di questa directory. + + <? + } +?> <BR> <A NAME="vicidial_campaigns-next_agent_call"> @@ -2750,11 +3201,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Tiempo de la llamada local -</B> aquí es adonde usted fijo` durante que` horas usted quisiera marcar, según lo determinado por el tiempo local en está en cuál usted está llamando. Esto es controlada por co`digo de área y ajustada por tiempo de los ahorros de la luz del día si es aplicable. Las pautas generales en los E.E.U.U. para el negocio al negocio son los 9am a los 5pm y el negocio a las llamadas del consumidor es los 9am a los 9pm. -<BR> -<A NAME="vicidial_campaigns-dial_timeout"> -<BR> -<B>Descanso del dial -</B> si está definido, llamadas que normalmente retraso despue`s de que el descanso definido en extensions.conf en lugar de otro descanso en esta cantidad de segundos si es menos que el descanso de extensions.conf. Esto permite descansos del dial rápidamente que cambian del servidor al servidor y a limitar los efectos a una sola campaña. Si usted está teniendo muchos de llamadas del contestador automático o de Casella Vocale usted puede desear intentar cambiar este valor entre a 21-26 y ver si los resultados mejoran. - <BR> <A NAME="vicidial_campaigns-dial_prefix"> <BR> @@ -2770,11 +3216,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Campaña CallerID -</B> este campo permite enviar de un número de encargo del callerid en las llamadas de salida. Úste es el número que demostraría para arriba en el callerid de la persona que usted está llamando. El defecto es DESCONOCIDO. Esta opcio`n está solamente disponible si usted está utilizando PRIs - ISDN T1 o E1 - que tienen la característica de encargo del callerid se giraron. Esta característica puede Tambien trabajar con los troncos IAX2 dependiendo de lo que admite su abastecedor. El callerID de encargo se aplica solamente a las llamadas puestas para la campaña de VICIDIAL directamente, cualquier tercer persona llama o las transferencias no enviarán el callerID de encargo. NOTA: A veces el poner DESCONOCIDO o PRIVADO en el campo rendirá enviar de su número del callerID del defecto por su portador con las llamadas. Usted puede desear probar esto y poner 0000000000 en el campo del callerid en lugar de otro si usted no desea enviarle CallerID. -<BR> -<A NAME="vicidial_campaigns-campaign_vdad_exten"> -<BR> -<B>Extension de la campaña VDAD -</B> este campo permite una extension de la transferencia del costumbre VDAD. Esto permite que usted utilice diversas escrituras del agi de VDADtransfer... dependiendo de su campaña. La transferencia AGI(exten 8365 agi-VDADtransfer.agi del defecto) apenas envía inmediatamente invita a los agentes tan pronto como e`l se tome. Una encuesta sobre política AGI la muestra adicional es Tambien (8366 agi-VDADtransferSURVEY.agi ) ese ahora incluido los juegos un mensaje a la persona llamada y permite que e`l haga una opcio`n presionando buttons(effectively la pre-investigacio`n el plomo). Observe por favor eso a excepcio`n de los exámenes, llamadas políticas y las caridades esta forma de llamar son ilegales en los Estados Unidos. - <BR> <A NAME="vicidial_campaigns-campaign_rec_exten"> <BR> @@ -2805,56 +3246,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Consiga el lanzamiento de la llamada -</B> este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. -<BR> -<A NAME="vicidial_campaigns-am_message_exten"> -<BR> -<B>Mensaje del contestador automático -</B> este campo está para entrar en una extension para cegar llamadas de la transferencia a cuando el agente consigue un contestador automático y chasca encendido el boton del mensaje del contestador automático en el marco de la conferencia de la transferencia. Usted debe fijar esto exten para arriba en el dial plan - extensions.conf - y se cerciora de que juega un archivo audio despue`s que cuelga para arriba. - -<BR> -<A NAME="vicidial_campaigns-amd_send_to_vmx"> -<BR> -<B>AMD envían a la VM exten -</B> este menú permite que usted defina si un mensaje este` dejado en un contestador automático cuando se detecta la llamada será remitido inmediatamente a la extension del Contestar-Ma`quina-Mensaje si AMD es activo y se determina que la llamada es un contestador automático. - <BR> <A NAME="vicidial_campaigns-xferconf_a_dtmf"> <BR> <B>Xfer-Conf DTMF -</B> Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo`vil-poblara` el nu`mero-a-dial y los campos del enviar-dtmf cuando está presionada. Si usted desea permitir transferencias consultivas, un fronter a unmás cercano, usted puede colocar CXFER pues uno de lasprecolocaciones del nu`mero-a-dial y del dial string apropiado seráenviado para hacer una transferencia consultiva local, entonces lalata LEAVE-3WAY-CALL justo del agente y movimiento encendido a sullamada siguiente. Si usted desea permitir transferencias ocultas declientes a una escritura de VICIDIAL AGI para registrar o un IVR,entonces coloque AXFER en el campo del nu`mero-a-dial. Usted puedeTambien especificar una extension de encargo despue`s del AXFER odel CXFER, por ejemplo si usted desea hacer transferencias consultivasinternas en vez de local que usted pondría CXFER90009 en el campo delnu`mero-a-dial. -<BR> -<A NAME="vicidial_campaigns-alt_number_dialing"> -<BR> -<B>El marcar nume`rico del Alt del agente -</B> esta opcio`n permite que un agente marque manualmente el número de telefono o el campo alterno address3 despue`s de que se haya llamado el número principal. - <BR> <A NAME="vicidial_campaigns-scheduled_callbacks"> <BR> <B>Servicios repetidos programar -</B> esta opcio`n no prohibe a agente a la disposicion una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. -<BR> -<A NAME="vicidial_campaigns-drop_call_seconds"> -<BR> -<B>Segundos de la llamada de la gota -</B> el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, so`lo se aplica a las llamadas desalida. - -<BR> -<A NAME="vicidial_campaigns-drop_action"> -<BR> -<B>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 Secondi Abbattimento Telefonata field. HANGUP will simply hang up the call, MESSAGE will send the call the Gota 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|| - -<BR> -<A NAME="vicidial_campaigns-safe_harbor_exten"> -<BR> -<B>seguro puerto Exten -</B> este ser dial plan extension que desear seguropuerto audio archivo ser localizar en en su servidor. - -<BR> -<A NAME="vicidial_campaigns-voicemail_ext"> -<BR> -<B>Casella Vocale -</B> si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. - -<BR> -<A NAME="vicidial_campaigns-drop_inbound_group"> -<BR> -<B>Drop Transfer Group -</B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Secondi Abbattimento Telefonata. - <BR> <A NAME="vicidial_campaigns-wrapup_seconds"> <BR> @@ -2873,7 +3274,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-use_campaign_dnc"> <BR> -<B>Use Campagna 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. +<B>Usa campagna DNC List - </B> Questo definisce se questa è una campagna per filtrare DNC conduce contro una lista che è specifico per tale campagna solo. Se è impostato su Y, la tramoggia sarà per ciascuno il numero di telefono nel campo specifico DNC prima immissione nella tramoggia. Se si è in campagna specifici DNC elenco allora cambierà status che portano a DNCC e non può quindi essere selezionato. Il valore predefinito è N. <BR> <A NAME="vicidial_campaigns-closer_campaigns"> @@ -2883,7 +3284,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-agent_pause_codes_active"> <BR> -<B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun co`digo de la pausa cuando chascan encendido el boton de PAUSA envicidial.php. Los co`digos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinio`n de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button. +<B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun co`digo de la pausa cuando chascan encendido el boton de PAUSA envicidial.php. Los co`digos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinio`n de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. VIGORE costringerà gli agenti di scegliere un codice PAUSE se fai clic sul pulsante PAUSE. <BR> <A NAME="vicidial_campaigns-disable_alter_custdata"> @@ -2893,42 +3294,12 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-disable_alter_custphone"> <BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-no_hopper_leads_logins"> -<BR> -<B>Permita Ninguno-Tolva-Conduce conexiones -</B> si el sistema a Y, permiteagentes a la conexion a la campaña incluso si no hay plomos cargadosen la tolva para esa campaña. Esta funcio`n no se necesita encampañas de CLOSER-type. El defecto es N. +<B>Disattiva Alter clienti Telefono - </B> Se è impostata a Y, non cambia il numero di telefono del cliente, quando un agente disposizioni la chiamata. Il valore di default è Y. <BR> <A NAME="vicidial_campaigns-display_queue_count"> <BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-list_order_mix"> -<BR> -<B>Mezcla de la orden de la lista -</B> elimina los campos de la orden delplomo y del estado del dial. Utilizará los parámetros de la lista ydel estado para la entrada seleccionada de la mezcla de la lista en laseccio`n del submarino de la mezcla de la lista en lugar de otro. Eldefecto es LISIADO. - -<BR> -<A NAME="vicidial_campaigns-vcl_id"> -<BR> -<B>Identificacio`n de la mezcla de la lista -</B> identificacio`n de lamezcla de la lista. Debe ser a partir de 2-20 caracteres en longitudsin los espacios o la otra puntuacio`n especial. - -<BR> -<A NAME="vicidial_campaigns-vcl_name"> -<BR> -<B>Nombre de la mezcla de la lista -</B> nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. - -<BR> -<A NAME="vicidial_campaigns-list_mix_container"> -<BR> -<B>Detalle de la mezcla de la lista -</B> la composicio`n de la entrada de lamezcla de la lista. Contiene la identificacio`n de la lista, la ordende la mezcla, los porcentajes y los estados que hacen para arriba estamezcla de la lista. Los porcentajes tienen que agregar siempre hasta100, y las listas todas tienen que ser activas y fijadas a la campañapara que la entrada de la mezcla de la orden sea activada. - -<BR> -<A NAME="vicidial_campaigns-mix_method"> -<BR> -<B>Me`todo de la mezcla de la lista -</B> el me`todo de mezclar a todas laspartes del detalle de la mezcla de la lista juntas. EVEN_MIX mezclarálos plomos de cada parte interpolada con las otras partes, como estos1.2.3.1.2.3.1.2.3. IN_ORDER pondrá los plomos en la orden en la cualse enumeran en la pantalla 1.1.1.2.2.2.3.3.3 del detalle de la mezclade la lista. La voluntad AL AZAR los puso en la orden AL AZAR1.3.2.1.1.3.2.1.3. El defecto es IN_ORDER. +<B>Agente Mostra Coda Conte - </B> Se è impostata a Y, ogni volta che un cliente è in attesa di un agente, la coda invita visualizzazione nella parte superiore dello schermo agente diventa rosso e mostra il numero di chiamate in attesa. Il valore di default è Y. <BR> <A NAME="vicidial_campaigns-manual_dial_list_id"> @@ -2938,119 +3309,94 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_campaigns-manual_dial_filter"> <BR> -<B>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, CAMPAIGNLISTE - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. +<B>Manuale Dial Filtro - </B> Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTE - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi. <BR> <A NAME="vicidial_campaigns-agent_clipboard_copy"> <BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-agent_extended_alt_dial"> -<BR> -<B>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 Campagna 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. +<B>Appunti di agente Schermata Copia - </B> Questa funzione è al momento attivo solo per Internet Explorer. Questa funzione consente di selezionare un campo che verrà copiato negli appunti il computer dellagente computer su una chiamata in corso linvio di un agente. Comune utilizza per questo sono per facilitare lincollatura di numeri di conto corrente o numeri di telefono in eredità applicazioni client sul computer agente. <BR> <A NAME="vicidial_campaigns-three_way_call_cid"> <BR> -<B>3-Way Call CallerID De salida -</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. +<B>3-Way chiamate in uscita CallerID - </B> Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in. AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte. <BR> <A NAME="vicidial_campaigns-three_way_dial_prefix"> <BR> -<B>3-Way Call Prefisso Chiamata -</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. +<B>3-Way Call Prefisso Chiamata - </B> Questo definisce quello che è usato come prefisso per chiamare il 3-way chiamate, di default è vuoto in modo che il prefisso campagna quadrante è usato, passthru in modo che tu possa sentire suonare è 88. + +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_campaigns-qc_enabled"> + <BR> + <B>QC Attivato - </B> Limpostazione di questo campo a Y consente, per lagente di Controllo della Qualità funzioni. Il valore di default è N. + + <BR> + <A NAME="vicidial_campaigns-qc_statuses"> + <BR> + <B>Status QC - </B> La zona dove si è stati di selezionare quale porta deve essere andato oltre, QC, dal sistema. Mettere un segno di spunta accanto allo status che si desidera, QC, di rivedere. + + <BR> + <A NAME="vicidial_campaigns-qc_shift_id"> + <BR> + <B>QC Maiusc - </B> Questo è il passaggio di tempo utilizzato per estrarre QC record per una campagna. I giorni della settimana sono ignorati per queste funzioni. + + <BR> + <A NAME="vicidial_campaigns-qc_get_record_launch"> + <BR> + <B>QC ottenere il record di lancio-</B> Ciò consente una delle seguenti azioni per essere attivato su un QC agente riceve un nuovo record. + + <BR> + <A NAME="vicidial_campaigns-qc_show_recording"> + <BR> + <B>QC Visualizza Registrazione - </B> Ciò consente una registrazione che può essere collegato con la QC record di essere esposto nel QC agente schermo. + + <BR> + <A NAME="vicidial_campaigns-qc_web_form_address"> + <BR> + <B>QC Indirizzo Web Form - </B> Questo è lindirizzo web che un agente, QC può andare quando si fa clic sul link contenuto nel Web Form, QC schermo. + + <BR> + <A NAME="vicidial_campaigns-qc_script"> + <BR> + <B>QC Script - </B> Questo è lo script che possono essere utilizzati da agenti QC nel SCRIPT scheda nella schermata QC. + <? + } +?> <BR> -<A NAME="vicidial_campaigns-qc_enabled"> +<A NAME="vicidial_campaigns-vtiger_search_category"> <BR> -<B>QC Enabled -</B> Setting this field to Y allows for the agent Quality Control features to work. Default is N. +<B>Vtiger Ricerca Categoria - </B> Se Vtiger integrazione è attivata in poi le impostazioni del sistema questa impostazione definirà in cui la pagina di ricerca vtiger_search.php per il numero di telefono che è stato inserito. Ci sono 4 opzioni che possono essere utilizzati in questo campo: PIOMBO-Questa opzione ricerca attraverso la porta solo Vtiger, CONTO-Questa opzione ricerca attraverso il Vtiger conti e tutti i contatti e sub-contatti per il numero di telefono, VENDITORE-Questa opzione solo attraverso la ricerca Vtiger venditori, ACCTID-Questa opzione funziona solo per i conti e si prendono le vicidial vendor_lead_code campo e provare a cercare il Vtiger ID account. Se si tenta senza successo di qualsiasi altro metodi elencati che hai selezionato. Opzioni multiple possono essere utilizzati per ogni ricerca, ma su grandi banche dati questo non è raccomandato. Il valore di default è PIOMBO. <BR> -<A NAME="vicidial_campaigns-qc_statuses"> +<A NAME="vicidial_campaigns-vtiger_create_call_record"> <BR> -<B>QC Esiti -</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. +<B>Vtiger Crea chiamate record - </B> Se Vtiger integrazione è attivata in poi le impostazioni del sistema questa impostazione definisce se una nuova attività Vtiger è stato creato per registrare la chiamata quando lagente va al vtiger_search pagina. Il valore di default è Y. <BR> -<A NAME="vicidial_campaigns-qc_shift_id"> +<A NAME="vicidial_campaigns-vtiger_create_lead_record"> <BR> -<B>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. +<B>Vtiger Crea record Piombo - </B> Se è attivata Vtiger integrazione nel sistema e le impostazioni Vtiger Ricerca Categoria PIOMBO comprende quindi questa impostazione definisce se un nuovo record Vtiger piombo viene creato quando lagente va a vtiger_search la pagina di registrazione e non è di avere trovato la chiamata numero di telefono. Il valore di default è Y. <BR> -<A NAME="vicidial_campaigns-qc_get_record_launch"> +<A NAME="vicidial_campaigns-vtiger_screen_login"> <BR> -<B>QC Get Record Launch-</B> This allows one of the following actions to be triggered upon a QC agent receiving a new record. +<B>Vtiger Screen Login - </B> Se Vtiger di integrazione è attivata in poi le impostazioni del sistema questa impostazione definisce se lutente è connesso al Vtiger interfaccia automaticamente quando laccesso al VICIDIAL. Il valore di default è Y. <BR> -<A NAME="vicidial_campaigns-qc_show_recording"> +<A NAME="vicidial_campaigns-agent_allow_group_alias"> <BR> -<B>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. +<B>Gruppo Alias ammessi - </B> Se si desidera consentire agli agenti di utilizzare il vostro gruppo alias quindi è necessario impostare questo gruppo Y. Alias sono spiegate più in Admin sezione, che consentono di selezionare diversi agenti callerIDs manuale per le chiamate in uscita che essi possono posto. Il valore di default è N. <BR> -<A NAME="vicidial_campaigns-qc_web_form_address"> +<A NAME="vicidial_campaigns-default_group_alias"> <BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-qc_script"> -<BR> -<B>QC Script -</B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen. - -<BR> -<A NAME="vicidial_campaigns-survey_first_audio_file"> -<BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-survey_dtmf_digits"> -<BR> -<B>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 0123456789*# - -<BR> -<A NAME="vicidial_campaigns-survey_ni_digit"> -<BR> -<B>Survey Not Interested Digit -</B> This field is where you define the customer digit pressed that will show they are Not Interested. - -<BR> -<A NAME="vicidial_campaigns-survey_ni_status"> -<BR> -<B>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 and possibly the campaign-specific DNC list. - -<BR> -<A NAME="vicidial_campaigns-survey_opt_in_audio_file"> -<BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-survey_ni_audio_file"> -<BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-survey_method"> -<BR> -<B>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 Casella Vocale 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 Registrazioni Per Questa Campagna Directory. - -<BR> -<A NAME="vicidial_campaigns-survey_no_response_action"> -<BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-survey_response_digit_map"> -<BR> -<B>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. - -<BR> -<A NAME="vicidial_campaigns-survey_xfer_exten"> -<BR> -<B>Survey Xfer Extension -</B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension. - -<BR> -<A NAME="vicidial_campaigns-survey_camp_record_dir"> -<BR> -<B>Survey Registrazioni Per Questa Campagna 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. - - +<B>Predefinito Gruppo Alias - </B> Se si hanno consentito Gruppo Alias allora questo è il gruppo alias che viene selezionato per impostazione predefinita quando prima lagente sceglie di utilizzare un gruppo di Alias per un manuale di chiamata in uscita. Il valore predefinito è vuoto o NESSUNO. @@ -3101,7 +3447,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_list-dnc"> <BR> -<B>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 LISTE - AGREGUE EL NÚMERO A 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. There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them. +<B>DNC VICIDIAL List - </B> Questo Dont Call elenco contiene ogni piombo che è stato fissato ad uno stato di DNC nel sistema. Attraverso il ELENCHI - ADD numero DNC pagina si ha la possibilità di aggiungere manualmente i numeri di questo elenco in modo che essi non saranno chiamati da campagne che utilizzano la lista interno DNC. Vi è inoltre la possibilità di aggiungere porta alla campagna specifici DNC liste per le campagne che hanno loro. @@ -3173,17 +3519,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-drop_call_seconds"> <BR> -<B>Secondi Abbattimento Telefonata -</B> The number of seconds a call will stay in queue before being considered a DROP. +<B>Call Drop Secondi - </B> Il numero di secondi di una chiamata rimane in coda, prima di essere considerato un DROP. <BR> <A NAME="vicidial_inbound_groups-drop_action"> <BR> -<B>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 Secondi Abbattimento Telefonata field. HANGUP will simply hang up the call, MESSAGE will send the call the Gota 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. +<B>Goccia dazione - </B> Questo menu consente di scegliere che cosa succede a una chiamata quando si è in attesa di più di quello che si trova nel campo Secondi Call Drop. Hangup semplicemente riagganciare la chiamata, inviare il messaggio di chiamare il Gota Extensions che lei ha definito di seguito, segreteria invierà la chiamata alla casella vocale che è stato definito sotto IN_GROUP e invia la chiamata in ingresso al gruppo che è definito qui di seguito. <BR> <A NAME="vicidial_inbound_groups-drop_exten"> <BR> -<B>Gota 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 Secondi Abbattimento Telefonata. +<B>Gota Extensions - </B> In caso di caduta di azione è fissato al messaggio, questa è la linea che il piano di estensione invito sarà inviato a se raggiunge Call Drop Secondi. <BR> <A NAME="vicidial_inbound_groups-voicemail_ext"> @@ -3193,7 +3539,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-drop_inbound_group"> <BR> -<B>Drop Transfer Group -</B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Secondi Abbattimento Telefonata. +<B>Trasferimento Drop Group - </B> In caso di caduta di azione è fissato a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si raggiunge il Call Drop Secondi. <BR> <A NAME="vicidial_inbound_groups-call_time_id"> @@ -3203,7 +3549,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-after_hours_action"> <BR> -<B>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 Casella Vocale field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE. +<B>After Hours Azione - </B> Loperazione da eseguire se si tratta di ore dopo, come definito nel tempo per la chiamata in entrata questo gruppo. Hangup hangup immediatamente la chiamata, si MESSASGE riprodurre il file in After Hours Messaggio Filenam campo, ESTENSIONE invierà la chiamata al After Hours Estensione nel dialplan Casella Vocale e invia la chiamata alla casella vocale di cui il settore After Hours Casella Vocale , IN_GROUP invierà la chiamata in ingresso al gruppo selezionato nel gruppo After Hours Trasferimento selezionare lista. Il valore di default è MESSAGGIO. <BR> <A NAME="vicidial_inbound_groups-after_hours_message_filename"> @@ -3223,7 +3569,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-afterhours_xfer_group"> <BR> -<B>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. +<B>After Hours Trasferimento Group - </B> Se After Hours azione è destinata a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si entra nel gruppo in al di fuori del regime di chiamata tempo definito per il gruppo in. <BR> <A NAME="vicidial_inbound_groups-welcome_message_filename"> @@ -3233,7 +3579,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-play_welcome_message"> <BR> -<B>Play Benvenuti 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. +<B>Lettura del messaggio di benvenuto - </B> Queste impostazioni selezionate, quando per la riproduzione del messaggio di benvenuto definito, SEMPRE svolgerà ogni volta, non potrà mai mai giocare, IF_WAIT_ONLY solo riprodurre il messaggio di benvenuto, se la chiamata non vada immediatamente ad un agente , e YES_UNLESS_NODELAY avranno sempre il messaggio di benvenuto NO_DELAY a meno che limpostazione è attivata. Il valore di default è SEMPRE. <BR> <A NAME="vicidial_inbound_groups-moh_context"> @@ -3248,52 +3594,52 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-prompt_interval"> <BR> -<B>En el intervalo del aviso del asimiento -</B> la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. To disable the On Hold Prompt, set the interval to 0. +<B>En el intervalo del aviso del asimiento -</B> la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. Per disattivare il prompt Hold On, impostare lintervallo a 0. <BR> <A NAME="vicidial_inbound_groups-play_place_in_line"> <BR> -<B>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. +<B>Gioca Luogo in Linea - </B> Questo definisce se il chiamante ascolterà il loro posto in linea momento in cui entra nella coda così come quando sentono il announcemend. Il valore di default è N. <BR> <A NAME="vicidial_inbound_groups-play_estimate_hold_time"> <BR> -<B>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. +<B>Gioca stimato Hold Time - </B> Questo definisce se il chiamante ascolterà il tempo stimato tenere prima di essere trasferiti a un agente. Il valore di default è N. <BR> <A NAME="vicidial_inbound_groups-hold_time_option"> <BR> -<B>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. +<B>Tenere Opzione Tempo - </B> Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_seconds"> <BR> -<B>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. +<B>Tenere Opzione Tempo Secondi - </B> Se Hold Time opzione è impostata a nulla, ma NESSUNO, questo è il numero di secondi di attesa tempo stimato che il tempo di attivare lopzione. Il valore predefinito è 360 secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_exten"> <BR> -<B>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. +<B>Tenere Opzione Tempo Estensione - </B> Se lopzione Hold Time è impostato per estensione, questo è il dialplan proroga che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_voicemail"> <BR> -<B>Hold Time Option Casella Vocale -</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. +<B>Tenere Tempo Opzione Segreteria - </B> Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_xfer_group"> <BR> -<B>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. +<B>Tenere Opzione Tempo trasferimento in gruppo - </B> Se Hold Time opzione è impostata a IN_GROUP, questo è il gruppo in entrata che linvito sarà inviato a se la stima del tempo di attesa supera il tempo di Opzione Secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_filename"> <BR> -<B>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. +<B>Tenere Opzione Tempo richiamata Filename - </B> Se lopzione Hold Time è impostato su CALLERID_CALLBACK, questo è il nome del file che viene riprodotto prompt prima che la chiamata viene registrata come un nuovo condurre alla lista ID specificato di seguito, se la stima del tempo di attesa supera i Tenere Opzione Tempo Secondi. <BR> <A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id"> <BR> -<B>Hold Time Option Callback ID Lista -</B> If Hold Time Option is set to CALLERID_CALLBACK, this is the ID Lista the call is added to as a new lead if the estimated hold time exceeds the Hold Time Option Seconds. +<B>Tenere Opzione Tempo richiamata Elenco ID - </B> Se lopzione Hold Time è impostato su CALLERID_CALLBACK, questo è lelenco ID la chiamata viene aggiunto come un nuovo piombo se la stima del tempo di attesa supera il tempo di Opzione Secondi. <BR> <A NAME="vicidial_inbound_groups-agent_alert_exten"> @@ -3313,62 +3659,75 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_groups-ingroup_recording_override"> <BR> -<B>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. +<B>Nel gruppo di registrazione Sovrascrive - </B> Questo campo consente di rilevante della campagna chiamata di registrazione. Questa impostazione può essere ignorata dal vicidial_user scavalcare limpostazione di registrazione. ANDICAPPATI non ignorare la campagna di registrazione. Non potrà mai disabilitare la registrazione sul client. OnDemand è il default e permette lagente di avviare e interrompere la registrazione, se necessario. ALLCALLS si avvia la registrazione sul client quando viene inviata una chiamata a un agente. ALLFORCE si avvia la registrazione sul client quando viene inviata una chiamata a un agente che lagente non opzione per interrompere la registrazione. <BR> <A NAME="vicidial_inbound_groups-ingroup_rec_filename"> <BR> -<B>In-Group Recording Filename -</B> This field will override the Registrazioni Per Questa Campagna 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. +<B>Nel gruppo di registrazione Filename - </B> Questo campo sovrascrive la campagna di registrazione Filenaming sistema a meno che non sia impostato su NESSUNO. Le variabili sono ammessi CAMPAGNA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che assomigliare a questa TESTCAMP_51020103108_3125551212. Max 50 caratteri. Il valore di default è NESSUNO. -<BR> -<A NAME="vicidial_inbound_groups-qc_enabled"> -<BR> -<B>QC Enabled -</B> Setting this field to Y allows for the agent Quality Control features to work. Default is N. +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_inbound_groups-qc_enabled"> + <BR> + <B>QC Attivato - </B> Limpostazione di questo campo a Y consente, per lagente di Controllo della Qualità funzioni. Il valore di default è N. -<BR> -<A NAME="vicidial_inbound_groups-qc_statuses"> -<BR> -<B>QC Esiti -</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. + <BR> + <A NAME="vicidial_inbound_groups-qc_statuses"> + <BR> + <B>Status QC - </B> La zona dove si è stati di selezionare quale porta deve essere andato oltre, QC, dal sistema. Mettere un segno di spunta accanto allo status che si desidera, QC, di rivedere. -<BR> -<A NAME="vicidial_inbound_groups-qc_shift_id"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_inbound_groups-qc_shift_id"> + <BR> + <B>QC Maiusc - </B> Questo è il passaggio di tempo utilizzato per estrarre QC record per un inbound_group. I giorni della settimana sono ignorati per queste funzioni. -<BR> -<A NAME="vicidial_inbound_groups-qc_get_record_launch"> -<BR> -<B>QC Get Record Launch-</B> This allows one of the following actions to be triggered upon a QC agent receiving a new record. + <BR> + <A NAME="vicidial_inbound_groups-qc_get_record_launch"> + <BR> + <B>QC ottenere il record di lancio-</B> Ciò consente una delle seguenti azioni per essere attivato su un QC agente riceve un nuovo record. -<BR> -<A NAME="vicidial_inbound_groups-qc_show_recording"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_inbound_groups-qc_show_recording"> + <BR> + <B>QC Visualizza Registrazione - </B> Ciò consente una registrazione che può essere collegato con la QC record di essere esposto nel QC agente schermo. -<BR> -<A NAME="vicidial_inbound_groups-qc_web_form_address"> -<BR> -<B>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. + <BR> + <A NAME="vicidial_inbound_groups-qc_web_form_address"> + <BR> + <B>QC Indirizzo Web Form - </B> Questo è lindirizzo web che un agente, QC può andare quando si fa clic sul link contenuto nel Web Form, QC schermo. -<BR> -<A NAME="vicidial_inbound_groups-qc_script"> -<BR> -<B>QC Script -</B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen. + <BR> + <A NAME="vicidial_inbound_groups-qc_script"> + <BR> + <B>QC Script - </B> Questo è lo script che possono essere utilizzati da agenti QC nel SCRIPT scheda nella schermata QC. + <? + } +?> <BR> <A NAME="vicidial_inbound_groups-hold_recall_xfer_group"> <BR> -<B>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. +<B>Tenere Ricorda Trasferimento In-Group - </B> Se un cliente chiede di tornare in questo gruppo di più di una volta e questo non è impostato su Nessuno, quindi la chiamata verrà automaticamente inviata al gruppo selezionato In-in questo campo . Il valore di default è NESSUNO. <BR> <A NAME="vicidial_inbound_groups-no_delay_call_route"> <BR> -<B>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. +<B>Scadenza Bando n. rotta - </B> Impostando questo parametro a Y rimuoverà tutti i tempi di attesa e audio richiede e si tenta di inviare il diritto di chiamata di un agente. Non ignorare il messaggio di benvenuto o tenere prompt impostazioni. Il valore di default è N. <BR> <A NAME="vicidial_inbound_groups-answer_sec_pct_rt_stat_one"> <BR> -<B>Stats Percent of Calls Answered Within X seconds -</B> 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. +<B>Statistiche per cento delle chiamate risposta entro X secondi - </B> Questo campo consente di impostare il numero di tenere secondo le statistiche in tempo reale che il display utilizza per calcolare la percentuale di risposta che sono state chiamate risposta entro X numero di secondi in attesa. + +<BR> +<A NAME="vicidial_inbound_groups-default_group_alias"> +<BR> +<B>Predefinito Gruppo Alias - </B> Se si hanno consentito Alias gruppo per la campagna che lagente è registrato in poi questo è il gruppo alias che è stato selezionato prima di default su un invito da parte di questo gruppo in entrata, quando lagente sceglie di utilizzare un gruppo di Alias per un manuale di chiamata in uscita. Il valore predefinito è vuoto o NESSUNO. + @@ -3379,92 +3738,92 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_inbound_dids-did_pattern"> <BR> -<B>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. +<B>Estensione DID - </B> Questo è il numero, lestensione o la DID che attiveranno questa voce e che si percorso allinterno del sistema di utilizzare questa funzione. Vi è una riservati DID predefinito che è possibile utilizzare, che è solo la parola-default-senza trattini, che Allos di inviare qualsiasi richiesta che non corrisponde a tutte le altre esistenti modelli di default DID. <BR> <A NAME="vicidial_inbound_dids-did_description"> <BR> -<B>DID Description -</B> This is the description of the DID routing entry. +<B>Descrizione DID - </B> Questa è la descrizione di DID routing. <BR> <A NAME="vicidial_inbound_dids-did_active"> <BR> -<B>DID Active -</B> This the field where you set the DID entry to active or not. Default is Y. +<B>HA attiva - </B> Questo è il campo in cui si è impostato il DID ingresso attivo o meno. Il valore di default è Y. <BR> <A NAME="vicidial_inbound_dids-did_route"> <BR> -<B>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. +<B>HA rotta - </B> Questo tipo di percorso che si è impostato il DID da usare. Estensione invierà le chiamate verso lestensione al di sotto, segreteria invierà chiede direttamente alla casella vocale al di sotto, AGENTE invierà le chiamate a un agente VICIDIAL se sono connesso, TELEFONO invierà la chiamata a un telefono voce selezionata di seguito, si IN_GROUP inviare chiamate direttamente al gruppo specificato in entrata. Il valore di default è Extensions. <BR> <A NAME="vicidial_inbound_dids-extension"> <BR> -<B>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. +<B>Estensione - </B> Se è selezionata come estensione DID rotta, allora questa è lestensione che dialplan inviti saranno inviati. Il valore di default è 9998811112, nessun servizio. <BR> <A NAME="vicidial_inbound_dids-exten_context"> <BR> -<B>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. +<B>Estensione Contesto - </B> Se è selezionata come estensione DID rotta, allora questo è il contesto che dialplan inviti saranno inviati. Il valore di default è di default. <BR> <A NAME="vicidial_inbound_dids-voicemail_ext"> <BR> -<B>Buzon de voz -</B> If VOICEMAIL is selected as the DID Route, then this is the voicemail box that calls will be sent to. Default is empty. +<B>Buzon de voz - </B> Se è selezionata come Casella Vocale DID rotta, allora questa è la casella vocale che inviti saranno inviati. Il valore di default è vuota. <BR> <A NAME="vicidial_inbound_dids-phone"> <BR> -<B>Phone Extension -</B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to. +<B>Telefono Estensione - </B> Se è selezionata come TELEFONO DID percorso, allora questo è il telefono cellulare in estensione che inviti saranno inviati. <BR> <A NAME="vicidial_inbound_dids-server_ip"> <BR> -<B>Phone IP Server -</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. +<B>Telefono IP Server - </B> Se è selezionata come TELEFONO DID percorso, allora questo è lIP del server per il telefono che chiede lestensione sarà trasmessa al. <BR> <A NAME="vicidial_inbound_dids-user"> <BR> -<B>User Agent -</B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to. +<B>Utente Agent - </B> Se è selezionata come AGENTE DID rotta, allora questo è lagente che chiede VICIDIAL saranno inviati alla. <BR> <A NAME="vicidial_inbound_dids-user_unavailable_action"> <BR> -<B>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. +<B>Lutente non disponibile Azione - </B> Se è selezionata come AGENTE DID rotta, e lutente non è connesso o disponibili, allora questo è il percorso che le chiamate si. <BR> <A NAME="vicidial_inbound_dids-user_route_settings_ingroup"> <BR> -<B>User Route Settings In-Group -</B> 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. +<B>Utente percorso Impostazioni In-Group - </B> Se è selezionata come AGENTE DID rotta, allora questo è il gruppo In-che saranno utilizzati per la coda di impostazioni come il chiamante è in attesa di essere inviati al agente. Il valore di default è AGENTDIRECT. <BR> <A NAME="vicidial_inbound_dids-group_id"> <BR> -<B>In-ID Gruppo -</B> If IN_GROUP is selected as the DID Route, then this is the In-Group that calls will be sent to. +<B>In-ID gruppo - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è il gruppo In-chiede che saranno inviati alla. <BR> <A NAME="vicidial_inbound_dids-call_handle_method"> <BR> -<B>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. +<B>Nel gruppo di chiamata Metodo Maniglia - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è il metodo di gestione delle chiamate per queste chiamate. CID di aggiungere un nuovo record con piombo ogni chiamata utilizzando il CallerID come il numero di telefono, CIDLOOKUP tenterà di ricerca il numero di telefono dal CallerID in tutto il sistema, CIDLOOKUPRL sarà attampt di ricerca il numero di telefono dal CallerID specificato in una sola lista , CIDLOOKUPRC si attampt di ricerca il numero di telefono dal CallerID in tutte le liste che appartengono alla campagna specificato, più vicina è specificato per VICIDIAL Closer chiamate, ANI si aggiunge un nuovo record con piombo ogni chiamata utilizzando il ANI, come il numero di telefono, ANILOOKUP tenterà di ricerca il numero di telefono dal ANI in tutto il sistema, ANILOOKUPRL si attampt di ricerca il numero di telefono dal ANI specificato in una sola lista, XDIGITID verrà chiesto il chiamante per una X cifre del codice prima che la chiamata verrà messa in la coda. Il valore di default è CID. <BR> <A NAME="vicidial_inbound_dids-agent_search_method"> <BR> -<B>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. +<B>Nel gruppo di agente Metodo di ricerca - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è il metodo di ricerca agente debba essere utilizzato da un gruppo in entrata, LO è Load-Balanced-Overflow e cercherà di inviare la chiamata di un agente sul server locale prima di tentare di inviarlo a un agente su un altro server, LB è bilanciamento del carico e si tenta di inviare la chiamata al prossimo agente non importa ciò che essi sono il server, server-SO è solo e solo tenta di inviare gli inviti agli agenti presenti sul server che linvito è venuto in su. Il valore di default è LB. <BR> <A NAME="vicidial_inbound_dids-list_id"> <BR> -<B>In-Group ID Lista -</B> If IN_GROUP is selected as the DID Route, then this is the ID Lista that leads may be searched through and that leads will be inserted into if necessary. +<B>Nel gruppo Lista ID - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è lelenco ID che porta può essere cercato attraverso la porta e che sarà inserito in se necessario. <BR> <A NAME="vicidial_inbound_dids-campaign_id"> <BR> -<B>In-ID Gruppo Campagna -</B> If IN_GROUP is selected as the DID Route, then this is the ID Campagna that leads may be searched for in if the call handle method is CIDLOOKUPRC. +<B>Nel gruppo-ID campagna - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è lID campagna che porta può essere cercato per se il metodo di gestire la chiamata è CIDLOOKUPRC. <BR> <A NAME="vicidial_inbound_dids-phone_code"> <BR> -<B>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. +<B>Nel gruppo Codice Telefono - </B> Se è selezionata come IN_GROUP DID rotta, allora questo è il codice utilizzato Telefono se un nuovo piombo è creato. @@ -3524,36 +3883,42 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN -<BR><BR><BR><BR> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYS TABELLA</FONT></B><BR><BR> -<A NAME="vicidial_campaign_hotkeys"> -<BR> -<B>Con el uso de los hot keys de encargo de la campaña, los agentes que utilizan el retraso vicidial de la lata del tela-cliente y la disposicion llama apenas presionando una sola llave en su teclado.</B> Hay dos opciones especiales que usted puede utilizar conjuntamente conel número de telefono alterno que marca, ALTPH2 de HotKey - el dialcaliente del telefono alterno y el dial caliente ADDR3-----Address3permiten que un agente utilice un hotkey al retraso su llamada,permanecen en el mismo plomo, y marcan otro número del contacto deese conducen. + <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYS TABELLA</FONT></B><BR><BR> + <A NAME="vicidial_campaign_hotkeys"> + <BR> + <B>Con el uso de los hot keys de encargo de la campaña, los agentes que utilizan el retraso vicidial de la lata del tela-cliente y la disposicion llama apenas presionando una sola llave en su teclado.</B> Hay dos opciones especiales que usted puede utilizar conjuntamente conel número de telefono alterno que marca, ALTPH2 de HotKey - el dialcaliente del telefono alterno y el dial caliente ADDR3-----Address3permiten que un agente utilice un hotkey al retraso su llamada,permanecen en el mismo plomo, y marcan otro número del contacto deese conducen. -<BR><BR><BR><BR> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLE TABELLA</FONT></B><BR><BR> -<A NAME="vicidial_lead_recycle"> -<BR> -<B>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.</B> + <B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLE TABELLA</FONT></B><BR><BR> + <A NAME="vicidial_lead_recycle"> + <BR> + <B>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.</B> -<BR><BR><BR><BR> - -<B><FONT SIZE=3>ESTADOS AUTO DEL DIAL DE VICIDIAL ALT</FONT></B><BR><BR> -<A NAME="vicidial_auto_alt_dial_statuses"> -<BR> -<B>Si se fija el campo que marca del Alt-Nu`mero auto, despue`s losplomos que son dispositioned bajo estos estados del dial del alt delautomo`vil tendrán su alt_phone y-o los campos address3 marcadosdespue`s de que cualesquiera de estos ninguno-contesten a estados sefijan.</B> + <BR><BR><BR><BR> + <B><FONT SIZE=3>ESTADOS AUTO DEL DIAL DE VICIDIAL ALT</FONT></B><BR><BR> + <A NAME="vicidial_auto_alt_dial_statuses"> + <BR> + <B>Si se fija el campo que marca del Alt-Nu`mero auto, despue`s losplomos que son dispositioned bajo estos estados del dial del alt delautomo`vil tendrán su alt_phone y-o los campos address3 marcadosdespue`s de que cualesquiera de estos ninguno-contesten a estados sefijan.</B> + <? + } +?> @@ -3583,28 +3948,39 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <A NAME="vicidial_user_groups-forced_timeclock_login"> <BR> -<B>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. +<B>Forza orologio Login - </B> Questa opzione permette di non lasciare che un agente ad accedere al VICIDIAL agente interfaccia se non hanno effettuato laccesso al orologio. Il valore predefinito è N. Vi è la possibilità di esentare admin utenti, i livelli 8 e 9. + +<BR> +<A NAME="vicidial_user_groups-shift_enforcement"> +<BR> +<B>Maiusc esecuzione -</B> Questa impostazione consente di limitare agente login basata su turni che sono selezionati in appresso. OFF non applicare a tutti i turni. INIZIO solo applicare il login, ma non riguarda un agente che è in esecuzione sul loro passaggio, se essi sono già eseguito laccesso TUTTE imporrà a turni orario di inizio e di un agente di log dopo che corrono oltre la fine del loro turno tempo. Il valore di default è OFF. <BR> <A NAME="vicidial_user_groups-group_shifts"> <BR> -<B>Group Shifts -</B> This is a selectable list of shifts that can restrict the agents login time on the system. +<B>Gruppo Turni - </B> Si tratta di un elenco dei turni selezionabili che possono limitare il tempo di accesso agenti sul sistema. <BR> <A NAME="vicidial_user_groups-allowed_campaigns"> <BR> <B>Campañas permitidas -</B> esta es una lista seleccionable de lascampañas a las cuales los miembros de este grupo de usuario puedenabrirse una sesio`n. La opcio`n de ALL-CAMPAIGNS permite que losusuarios en este grupo consideren y se abran una sesio`n a cualquiercampaña en el sistema. -<BR> -<A NAME="vicidial_user_groups-qc_allowed_campaigns"> -<BR> -<B>QC Campagne Permesse -</B> This is a selectable list of Campagne 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. - -<BR> -<A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> -<BR> -<B>QC Grupos De entrada Permitidos -</B> This is a selectable list of Gruppi Inbound 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. +<? +if ($SSqc_features_active > 0) + { + ?> + <BR> + <A NAME="vicidial_user_groups-qc_allowed_campaigns"> + <BR> + <B>QC ammessi Campagne - </B> Si tratta di un elenco di campagne selezionabili che membri di questo gruppo di utenti sarà in grado di QC. The All-CAMPAGNE opzione consente agli utenti di questo gruppo di QC una campagna sul sistema. + <BR> + <A NAME="vicidial_user_groups-qc_allowed_inbound_groups"> + <BR> + <B>QC ammessi Inbound Gruppi - </B> Si tratta di un elenco di ingresso selezionabile gruppi che membri di questo gruppo di utenti sarà in grado di QC. TUTTI I GRUPPI opzione consente agli utenti di questo gruppo di utenti di qualsiasi entrata CQ gruppo sul sistema. + <? + } +?> @@ -3642,25 +4018,31 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN -<BR><BR><BR><BR> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> -<B><FONT SIZE=3>VICIDIAL_LEAD_FILTRI TABELLA</FONT></B><BR><BR> -<A NAME="vicidial_lead_filters-lead_filter_id"> -<BR> -<B>Identificacio`n del filtro -</B> este es el nombre corto de un filtro del plomo de Vicidial. este necesita ser un identificador único. No utilice ningunos espacios o puntuacio`n para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. + <B><FONT SIZE=3>VICIDIAL_LEAD_FILTRI TABELLA</FONT></B><BR><BR> + <A NAME="vicidial_lead_filters-lead_filter_id"> + <BR> + <B>Identificacio`n del filtro -</B> este es el nombre corto de un filtro del plomo de Vicidial. este necesita ser un identificador único. No utilice ningunos espacios o puntuacio`n para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. -<BR> -<A NAME="vicidial_lead_filters-lead_filter_name"> -<B>Nombre del filtro -</B> este es un nombre más descriptivo del filtro. este es un resumen corto de los caracteres del máximo 30 del filtro, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_name"> + <B>Nombre del filtro -</B> este es un nombre más descriptivo del filtro. este es un resumen corto de los caracteres del máximo 30 del filtro, mínimo de 2 caracteres. -<BR> -<A NAME="vicidial_lead_filters-lead_filter_comments"> -<B>El filtro comenta -</B> aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. - -<BR> -<A NAME="vicidial_lead_filters-lead_filter_sql"> -<B>Filtro SQL -</B> Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_comments"> + <B>El filtro comenta -</B> aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. + <BR> + <A NAME="vicidial_lead_filters-lead_filter_sql"> + <B>Filtro SQL -</B> Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. + <? + } +?> @@ -3704,66 +4086,72 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_SHIFTS TABELLA</FONT></B><BR><BR> <A NAME="vicidial_shifts-shift_id"> <BR> -<B>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. +<B>Maiusc ID - </B> Questo è il nome breve di un Vicidial Maiusc Definizione. Questo deve essere un identificatore unico. Non utilizzare spazi o segni di punteggiatura in questo campo. max 20 caratteri, minimo di 2 caratteri. <BR> <A NAME="vicidial_shifts-shift_name"> -<B>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. +<B>Nome Shift - </B> Questo è un nome più descrittivo della Maiuscole Definizione. Questa è una breve sintesi della Maiuscole definizione. max 50 caratteri, minimo di 2 caratteri. <BR> <A NAME="vicidial_shifts-shift_start_time"> -<B>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. +<B>Start Time Shift - </B> Questo è il tempo che la campagna ha inizio turno. Deve essere solo numeri, 9:30 AM sarebbe 5:00 PM 0930 e 1700 sarebbe. <BR> <A NAME="vicidial_shifts-shift_length"> -<B>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. +<B>Maiusc Lunghezza - </B> Questo è il tempo in ore e minuti che la campagna a turni dura. 8 ore sarebbe 08:00 e 7 ore e 30 minuti sarebbero 07:30. <BR> <A NAME="vicidial_shifts-shift_weekdays"> -<B>Shift Weekdays -</B> In this section you should choose the days of the week that this shift is active. +<B>Maiusc Weekdays - </B> In questa sezione si deve scegliere il giorno della settimana che questo spostamento è attivo. + + + +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + + <BR><BR><BR><BR> + + <B><FONT SIZE=3>FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL</FONT></B><BR><BR> + <A NAME="vicidial_list_loader"> + <BR> + El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para tomar un archivo del plomo - hasta 8MB de tamaño quees la lengüeta o la pipa delimitada y para cargarlo en la tabla delvicidial_list. El cargador del plomo permite el campo que elige y deTXT- el texto claramente, los valores separados coma de CSV- y XLS-sobresalen formatos del archivo. El cargador del plomo no hace lavalidacio`n de datos, sino que permite que usted compruebe para sabersi hay duplicados en sí mismo, dentro de la campaña o dentro delsistema entero. Tambien, cercio`rese de que usted haya creado lalista que estos plomos son estar debajo de modo que usted puedautilizarlos. Aquí está una lista de los campos en su orden apropiadapara los archivos del plomo: + <OL> + <LI>Co`digo del plomo del vendedor - demuestra para arriba en el campo de la identificacio`n del vendedor del GUI + <LI>Co`digo de fuente - uso interno solamente para los admins y DBAs + <LI>Identificacio`n de la lista - el número de la lista que estos plomos demostrarán para arriba debajo + <LI>Co`digo del telefono - el prefijo para el telefono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) + <LI>Número de telefono - debe ser por lo menos 8 dígitos de largo + <LI>Título - título del customer(Mr. Ms señ., etc...) + <LI>Nome + <LI>Secondo Nome + <LI>Cognome + <LI>Indirizzo, linea 1 + <LI>Indirizzo, linea 2 + <LI>Indirizzo, linea 3 + <LI>Citta` + <LI>Stato - limitato a 2 caratteri + <LI>Provincia + <LI>CAP + <LI>Stato + <LI>Sesso + <LI>Data di Nascita + <LI>Numero di Telefono Alternativo + <LI>Email + <LI>Frase De Seguridad + <LI>Note + </OL> + + <BR>NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. Tambien, los mo`dulos de un Perl de los pares sedeben cargar para ella para trabajar Tambien -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en estos mirando suarchivo del error_log de apache. Tambien, para los cheques deduplicacio`n contra gampaign enumera, la lista que tiene nuevos plomosel entrar e`l necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. -<BR><BR><BR><BR> - -<B><FONT SIZE=3>FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL</FONT></B><BR><BR> -<A NAME="vicidial_list_loader"> -<BR> -El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para tomar un archivo del plomo - hasta 8MB de tamaño quees la lengüeta o la pipa delimitada y para cargarlo en la tabla delvicidial_list. El cargador del plomo permite el campo que elige y deTXT- el texto claramente, los valores separados coma de CSV- y XLS-sobresalen formatos del archivo. El cargador del plomo no hace lavalidacio`n de datos, sino que permite que usted compruebe para sabersi hay duplicados en sí mismo, dentro de la campaña o dentro delsistema entero. Tambien, cercio`rese de que usted haya creado lalista que estos plomos son estar debajo de modo que usted puedautilizarlos. Aquí está una lista de los campos en su orden apropiadapara los archivos del plomo: - <OL> - <LI>Co`digo del plomo del vendedor - demuestra para arriba en el campo de la identificacio`n del vendedor del GUI - <LI>Co`digo de fuente - uso interno solamente para los admins y DBAs - <LI>Identificacio`n de la lista - el número de la lista que estos plomos demostrarán para arriba debajo - <LI>Co`digo del telefono - el prefijo para el telefono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) - <LI>Número de telefono - debe ser por lo menos 8 dígitos de largo - <LI>Título - título del customer(Mr. Ms señ., etc...) - <LI>Nome - <LI>Secondo Nome - <LI>Cognome - <LI>Indirizzo, linea 1 - <LI>Indirizzo, linea 2 - <LI>Indirizzo, linea 3 - <LI>Citta` - <LI>Stato - limitato a 2 caratteri - <LI>Provincia - <LI>CAP - <LI>Stato - <LI>Sesso - <LI>Data di Nascita - <LI>Numero di Telefono Alternativo - <LI>Email - <LI>Frase De Seguridad - <LI>Note - </OL> - -<BR>NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. Tambien, los mo`dulos de un Perl de los pares sedeben cargar para ella para trabajar Tambien -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en estos mirando suarchivo del error_log de apache. Tambien, para los cheques deduplicacio`n contra gampaign enumera, la lista que tiene nuevos plomosel entrar e`l necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. - - - - -<BR><BR><BR><BR> - + <BR><BR><BR><BR> + <? + } +?> @@ -4107,22 +4495,53 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <BR> <A NAME="phones-alias_id"> <BR> -<B>Alias ID -</B> The ID of the alias used to allow for phone load balanced logins. senza spazi or other special characters allowed. Must be between 2 and 20 characters in length. +<B>ID Alias - </B> LID del alias utilizzati per consentire di telefono carico equilibrato login. senza spazi o altri caratteri speciali ammessi. Deve essere compreso tra 2 e 20 caratteri di lunghezza. <BR> <A NAME="phones-alias_name"> <BR> -<B>Alias Name -</B> The name used to describe a phones alias, Must be between 2 and 50 characters in length. +<B>Alias Nome - </B> Il nome utilizzato per descrivere un alias cellulari, deve essere compresa tra 2 e 50 caratteri di lunghezza. <BR> <A NAME="phones-logins_list"> <BR> -<B>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. +<B>Cellulari Login Lista - </B> Lelenco separato da virgole di telefono cellulare utilizzato dati di accesso quando un agente accede tramite telefono cellulare carico equilibrato login. Lagente si trova lapplicazione server attivo con il minor numero di agenti e registrati in una chiamata da tale server di agenti su login. <BR> <A NAME="phones-email"> <BR> -<B>Phones Email -</B> The email address associated with this phone entry. This is used for voicemail settings. +<B>Cellulari e-mail - </B> Lindirizzo email associato a questo telefono cellulare entrata. Questo è utilizzato per le impostazioni della segreteria. + +<BR> +<A NAME="phones-template_id"> +<BR> +<B>Template ID - </B> Questo è il file di conf che questo modello di telefono cellulare ID entrata utilizzerà per i suoi Asterisk impostazioni. Il valore di default è - INSUSSISTENZA --. + +<BR> +<A NAME="phones-conf_override"> +<BR> +<B>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. + +<BR> +<A NAME="phones-group_alias_id"> +<BR> +<B>Alias ID gruppo - </B> LID del gruppo alias utilizzati da agenti di effettuare chiamate in uscita le chiamate dalla VICIDIAL agente di interfaccia con le diverse Caller ID. senza spazi o altri caratteri speciali ammessi. Deve essere compreso tra 2 e 20 caratteri di lunghezza. + +<BR> +<A NAME="phones-group_alias_name"> +<BR> +<B>Gruppo Alias Nome - </B> Il nome utilizzato per designare un gruppo di alias, deve essere compresa tra 2 e 50 caratteri di lunghezza. + +<BR> +<A NAME="phones-caller_id_number"> +<BR> +<B>Numero ID chiamante - </B> Il numero ID del chiamante utilizzato in questo gruppo di Alias. Deve essere solo cifre. + +<BR> +<A NAME="phones-caller_id_name"> +<BR> +<B>Caller ID Nome - </B> Il Caller ID nome che possono essere inviati con questo gruppo di Alias. Per quanto ne sappiamo questo funziona solo in Canada e il PRI circuiti IAX loop utilizzando un tronco attraverso Asterisk. + @@ -4148,6 +4567,21 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <BR> <B>Activo -</B> fije si el servidor del asterisco es activo o inactivo. +<BR> +<A NAME="servers-sysload"> +<BR> +<B>Sistema di carico -</B> Queste due statistiche mostrano il loadavg di un sistema di 100 volte e la percentuale di utilizzo della CPU del server e viene aggiornato ogni minuto. Il loadavg dovrebbe essere in media al di sotto di 100, moltiplicato per il numero di CPU core il sistema è, per ottenere prestazioni ottimali. La percentuale di utilizzo della CPU dovrebbe rimanere al di sotto del 50 per ottenere prestazioni ottimali. + +<BR> +<A NAME="servers-channels_total"> +<BR> +<B>Live Canali -</B> Questo campo indica il numero attuale di Asterisk canali che sono in diretta su il sistema adesso. È importante notare che il numero di canali Asterisk è di solito molto più elevato rispetto al numero effettivo di chiamate su un sistema. Questo campo è aggiornato una volta ogni minuto. + +<BR> +<A NAME="servers-disk_usage"> +<BR> +<B>Utilizzo del disco -</B> Questo campo mostra lutilizzo del disco per ogni partizione su questo server. Questo campo è aggiornato una volta ogni minuto. + <BR> <A NAME="servers-asterisk_version"> <BR> @@ -4158,6 +4592,11 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <BR> <B>Troncos máximos de VICIDIAL -</B> este campo determinará el número de las líneas máximo que el auto-dialer de VICIDIAL procurará invitar este servidor. Si usted desea dedicar dos PRI llenos T1 a VICIDIALing en un servidor entonces usted fijaría esto a 46. E1 defecto es 96. +<BR> +<A NAME="servers-outbound_calls_per_second"> +<BR> +<B>Max chiede al secondo -</B> Questa impostazione determina il numero massimo di chiamate che possono essere immessi in uscita dalla selezione automatica di script sul server al secondo. Deve essere da 1 a 100. Il valore predefinito è 20. + <BR> <A NAME="servers-telnet_host"> <BR> @@ -4238,6 +4677,111 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <BR> <B>Balance Offlimits de VICIDIAL -</B> este ajuste define el número detroncos para no permitir el balance de VICIDIAL que marca parautilizar. Por ejemplo si usted tiene 40 troncos y offlimits vicidialmáximos del balance se fijan a 10 que usted podrá solamenteutilizar 30 líneas interurbanas para marcar del balance de VICIDIAL.El defecto es 0. +<BR> +<A NAME="servers-recording_web_link"> +<BR> +<B>Registrazione Web Link - </B> Questa impostazione consente di ignorare limpostazione predefinita della visualizzazione della registrazione in collegamento lamministratore pagine web. Il valore di default è SERVER_IP. + +<BR> +<A NAME="servers-alt_server_ip"> +<BR> +<B>Supplente di registrazione IP Server - </B> Questa impostazione è dove si può mettere un server IP o nome di altre macchine che possono essere utilizzati al posto del server_ip tra i link alle registrazioni ai admin pagine web. Il valore di default è vuota. + +<BR> +<A NAME="servers-active_asterisk_server"> +<BR> +<B>Attivo Server Asterisk - </B> Asterisk Se non è in esecuzione su questo server, o se VICIDIAL non dovrebbero utilizzare questo server, o se sono solo utilizzando questo server per altri script come la tramoggia di carico script si desidera impostare questo N. Il valore di default è Y. + +<BR> +<A NAME="servers-generate_vicidial_conf"> +<BR> +<B>Genera file conf - </B> Se si desidera il sistema di auto-generare asterisco conf file basati su telefoni voci, le voci del vettore e di impostazione di bilanciamento del carico allinterno VICIDIAL quindi impostare ad Y. Il valore di default è Y. + +<BR> +<A NAME="servers-rebuild_conf_files"> +<BR> +<B>Ricostruire conf - </B> Se si desidera forzare una ricostruzione del Asterisk conf file o se uno dei telefoni cellulari o vettore voci hanno cambiato allora questo deve essere impostato a Y. Dopo il file di configurazione sono stati generati e Asterisk ha stati ricaricati quindi questo sarà cambiato in N. Il valore di default è Y. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>vicidial_conf_templates TABELLA</FONT></B><BR><BR> +<A NAME="vicidial_conf_templates-template_id"> +<BR> +<B>Template ID - </B> Questo campo deve essere di almeno 2 caratteri e non più di 15 caratteri, senza spazi. Questo è lID che sarà utilizzato per identificare il modello di conf in tutto il sistema. + +<BR> +<A NAME="vicidial_conf_templates-template_name"> +<BR> +<B>Nome modello - </B> Questo è il nome descrittivo del file di conf modello entrata. + +<BR> +<A NAME="vicidial_conf_templates-template_contents"> +<BR> +<B>Template Sommario - </B> Questo campo è possibile entrare nello specifico delle impostazioni per essere utilizzati da tutti i telefoni o e-vettori che sono impostate per lutilizzo di questo modello conf. I campi che non dovrebbero essere inclusi in questa casella sono i seguenti: segreto, accountcode, account, nome utente e la casella e-mail. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>vicidial_server_carriers TABELLA</FONT></B><BR><BR> +<A NAME="vicidial_server_carriers-carrier_id"> +<BR> +<B>ID Vettore - </B> Questo campo deve essere di almeno 2 caratteri e non più di 15 caratteri, senza spazi. Questo è lID che sarà utilizzato per individuare il vettore per questo specifico entrata in tutto il sistema. + +<BR> +<A NAME="vicidial_server_carriers-carrier_name"> +<BR> +<B>Nome Vettore - </B> Questo è il nome descrittivo del vettore entrata. + +<BR> +<A NAME="vicidial_server_carriers-registration_string"> +<BR> +<B>Registrazione Stringa - </B> Questo campo è possibile immettere nella stringa esatta necessaria la SIP IAX o file di configurazione per la registrazione al provider. Opzionale, ma altamente raccomandato se il vettore consente di registrazione. + +<BR> +<A NAME="vicidial_server_carriers-template_id"> +<BR> +<B>Template ID - </B> Questo campo opzionale vi permette di scegliere un file di configurazione per questo modello vettore entrata. + +<BR> +<A NAME="vicidial_server_carriers-account_entry"> +<BR> +<B>Conto Entrata - </B> Questo campo è utilizzato se non hai selezionato un modello da utilizzare, ed è dove si può entrare nello specifico le impostazioni da utilizzare per questo vettore. Se si sarà tenuto a chiamate in entrata da questo vettore tronco che si desidera impostare il contesto trunkinbound = allinterno di questo settore, in modo che si può utilizzare il processo di trattamento allinterno DID VICIDIAL. + +<BR> +<A NAME="vicidial_server_carriers-protocol"> +<BR> +<B>Protocollo - </B> Questo campo permette di definire il protocollo da utilizzare per lingresso del vettore. Attualmente solo SIP e IAX sono supportati. + +<BR> +<A NAME="vicidial_server_carriers-globals_string"> +<BR> +<B>Globals Stringa - </B> Questo campo opzionale permette di definire una variabile globale da utilizzare per il vettore in dialplan. + +<BR> +<A NAME="vicidial_server_carriers-dialplan_entry"> +<BR> +<B>Entrata Dialplan - </B> Questo campo opzionale permette di definire una serie di dialplan voci da utilizzare per questo vettore. + +<BR> +<A NAME="vicidial_server_carriers-server_ip"> +<BR> +<B>IP Server - </B> Questo è il server che questo specifico vettore record è associato con. + +<BR> +<A NAME="vicidial_server_carriers-active"> +<BR> +<B>Attiva - </B> Questo definisce se il vettore sarà incluso nel generata automaticamente conf file o non. + + + + <BR><BR><BR><BR> @@ -4254,13 +4798,19 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para -<BR><BR><BR><BR> - -<B><FONT SIZE=3>VICIDIAL_SERVER_TRUNKS TABELLA</FONT></B><BR><BR> -<A NAME="vicidial_server_trunks"> -<BR> -<B>Los troncos del servidor de VICIDIAL permiten que usted restrinja laslíneas salientes que se utilizan en este servidor para la campañaque marca sobre una base de la por-campaña. Usted tiene la opcio`npara reservar un número de las líneas específico que se utilizaránpor solamente una campaña así como permitir que esa campañafuncione sobre sus líneas reservadas en cualesquiera líneas siguensiendo abiertas, según lo en las líneas totales usadas por vicidialen este servidor es de largo menos que fijar de los troncos delmáximo VICIDIAL. No tener cualesquiera de estos expedientespermitirá la campaña que marca la línea primero para tener tantaslíneas mientras que puede conseguir bajo fijar de los troncos delmáximo VICIDIAL.</B> +<? +if ($SSoutbound_autodial_active > 0) + { + ?> + <BR><BR><BR><BR> + <B><FONT SIZE=3>VICIDIAL_SERVER_Bauli TABELLA</FONT></B><BR><BR> + <A NAME="vicidial_server_trunks"> + <BR> + <B>Los troncos del servidor de VICIDIAL permiten que usted restrinja laslíneas salientes que se utilizan en este servidor para la campañaque marca sobre una base de la por-campaña. Usted tiene la opcio`npara reservar un número de las líneas específico que se utilizaránpor solamente una campaña así como permitir que esa campañafuncione sobre sus líneas reservadas en cualesquiera líneas siguensiendo abiertas, según lo en las líneas totales usadas por vicidialen este servidor es de largo menos que fijar de los troncos delmáximo VICIDIAL. No tener cualesquiera de estos expedientespermitirá la campaña que marca la línea primero para tener tantaslíneas mientras que puede conseguir bajo fijar de los troncos delmáximo VICIDIAL.</B> + <? + } +?> @@ -4277,6 +4827,99 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <BR> <B>Webroot escribible -</B> este ajuste permite que usted defina si losarchivos de la temperatura y los archivos de la autentificacio`n seancolocados en el webroot en su web server. El defecto es 1. +<BR> +<A NAME="settings-vicidial_agent_disable"> +<BR> +<B>El agente de VICIDIAL inhabilita la exhibicio`n -</B> este campo seutiliza para seleccionar cuando demostrar a un agente cuando susesio`n ha sido inhabilitada por el sistema, una accio`n del encargadoo por una medida externa. El ajuste de NOT_ACTIVE inhabilitará elmensaje en la pantalla de los agentes. El ajuste de LIVE_AGENTexhibirá solamente el mensaje lisiado cuando se ha quitado elexpediente de los vicidial_auto_calls de los agentes, por ejemplodurante un registro de estado de la máquina de la fuerza o registrode estado de la máquina de la emergencia. + +<BR> +<A NAME="settings-allow_sipsak_messages"> +<BR> +<B>Permita los mensajes de SIPSAK -</B> si el sistema a 1, este permite queel ajuste de la tabla de los telefonos trabaje correctamente, elservidor enviará mensajes al telefono del SIP a la exhibicio`n en laexhibicio`n del LCD del telefono cuando está registrado en VICIDIAL.Esta característica trabaja solamente con los telefonos del SIP yrequiere el uso del sipsak ser instalada en el web server. El defectoes 0. + +<BR> +<A NAME="settings-vdc_agent_api_active"> +<BR> +<B>Agente attivo API - </B> Se è impostato a 1, questo permetterà lagente interfaccia API di funzionare. Il valore di default è 0. + +<BR> +<A NAME="settings-admin_home_url"> +<BR> +<B>URL casero del Admin -</B> esta es la Direccion del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. + +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Permita el logfile de la transferencia del agente -</B> esta opcio`nregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. + +<BR> +<A NAME="settings-timeclock_end_of_day"> +<BR> +<B>Orologio End Of Day - </B> Questa impostazione definisce il momento in cui tutti gli utenti devono essere registrati automaticamente dal sistema orologio. Funziona solo una volta al giorno. deve essere solo il 4 cifre 2 cifre 2 cifre ora e 24 minuti in ora di tempo. Il valore di default è 0000. + +<BR> +<A NAME="settings-timeclock_last_reset_date"> +<BR> +<B>Ultimo orologio automatico Logout - </B> Questo campo visualizza la data degli ultimi auto-logout. + +<BR> +<A NAME="settings-vdc_header_date_format"> +<BR> +<B>Agente Screen Header Data Format - </B> Questo menu consente di scegliere il formato della data che compare nella parte superiore della schermata VICIDIAL agente. Le opzioni di questa impostazione sono: il default è MS_DASH_24HR<BR> +MS_DASH_24HR 2008-06-24 23:59:59 - Default data con formato giorno mese anno seguita da 24 ore di tempo<BR> +US_SLASH_24HR 06/24/2008 23:59:59 - Stati Uniti dAmerica con il formato della data giorno mese anno seguita da 24 ore di tempo<BR> +EU_SLASH_24HR 24/06/2008 23:59:59 - Europeo con il formato della data giorno mese anno seguita da 24 ore di tempo<BR> +AL_TEXT_24HR JUN 24 23:59:59 - Testo abbreviato con il formato della data giorno mese seguita da 24 ore di tempo<BR> +MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default data con formato giorno mese anno seguita da 12 ore di tempo<BR> +US_SLASH_AMPM 06/24/2008 11:59:59 PM - Stati Uniti dAmerica con il formato della data giorno mese anno seguita da 12 ore di tempo<BR> +EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europeo con il formato della data giorno mese anno seguita da 12 ore di tempo<BR> +AL_TEXT_AMPM JUN 24 11:59:59 PM - Testo abbreviato con il formato della data giorno mese seguita da 12 ore di tempo<BR> + +<BR> +<A NAME="settings-vdc_customer_date_format"> +<BR> +<B>Cliente di agente Screen Formato data - </B> Questo menu consente di scegliere il formato del cliente fuso orario data che compare nella parte superiore della sezione Informazioni per i clienti del VICIDIAL agente schermo. Le opzioni di questa impostazione sono: il default è AL_TEXT_AMPM<BR> +MS_DASH_24HR 2008-06-24 23:59:59 - Default data con formato giorno mese anno seguita da 24 ore di tempo<BR> +US_SLASH_24HR 06/24/2008 23:59:59 - Stati Uniti dAmerica con il formato della data giorno mese anno seguita da 24 ore di tempo<BR> +EU_SLASH_24HR 24/06/2008 23:59:59 - Europeo con il formato della data giorno mese anno seguita da 24 ore di tempo<BR> +AL_TEXT_24HR JUN 24 23:59:59 - Testo abbreviato con il formato della data giorno mese seguita da 24 ore di tempo<BR> +MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default data con formato giorno mese anno seguita da 12 ore di tempo<BR> +US_SLASH_AMPM 06/24/2008 11:59:59 PM - Stati Uniti dAmerica con il formato della data giorno mese anno seguita da 12 ore di tempo<BR> +EU_SLASH_AMPM 24/06/2008 11:59:59 PM - Europeo con il formato della data giorno mese anno seguita da 12 ore di tempo<BR> +AL_TEXT_AMPM JUN 24 11:59:59 PM - Testo abbreviato con il formato della data giorno mese seguita da 12 ore di tempo<BR> + +<BR> +<A NAME="settings-vdc_header_phone_format"> +<BR> +<B>Agente Telefono Formato schermo clienti - </B> Questo menu consente di scegliere il formato del cliente, numero di telefono che compare nella sezione status del VICIDIAL agente schermo. Le opzioni di questa impostazione sono: il default è US_PARN<BR> +US_DASH 000-000-0000 - USA dash separati numero di telefono<BR> +US_PARN (000)000-0000 - USA dash separati numero con prefisso parentesi<BR> +MS_NODS 0000000000 - N. formattazione<BR> +UK_DASH 00 0000-0000 - UK dash separati numero di telefono con lo spazio dopo il codice di città<BR> +AU_SPAC 000 000 000 - Australia spazio separato numero telefonico<BR> +IT_DASH 0000-000-000 - Italy dash separati numero di telefono<BR> +FR_SPAC 00 00 00 00 00 - France spazio separato numero telefonico<BR> + +<BR> +<A NAME="settings-vdc_agent_api_active"> +<BR> +<B>Agent interface API Access Attivo -</B> This option allows you to enable or disable the agent interface API. Default is 0. + +<BR> +<A NAME="settings-qc_features_active"> +<BR> +<B>Caratteristiche di Attivo QC - </B> Questa opzione consente di attivare o disattivare la qualità o le caratteristiche di controllo della qualità. Il valore di default è 0 per inattive. + +<BR> +<A NAME="settings-outbound_autodial_active"> +<BR> +<B>Outbound Auto-Dial Attivo - </B> Questa opzione consente di attivare o disattivare la connessione automatica in uscita entro VICIDIAL, limpostazione di questo campo a 0 rimuove gli elenchi e le sezioni FILTRI e molti campi della campagna Modifica schermi. Manuale per lingresso di selezione sarà ancora consentita lagente da schermo, ma nessuna lista di selezione sarà possibile. Il valore di default è 1, per attività di. + +<BR> +<A NAME="settings-outbound_calls_per_second"> +<BR> +<B>Max COMPILA invita al secondo -</B> Questa impostazione determina il numero massimo di chiamate che possono essere messi da parte lauto-fill-in uscita di selezione automatica di script per tutti i server, al secondo. Deve essere da 1 a 200. Il valore predefinito è 40. + <BR> <A NAME="settings-enable_queuemetrics_logging"> <BR> @@ -4318,81 +4961,35 @@ El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para <B>QueueMetrics EnterQueue prepend -</B> este campo se utiliza para permitirprepending de una de las zonas de informaciones del vicidial_listdelante del número de telefono del cliente para los informesmodificados para requisitos particulares de QueueMetrics. El defectono es NINGUNO no poblar cualquier cosa. <BR> -<A NAME="settings-vicidial_agent_disable"> +<A NAME="settings-enable_vtiger_integration"> <BR> -<B>El agente de VICIDIAL inhabilita la exhibicio`n -</B> este campo seutiliza para seleccionar cuando demostrar a un agente cuando susesio`n ha sido inhabilitada por el sistema, una accio`n del encargadoo por una medida externa. El ajuste de NOT_ACTIVE inhabilitará elmensaje en la pantalla de los agentes. El ajuste de LIVE_AGENTexhibirá solamente el mensaje lisiado cuando se ha quitado elexpediente de los vicidial_auto_calls de los agentes, por ejemplodurante un registro de estado de la máquina de la fuerza o registrode estado de la máquina de la emergencia. +<B>Attiva Vtiger Integrazione - </B> Questa impostazione consente di attivare Vtiger integrazione con VICIDIAL. Attualmente i collegamenti a Vtiger admin e di ricerca così come utente di replica sono gli unici disponibili funzioni di integrazione. Il valore di default è 0. <BR> -<A NAME="settings-allow_sipsak_messages"> +<A NAME="settings-vtiger_server_ip"> <BR> -<B>Permita los mensajes de SIPSAK -</B> si el sistema a 1, este permite queel ajuste de la tabla de los telefonos trabaje correctamente, elservidor enviará mensajes al telefono del SIP a la exhibicio`n en laexhibicio`n del LCD del telefono cuando está registrado en VICIDIAL.Esta característica trabaja solamente con los telefonos del SIP yrequiere el uso del sipsak ser instalada en el web server. El defectoes 0. +<B>Vtiger DB IP Server - </B> Questo è lindirizzo IP della banca dati per la vostra installazione Vtiger. <BR> -<A NAME="settings-vdc_agent_api_active"> +<A NAME="settings-vtiger_dbname"> <BR> -<B>Agent API Active -</B> If set to 1, this will allow the Agent API interface to function. Default is 0. +<B>Vtiger Nome Database - </B> Questo è il nome del database per il vostro database Vtiger. <BR> -<A NAME="settings-admin_home_url"> +<A NAME="settings-vtiger_login"> <BR> -<B>URL casero del Admin -</B> esta es la Direccion del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. +<B>Vtiger Database Login - </B> Questo è il nome utente utilizzato per accedere al vostro database Vtiger. <BR> -<A NAME="settings-enable_agc_xfer_log"> +<A NAME="settings-vtiger_pass"> <BR> -<B>Permita el logfile de la transferencia del agente -</B> esta opcio`nregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. +<B>Vtiger Database Password - </B> Questa è la password utilizzata per accedere al tuo database Vtiger. <BR> -<A NAME="settings-timeclock_end_of_day"> +<A NAME="settings-vtiger_url"> <BR> -<B>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. +<B>Vtiger URL - </B> Questo è lURL o lindirizzo del sito web utilizzato per accedere al tuo Vtiger installazione. -<BR> -<A NAME="settings-timeclock_last_reset_date"> -<BR> -<B>Timeclock Last Auto Logout -</B> This field displays the date of the last auto-logout. - -<BR> -<A NAME="settings-vdc_header_date_format"> -<BR> -<B>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 MS_DASH_24HR<BR> -MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR> -US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR> -EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR> -AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR> -MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR> -US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR> -EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR> -AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR> - -<BR> -<A NAME="settings-vdc_customer_date_format"> -<BR> -<B>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 AL_TEXT_AMPM<BR> -MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR> -US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR> -EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR> -AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR> -MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR> -US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR> -EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR> -AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR> - -<BR> -<A NAME="settings-vdc_header_phone_format"> -<BR> -<B>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 US_PARN<BR> -US_DASH 000-000-0000 - USA dash separated phone number<BR> -US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis<BR> -MS_NODS 0000000000 - No formatting<BR> -UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code<BR> -AU_SPAC 000 000 000 - Australia space separated phone number<BR> -IT_DASH 0000-000-000 - Italy dash separated phone number<BR> -FR_SPAC 00 00 00 00 00 - France space separated phone number<BR> - -<A NAME="settings-vdc_agent_api_active"> -<BR> -<B>Agent interface API Access Active -</B> This option allows you to enable or disable the agent interface API. Default is 0. <BR><BR><BR><BR> @@ -4407,16 +5004,22 @@ FR_SPAC 00 00 00 00 00 - France space separated phone number<BR> <B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES TABELLA</FONT></B><BR><BR> <A NAME="vicidial_status_categories"> <BR> -<B>Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificacio`n de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripcio`n es opcional y la exhibicio`nde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD.</B> The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics. +<B>Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificacio`n de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripcio`n es opcional y la exhibicio`nde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD.</B> La vendita e Dead Categoria Categoria di piombo sono entrambi utilizzati dal sistema quando Elenco Suggerimento analisi statistiche elenco. -<BR><BR><BR><BR> - -<B><FONT SIZE=3>VICIDIAL QC STATUS CODES</FONT></B><BR><BR> -<A NAME="vicidial_qc_status_codes"> -<BR> -<B>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.</B> +<? +if ($SSqc_features_active > 0) + { + ?> + <BR><BR><BR><BR> + <B><FONT SIZE=3>QC VICIDIAL Codici di stato</FONT></B><BR><BR> + <A NAME="vicidial_qc_status_codes"> + <BR> + <B>Il Controllo Qualità-QC VICIDIAL sistema ha il proprio set di codici di stato separato da coloro che, nelle funzioni di gestione delle chiamate VICIDIAL. QC statuse codici deve essere compresa tra 2 e 8 caratteri e non contengono caratteri speciali, come uno spazio o due punti. Il codice di stato, QC descrizione deve essere compresa tra 2 e 30 caratteri di lunghezza.</B> + <? + } +?> @@ -4516,7 +5119,7 @@ if ($ADD==73) ###################### if ($ADD==7111111) -{ + { ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; @@ -4556,552 +5159,115 @@ if ($ADD==7111111) $RGSIPexten = 'SIP/gs102'; $RGsession_id = '8600051'; -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; + $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $script_name = $row[1]; + $script_text = $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); + 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); + } + + $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("\n","
",$script_text); + + + echo ""; + + echo "Anteprima Script: $script_id
\n"; + echo "
\n"; + echo "
$script_name
\n"; + echo "$script_text\n"; + echo "
\n"; + + echo "\n"; + + exit; } -$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("\n","
",$script_text); - -echo ""; - -echo "Anteprima Script: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') - {$users_hh="bgcolor =\"$users_color\""; $users_fc="$users_font"; $users_bold="$header_selected_bold";} - else {$users_hh=''; $users_fc='WHITE'; $users_bold="$header_nonselected_bold";} -if ($hh=='campaigns') - {$campaigns_hh="bgcolor=\"$campaigns_color\""; $campaigns_fc="$campaigns_font"; $campaigns_bold="$header_selected_bold";} - else {$campaigns_hh=''; $campaigns_fc='WHITE'; $campaigns_bold="$header_nonselected_bold";} -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 ($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 Italiano
BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> - - - - - - - - - - - - - - - 1) { - ?> -> - 1) - { - -# if ($sh=='basic') {$basic_sh="bgcolor=\"$subcamp_color\""; $basic_fc="$subcamp_font";} -# else {$basic_sh=''; $basic_fc='BLACK';} -# if ($sh=='detail') {$detail_sh="bgcolor=\"$subcamp_color\""; $detail_fc="$subcamp_font";} -# else {$detail_sh=''; $detail_fc='BLACK';} -# if ($sh=='dialstat') {$dialstat_sh="bgcolor=\"$subcamp_color\""; $dialstat_fc="$subcamp_font";} -# else {$dialstat_sh=''; $dialstat_fc='BLACK';} - - 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';} - - ?> -> - - - - - - - - - 1) { - ?> - > - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - ?> -> - 1) { - if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # hard teal - else {$times_sh=''; $times_fc='BLACK';} - if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink - else {$phones_sh=''; $phones_fc='BLACK';} - if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink - else {$server_sh=''; $server_fc='BLACK';} - if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink - else {$conference_sh=''; $conference_fc='BLACK';} - if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink - else {$settings_sh=''; $settings_fc='BLACK';} - if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink - else {$status_sh=''; $status_fc='BLACK';} - - ?> -> - - - - - - - - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - 1) { - ?> - > - \n"; - echo "Le no autorizan a visio`n esta página. Vaya por favor detrás.\n"; - } - -} -if (strlen($reports_hh) > 1) { - ?> -> - - - - -
  VICIDIAL ADMIN - HOME | Timeclock | Logout  
> SIZE=> Utenti > SIZE=> Campagne > SIZE=> Liste > SIZE=> Script > SIZE=> Filtri > SIZE=> Gruppi Inbound > SIZE=> Gruppi Utenti > SIZE=> Operatori Remoti > SIZE=> Admin > SIZE=> Report
>   > Visualizza Utenti   |   > Aggiungi Nuovo Utente   |   > Copia Utente   |   > Ricerca Utenti   |   > User Stats   |   > User Status   |   > Time Sheet
COLSPAN=2> SIZE=>Main Campagne COLSPAN=1> SIZE=> Esiti COLSPAN=1> SIZE=> Hot-Key COLSPAN=2> SIZE=>Riciclaggio Contatti COLSPAN=1> SIZE=> Chiama-Auto-Num-Altern COLSPAN=1> SIZE=>Codici Pausa COLSPAN=2> SIZE=>Mix Liste
>   > Visualizza Campagne     |     > Aggiungi Nuova Campagna     |     > Copia Campagna     |     > Riepilogo Campagne In Tempo Reale
>   > Visualizza Liste     |     > Nuova Lista     |     > Ricerca Contatti     |     > Aggiungi Numero Alla Lista DNC     |     > Carica Nuovi Contatti
>   > Visualizza Script     |     > Aggiungi Nuovo Script
>   > Visualizza Filtri     |     > Aggiungi Nuovo Filtro
>   > Visualizza Gruppi Inbound     |     > Aggiungi Gruppo Inbound     |     > Copia Gruppo Inbound     |     > Show DIDs   |   > Add A New DID   |   > Copy DID
>   > Visualizza Gruppi Utenti     |     >Aggiungi Nuovo Gruppo Utente     |     > Report Orario Per Gruppo
>   > Visualizza Operatori Remoti     |     >Aggiungi Operatore Remoto
COLSPAN=2> SIZE=> Orari Chiamata COLSPAN=2> SIZE=> Telefoni COLSPAN=2> SIZE=> Conferencias COLSPAN=1> SIZE=> Server COLSPAN=1> SIZE=> Impostazioni di Sistema COLSPAN=2> SIZE=> Esiti di Default
>> Elenca Orari Chiamata  | > Nuovo Orario Chiamate  | > Elenca Orari Chiamata Per Stati  | > Nuovo Orario Chiamate Per Stato  | > Show Shifts  | > Add A New Shift
>   > Visualizza Telefoni   |   > Aggiungi Un Nuovo Telefono   |   > Phone Alias List   |   > Aggiungi Un Nuovo Telefono Alias
>Visualizza Conferenze   |   > Aggiungi Conferenza   |   > Visualizza Conferenze VICIDIAL   |   > Aggiungi Conferenza VICIDIAL
> Visualizza Server   |   > Aggiungi Un Nuovo Server
> Impostazioni di Sistema
> Esiti di Default   |   > Categorie di esiti   |   > QC Status Codes
>  
- 1) { ###################### if ($ADD=="1") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; - - echo "
NUOVO UTENTE
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Numero Utente: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Livello Utente: $NWB#vicidial_users-user_level$NWE
Gruppo Utente: \n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
\n"; + echo ""; + + echo "
NUOVO UTENTE \n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
Numero Utente: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Livello Utente: $NWB#vicidial_users-user_level$NWE
Gruppo Utente:
Login Telefono: $NWB#vicidial_users-phone_login$NWE
Password Telefono: $NWB#vicidial_users-phone_pass$NWE
\n"; } - echo "$Ugroups_list"; - echo "\n"; - echo "
Login Telefono: $NWB#vicidial_users-phone_login$NWE
Password Telefono: $NWB#vicidial_users-phone_pass$NWE
\n"; - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5174,24 +5341,24 @@ if ($ADD=="1") ###################### if ($ADD=="1A") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_users==1) + { + echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
COPIA UTENTE\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
COPIA UTENTE\n"; + echo "\n"; + echo "\n"; + echo "
Numero Utente: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} - echo "\n"; + echo "\n"; + echo "
Numero Utente: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Nome Completo: $NWB#vicidial_users-full_name$NWE
Utente Da Copiare:
Utente Da Copiare: $NWB#vicidial_users-user$NWE
\n"; } - echo "$Uusers_list"; - echo "$NWB#vicidial_users-user$NWE
\n"; - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5222,43 +5390,49 @@ if ($ADD=="1A") ###################### if ($ADD==11) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUOVA CAMPAGNA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\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 Campagna: $NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE
Attivo: $NWB#vicidial_campaigns-active$NWE
Extension del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE
Orario Chiamate: $NWB#vicidial_campaigns-local_call_time$NWE
Casella Vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - } + echo "
NUOVA CAMPAGNA\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"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Campagna: $NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE
Attivo: $NWB#vicidial_campaigns-active$NWE
Extension del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE
Orario Chiamate: $NWB#vicidial_campaigns-local_call_time$NWE
Casella Vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5266,64 +5440,19 @@ if ($ADD==11) ###################### if ($ADD==12) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
COPIA UNA CAMPAGNA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPIA UNA CAMPAGNA\n"; + echo "\n"; + echo "
ID Campagna: $NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "
ID Campagna: $NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
Campagna da copiare:$NWB#vicidial_campaigns-campaign_id$NWE
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.
\n"; - } - else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; - } -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ - if ($LOGmodify_lists==1) - { - echo "\n"; + + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - echo "
AGGIUNGI NUOVA LISTA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Lista: (solo cifre)$NWB#vicidial_lists-list_id$NWE
Nome Lista: $NWB#vicidial_lists-list_name$NWE
Descrizione Lista: $NWB#vicidial_lists-list_description$NWE
Campagna:
Campagna da copiare:$NWB#vicidial_lists-campaign_id$NWE
Attivo: $NWB#vicidial_lists-active$NWE
\n"; - } + echo "$campaigns_list"; + echo "$NWB#vicidial_campaigns-campaign_id$NWE
NOTA: La copia di una campagna di copiare tutte le impostazioni dal comandante campagna selezionata, ma non si copia una campagna specifica DNC lista se è stato selezionato uno sul master campagna.
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\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='Y' 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('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 "
DNC NO AGREGADO - este número de telefono está en no llama ya lalista: $PN[$p]\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC AGREGADO: $PN[$p]\n"; - } - } - 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 "
DNC NO AGREGADO - este número de telefono está en no llama ya lalista: $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 "
DNC AGREGADO: $PN[$p] $campaign_id\n"; - } - } - $p++; - } - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number','$campaign_id'|\n"); - fclose($fp); + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } } -echo "
ADD NUMBERS TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List:
Numero di Telefonos:

(one phone number per line only)
$NWB#vicidial_list-dnc$NWE
\n"; - -} - ###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN +# ADD=111 display the ADD NEW LIST FORM SCREEN ###################### -if ($ADD==1111) -{ - if ($LOGmodify_ingroups==1) +if ($ADD==111) { - echo "
\n"; - echo ""; - - echo "
NUOVO GRUPPO INBOUND\n"; - echo "\n"; - echo "
\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 Gruppo: (senza spazi)$NWB#vicidial_inbound_groups-group_id$NWE
Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
Colore Gruppo: $NWB#vicidial_inbound_groups-group_color$NWE
Attivo: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Casella Vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $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
Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } - else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; - } -} - - -###################### -# ADD=1211 display the COPY INBOUND GROUP SCREEN -###################### - -if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; - - echo "
COPIA GRUPPO INBOUND\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "
ID Gruppo: (senza spazi)$NWB#vicidial_inbound_groups-group_id$NWE
Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
ID Gruppo Da Copiare: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } - else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; - } -} - - -###################### -# ADD=1311 display the ADD NEW DID SCREEN -###################### - -if ($ADD==1311) -{ - if ($LOGmodify_dids==1) + if ($LOGmodify_lists==1) { echo "
\n"; echo ""; - echo "
ADD A NEW DID\n"; - echo "\n"; + echo "
AGGIUNGI NUOVA LISTA\n"; + echo "\n"; echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
DID Extension: (senza spazi)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descrizione: $NWB#vicidial_inbound_dids-did_description$NWE
ID Lista: (solo cifre)$NWB#vicidial_lists-list_id$NWE
Nome Lista: $NWB#vicidial_lists-list_name$NWE
Descrizione Lista: $NWB#vicidial_lists-list_description$NWE
Campagna: $NWB#vicidial_lists-campaign_id$NWE
Attivo: $NWB#vicidial_lists-active$NWE
\n"; } @@ -5542,7 +5524,208 @@ if ($ADD==1311) echo "Non hai l`autorizzazione per accedere a questa pagina\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='Y' 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('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 "
DNC NO AGREGADO - este número de telefono está en no llama ya lalista: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC AGREGADO: $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='LISTE', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN AGREGUE EL NÚMERO A 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] > 0) + {echo "
DNC NO AGREGADO - este número de telefono está en no llama ya lalista: $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 "
DNC AGREGADO: $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='LISTE', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + echo "
Aggiungere numeri alla DNC ELENCO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Numeri di telefono:

(uno per ogni riga il numero di telefono unico)
$NWB#vicidial_list-dnc$NWE
\n"; + } + + +###################### +# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN +###################### + +if ($ADD==1111) + { + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + echo "
NUOVO GRUPPO INBOUND\n"; + echo "\n"; + echo "
\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 Gruppo: (senza spazi)$NWB#vicidial_inbound_groups-group_id$NWE
Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
Colore Gruppo: $NWB#vicidial_inbound_groups-group_color$NWE
Attivo: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Casella Vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $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
Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=1211 display the COPY INBOUND GROUP SCREEN +###################### + +if ($ADD==1211) + { + if ($LOGmodify_ingroups==1) + { + echo "
\n"; + echo ""; + + echo "
COPIA GRUPPO INBOUND\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
ID Gruppo: (senza spazi)$NWB#vicidial_inbound_groups-group_id$NWE
Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
ID Gruppo Da Copiare: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=1311 display the ADD NEW DID SCREEN +###################### + +if ($ADD==1311) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
AGGIUNGI UN NUOVO DID\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
HA Estensione: (senza spazi or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } ###################### @@ -5550,19 +5733,19 @@ if ($ADD==1311) ###################### if ($ADD==1411) -{ - if ($LOGmodify_dids==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_dids==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
COPY DID\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPIA DID\n"; + echo "\n"; + echo "
DID Extension: (senza spazi)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descrizione: $NWB#vicidial_inbound_dids-did_description$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$dids_list"; + echo "$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; - echo "\n"; - echo "
HA Estensione: (senza spazi or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
Source DID:
HA Fonte:$NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; - } + echo "
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5594,38 +5778,38 @@ if ($ADD==1411) ###################### if ($ADD==11111) -{ + { if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUOVO OPERATORE REMOTO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio ID Utente: (solo cifre, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Server: $NWB#vicidial_remote_agents-server_ip$NWE
Numero Di Interno Remoto: (numero del dialplan usato per raggiungere gli operatori)$NWB#vicidial_remote_agents-conf_exten$NWE
Esito: $NWB#vicidial_remote_agents-status$NWE
Campagna: $NWB#vicidial_remote_agents-campaign_id$NWE
Gruppi Inbound: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n"; - } + echo "
NUOVO OPERATORE REMOTO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Inizio ID Utente: (solo cifre, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Server: $NWB#vicidial_remote_agents-server_ip$NWE
Numero Di Interno Remoto: (numero del dialplan usato per raggiungere gli operatori)$NWB#vicidial_remote_agents-conf_exten$NWE
Esito: $NWB#vicidial_remote_agents-status$NWE
Campagna: $NWB#vicidial_remote_agents-campaign_id$NWE
Gruppi Inbound: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "NOTA: Potrebbero passare fino a 30 secondi prima che le modifiche qui effettuate possano essere accettate\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5633,26 +5817,26 @@ if ($ADD==11111) ###################### if ($ADD==111111) -{ + { if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
NUOVO GRUPPO UTENTI\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Gruppo: (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE
Descrizione: (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } + echo "
NUOVO GRUPPO UTENTI\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Gruppo: (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE
Descrizione: (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5660,72 +5844,72 @@ if ($ADD==111111) ###################### if ($ADD==1111111) -{ + { if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGGIUNGI NUOVO SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Script:: (senza spazi e punteggiatura)$NWB#vicidial_scripts-script_id$NWE
Nome Script: (titolo script)$NWB#vicidial_scripts-script_name$NWE
Note Script: $NWB#vicidial_scripts-script_comments$NWE
Attivo: $NWB#vicidial_scripts-active$NWE
Testo Script: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } + echo "
AGGIUNGI NUOVO SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Script:: (senza spazi e punteggiatura)$NWB#vicidial_scripts-script_id$NWE
Nome Script: (titolo script)$NWB#vicidial_scripts-script_name$NWE
Note Script: $NWB#vicidial_scripts-script_comments$NWE
Attivo: $NWB#vicidial_scripts-active$NWE
Testo Script: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5733,28 +5917,28 @@ if ($ADD==1111111) ###################### if ($ADD==11111111) -{ + { if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGGIUNGI NUOVO FILTRO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Filtro: (senza spazi e punteggiatura)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nome Del Filtro: (breve descrizione del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Commenti Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } + echo "
AGGIUNGI NUOVO FILTRO\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Filtro: (senza spazi e punteggiatura)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nome Del Filtro: (breve descrizione del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Commenti Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5762,29 +5946,29 @@ if ($ADD==11111111) ###################### if ($ADD==111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
AGGIUNGI ORARIO CHIAMATE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
AGGIUNGI ORARIO CHIAMATE\n"; + echo "\n"; + echo "
ID Orario Chiamate: (senza spazi e punteggiatura)$NWB#vicidial_call_times-call_time_id$NWE
Nome Orario Chiamate: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
Note Orario Chiamate: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Orario Chiamate: (senza spazi e punteggiatura)$NWB#vicidial_call_times-call_time_id$NWE
Nome Orario Chiamate: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
Note Orario Chiamate: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
\n"; - } + echo "
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5792,30 +5976,30 @@ if ($ADD==111111111) ###################### if ($ADD==1111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO\n"; + echo "\n"; + echo "
Identificacio`n Del Tiempo De la Llamada Del Estado: (senza spazi e punteggiatura)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (senza spazi e punteggiatura)$NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Identificacio`n Del Tiempo De la Llamada Del Estado: (senza spazi e punteggiatura)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (senza spazi e punteggiatura)$NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
\n"; - } + echo "
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definicio`n del tiempo de la llamada
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5823,39 +6007,39 @@ if ($ADD==1111111111) ###################### if ($ADD==131111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + 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 "
Shift ID: (senza spazi e punteggiatura)$NWB#vicidial_shifts-shift_id$NWE
Shift Name: (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE
Shift Start Time: \n"; - echo "   Shift End Time: \n"; - echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Length: $NWB#vicidial_shifts-shift_length$NWE
Shift Weekdays:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; - echo "Sunday
\n"; - echo "Monday
\n"; - echo "Tuesday
\n"; - echo "Wednesday
\n"; - echo "Thursday
\n"; - echo "Friday
\n"; - echo "Saturday
\n"; - echo "
\n"; - } + echo "
ADD NEW SHIFT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Maiusc ID: (senza spazi e punteggiatura)$NWB#vicidial_shifts-shift_id$NWE
Maiusc Nome: (breve descrizione del turno)$NWB#vicidial_shifts-shift_name$NWE
Maiusc Start Time:\n"; + echo "   Fine Time Shift:\n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Maiusc Lunghezza: $NWB#vicidial_shifts-shift_length$NWE
Maiusc Feriali:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Domenica
\n"; + echo "Lunedi
\n"; + echo "Martedì
\n"; + echo "Mercoledì
\n"; + echo "Giovedi
\n"; + echo "Venerdì
\n"; + echo "Sabato
\n"; + echo "
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5863,47 +6047,47 @@ if ($ADD==131111111) ###################### if ($ADD==11111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGGIUNGI UN NUOVO TELEFONO\n"; - echo "\n"; - echo "
\n"; + echo "
AGGIUNGI UN NUOVO TELEFONO\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Interno Telefono: $NWB#phones-extension$NWE
Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
Direccion IP del telefono: (optional)$NWB#phones-phone_ip$NWE
Direccion IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Server: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Interno Telefono: $NWB#phones-extension$NWE
Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
Direccion IP del telefono: (optional)$NWB#phones-phone_ip$NWE
Direccion IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Server: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Esito: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del telefono: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Compania: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocollo Client: $NWB#phones-protocol$NWE
Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Esito: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del telefono: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Compania: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocollo Client: $NWB#phones-protocol$NWE
Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5911,30 +6095,63 @@ if ($ADD==11111111111) ###################### if ($ADD==12111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
AGGIUNGI UN NUOVO TELEFONO ALIAS\n"; - echo "\n"; - echo "
\n"; + echo "
AGGIUNGI UN NUOVO TELEFONO ALIAS\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
Alias ID: $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Login Telefonos List: (comma separated)$NWB#phones-logins_list$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Alias ID:$NWB#phones-alias_id$NWE
Alias Nome: $NWB#phones-alias_name$NWE
Telefono Login Lista: (comma separated)$NWB#phones-logins_list$NWE
\n"; - } + echo "
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN +###################### + +if ($ADD==13111111111) + { + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + echo "
Aggiungere un nuovo gruppo ALIAS\n"; + echo "\n"; + echo "
\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
Gruppo Alias ID:$NWB#phones-group_alias_id$NWE
Alias Nome Gruppo: $NWB#phones-group_alias_name$NWE
Numero CallerID: $NWB#phones-caller_id_number$NWE
CallerID Nome: $NWB#phones-caller_id_name$NWE
Attivo:
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5942,29 +6159,127 @@ if ($ADD==12111111111) ###################### if ($ADD==111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
AGGIUNGI UN NUOVO SERVER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
ID Server: $NWB#servers-server_id$NWE
Descrizione Server: $NWB#servers-server_description$NWE
Indirizzo IP del Server: $NWB#servers-server_ip$NWE
Attivo: $NWB#servers-active$NWE
Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
\n"; - } + echo "
AGGIUNGI UN NUOVO SERVER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
ID Server: $NWB#servers-server_id$NWE
Descrizione Server: $NWB#servers-server_description$NWE
Indirizzo IP del Server: $NWB#servers-server_ip$NWE
Attivo: $NWB#servers-active$NWE
Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CONF TEMPLATE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $NWB#vicidial_conf_templates-template_id$NWE
Nome modello: $NWB#vicidial_conf_templates-template_name$NWE
Template Sommario: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
AGGIUNGI NUOVO VETTORE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Vettore ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Nome del vettore: $NWB#vicidial_server_carriers-carrier_name$NWE
Stringa di registrazione: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Conto Entrata: $NWB#vicidial_server_carriers-account_entry$NWE
Protocollo: $NWB#vicidial_server_carriers-protocol$NWE
Globals Stringa: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan entrata: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Server: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -5972,30 +6287,30 @@ if ($ADD==111111111111) ###################### if ($ADD==1111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
CREA UNA NUOVA CONFERENZA\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
IP Server: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
IP Server: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} ###################### @@ -6003,30 +6318,30 @@ if ($ADD==1111111111111) ###################### if ($ADD==11111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
CREA UNA NUOVA CONFERENZA VICIDIAL\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
IP Server: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
IP Server: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} @@ -6042,7 +6357,7 @@ if ($ADD==11111111111111) ###################### if ($ADD=="2") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -6055,7 +6370,7 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
UTENTE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
user id must be between 2 and 10 characters long\n"; @@ -6105,25 +6420,211 @@ if ($ADD=="2") $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USERS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); + $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 = 'Attivo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=3; + } ###################### # ADD=2A adds the copied new user to the system ###################### if ($ADD=="2A") -{ + { echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); @@ -6141,7 +6642,7 @@ if ($ADD=="2A") } else { - if (ereg('AUTOGENERA',$user)) + if (ereg('AUTOGEN',$user)) { $new_user=0; $auto_user_add_value=0; @@ -6178,8 +6679,7 @@ if ($ADD=="2A") $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) 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 from vicidial_users where user=\"$source_user_id\";"; + $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) 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 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\";"; @@ -6188,30 +6688,216 @@ if ($ADD=="2A") $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='USERS', event_type='COPY', record_id='$user', event_code='ADMIN COPIA UTENTE', 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 = 'Attivo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A COPIED USER |$PHP_AUTH_USER|$ip|$user|$source_user_id|$stmt|\n"); - fclose($fp); - } } } -exit; -} + exit; + } ###################### # ADD=21 adds the new campaign to the system ###################### if ($ADD==21) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -6240,31 +6926,28 @@ if ($ADD==21) $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) 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); - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; + $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='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUOVA CAMPAGNA |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } } } -$ADD=31; -} + $ADD=31; + } ###################### # ADD=20 adds copied new campaign to the system ###################### if ($ADD==20) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -6283,7 +6966,7 @@ if ($ADD==20) { echo "
CAMPAIGN 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) 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 from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $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) 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 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');"; @@ -6301,27 +6984,24 @@ if ($ADD==20) $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); - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY TO NEW CAMPAIGN|$PHP_AUTH_USER|$ip|$campaign_id|$source_campaign_id|$stmt|$stmtA|\n"); - fclose($fp); - } - + ### 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='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=31; -} + $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';"; $rslt=mysql_query($stmt, $link); @@ -6350,19 +7030,19 @@ if ($ADD==22) $stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category) values('$status','$status_name','$selectable','$campaign_id','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUOVA CAMPAGNA STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA STATUS', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$SUB=22; -$ADD=31; -} + $SUB=22; + $ADD=31; + } ###################### @@ -6370,7 +7050,7 @@ $ADD=31; ###################### if ($ADD==23) -{ + { $HKstatus_data = explode('-----',$HKstatus); $status = $HKstatus_data[0]; $status_name = $HKstatus_data[1]; @@ -6396,18 +7076,18 @@ if ($ADD==23) $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUOVA CAMPAGNA HOT KEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA HOTKEY', event_sql=\"$SQL_log\", event_notes='Esito: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=23; -$ADD=31; -} + $SUB=23; + $ADD=31; + } ###################### @@ -6415,7 +7095,7 @@ $ADD=31; ###################### if ($ADD==25) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; @@ -6429,7 +7109,7 @@ if ($ADD==25) { echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos and less than 43200 seconds or 12 hours\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos e meno di 43200 secondi o 12 ore\n"; echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; } else @@ -6439,18 +7119,18 @@ if ($ADD==25) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=25; -$ADD=31; -} + $SUB=25; + $ADD=31; + } ###################### @@ -6458,7 +7138,7 @@ $ADD=31; ###################### 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 %\";"; @@ -6486,18 +7166,18 @@ if ($ADD==26) $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A AUTO-ALT-DIAL STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA ALT DIAL', event_sql=\"$SQL_log\", event_notes='Esito: $auto_alt_dial_statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=26; -$ADD=31; -} + $SUB=26; + $ADD=31; + } ###################### @@ -6505,7 +7185,7 @@ $ADD=31; ###################### 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); @@ -6518,7 +7198,7 @@ if ($ADD==27) { echo "
Co`DIGO DE LA PAUSA DEL AGENTE NO AGREGADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
pause code must be between 1 and 6 characters in length\n"; - echo "
pause code name must be between 2 and 30 characters in length\n"; + echo "
pause nome in codice deve essere compreso tra 2 e 30 caratteri di lunghezza\n"; } else { @@ -6527,18 +7207,18 @@ if ($ADD==27) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW AGENT PAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Codice Pausa: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$SUB=27; -$ADD=31; -} + $SUB=27; + $ADD=31; + } ###################### @@ -6546,7 +7226,7 @@ $ADD=31; ###################### if ($ADD==28) -{ + { $status = eregi_replace("-----.*",'',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; @@ -6574,18 +7254,18 @@ if ($ADD==28) $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|AGGIUNGI CAMPAGNA DIAL STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Esito: $statuses';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -#$SUB=28; -$ADD=31; -} + #$SUB=28; + $ADD=31; + } ###################### @@ -6593,7 +7273,7 @@ $ADD=31; ###################### if ($ADD==211) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); @@ -6616,17 +7296,17 @@ if ($ADD==211) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|AGGIUNGI NUOVA LISTA |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='LISTE', 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=311; + } @@ -6635,7 +7315,7 @@ $ADD=311; ###################### if ($ADD==2111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -6662,23 +7342,23 @@ if ($ADD==2111) $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) 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); - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; - $rslt=mysql_query($stmt, $link); + $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; + $rslt=mysql_query($stmtA, $link); echo "
GRUPPO AGGIUNTO: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=3111; -} + $ADD=3111; + } ###################### @@ -6686,7 +7366,7 @@ $ADD=3111; ###################### if ($ADD==2011) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); @@ -6703,22 +7383,22 @@ if ($ADD==2011) } 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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $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) 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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
GRUPPO AGGIUNTO: $group_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPIED TO NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 COPIA GRUPPO INBOUND', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=3111; -} + $ADD=3111; + } ###################### @@ -6726,25 +7406,25 @@ $ADD=3111; ###################### 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 "
DID NOT ADDED - there is already a DID in the system with this ID\n";} + {echo "
NON HA AGGIUNTO - vi è già un fatto per il sistema con questo ID\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 "
DID NOT ADDED - there is already a DID in the system with this extension\n";} + {echo "
NON HA AGGIUNTO - vi è già un fatto per il sistema con questa estensione\n";} else { if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) { - echo "
DID NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
NON HA AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; } else @@ -6759,18 +7439,18 @@ if ($ADD==2311) echo "
DID ADDED: $did_pattern $did_description - $did_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A DID |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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=3311; + } ###################### @@ -6778,18 +7458,18 @@ $ADD=3311; ###################### 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 "
DID NOT ADDED - there is already a DID in the system with this extension\n";} + {echo "
NON HA AGGIUNTO - vi è già un fatto per il sistema con questa estensione\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 "
DID NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
NON HA AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; } else @@ -6804,17 +7484,17 @@ if ($ADD==2411) echo "
DID ADDED: $did_pattern - $did_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|COPY A DID |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 COPIA DID', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=3311; -} + $ADD=3311; + } ###################### @@ -6822,7 +7502,7 @@ $ADD=3311; ###################### 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); @@ -6843,24 +7523,24 @@ if ($ADD==21111) echo "
OPERATORE REMOTO AGGIUNTO: $user_start\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW OPERATORI REMOTI ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } + ### 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=10000; + } ###################### # ADD=211111 adds new user group to the system ###################### if ($ADD==211111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); @@ -6881,24 +7561,100 @@ if ($ADD==211111) echo "
GRUPPO UTENTI AGGIUNTO: $user_group\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 NUOVO GRUPPO UTENTI', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUOVO UTENTE GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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=100000; + } ###################### # ADD=2111111 adds new script to the system ###################### if ($ADD==2111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; $rslt=mysql_query($stmt, $link); @@ -6919,17 +7675,17 @@ if ($ADD==2111111) echo "
SCRIPT AGGIUNTO: $script_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SCRIPT', event_type='ADD', record_id='$script_id', event_code='ADMIN AGGIUNGI SCRIPT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=1000000; -} + $ADD=1000000; + } ###################### @@ -6937,7 +7693,7 @@ $ADD=1000000; ###################### if ($ADD==21111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; $rslt=mysql_query($stmt, $link); @@ -6958,17 +7714,17 @@ if ($ADD==21111111) echo "
FILTRO AGGIUNTO: $lead_filter_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='FILTRI', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN AGGIUNGI FILTRO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } -$ADD=10000000; -} + $ADD=10000000; + } ###################### @@ -6976,7 +7732,7 @@ $ADD=10000000; ###################### if ($ADD==211111111) -{ + { echo ""; $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); @@ -6997,17 +7753,17 @@ if ($ADD==211111111) echo "
ORARIO CHIAMATE AGGIUNTO: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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=311111111; + } ###################### @@ -7015,7 +7771,7 @@ $ADD=311111111; ###################### 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); @@ -7036,17 +7792,17 @@ if ($ADD==2111111111) echo "
ORARIO CHIAMATE PER STATO AGGIUNTO: $call_time_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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=3111111111; + } ###################### @@ -7054,22 +7810,22 @@ $ADD=3111111111; ###################### if ($ADD==231111111) -{ + { 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 "
SHIFT DEFINITION NOT ADDED - there is already a shift entry with this ID\n";} + {echo "
SHIFT DEFINIZIONE NON AGGIUNTO - esiste già una voce con questo passaggio 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 "
SHIFT DEFINITION NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Shift ID and name must be at least 2 characters in length\n"; - echo "
Shift Start Time must be 4 digits in length and be a valid time\n"; - echo "
Shift Length must be 5 characters in length and be 24 hours or less\n"; + echo "
SHIFT DEFINIZIONE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Maiusc ID e il nome deve essere di almeno 2 caratteri\n"; + echo "
Start Time Shift 4 cifre devono essere di lunghezza e da tempo una valida\n"; + echo "
Maiusc Lunghezza deve essere di 5 caratteri di lunghezza e di 24 ore o meno\n"; } else { @@ -7083,19 +7839,19 @@ if ($ADD==231111111) $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); - echo "
SHIFT ADDED: $shift_id\n"; + echo "
SHIFT AGGIUNTI:$shift_id\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SHIFT ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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=331111111; + } ###################### @@ -7103,8 +7859,7 @@ $ADD=331111111; ###################### if ($ADD==21111111111) -{ -echo "
\n"; + { echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -7117,14 +7872,14 @@ echo "
\n"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
PHONE NOT ADDED - there is already a Phone in the system with this login\n";} + {echo "
PHONE NOT ADDED - vi è già un telefono nel sistema con questo 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 - there is already a Phone alias in the system with this login\n";} + {echo "
PHONE NOT ADDED - vi è già un alias Telefono nel sistema con questo login\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)) @@ -7136,19 +7891,19 @@ echo "
\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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|AGGIUNGI UN NUOVO TELEFONO |$stmt|\n"); - fclose($fp); - } + ### 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=31111111111; + } ###################### @@ -7156,44 +7911,84 @@ $ADD=31111111111; ###################### if ($ADD==22111111111) -{ -echo "
\n"; + { 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 "
PHONE ALIAS NOT ADDED - there is already a Phone Alias in the system with this ID\n";} + {echo "
ALIAS TELEFONO NON AGGIUNTO - vi è già un Telefono Alias nel sistema con questo 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 "
PHONE ALIAS NOT ADDED - there is already a Login Telefono in the system with this ID\n";} + {echo "
ALIAS TELEFONO NON AGGIUNTO - vi è già un Telefono Login nel sistema con questo ID\n";} else { if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) - {echo "
PHONE ALIAS NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n";} + {echo "
ALIAS TELEFONO NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - echo "
PHONE ALIAS ADDED\n"; + echo "
TELEFONO ALIAS AGGIUNTO\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|AGGIUNGI UN NUOVO TELEFONO ALIAS |$stmt|\n"); - fclose($fp); - } + ### 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 TELEFONO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=32111111111; -} + $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 GRUPPO NON AGGIUNTO - vi è già un Telefono Alias nel sistema con questo ID\n";} + else + { + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) + {echo "
ALIAS GRUPPO NON AGGIUNTO - non è possibile utilizzare le parole riservate nel gruppo alias\n";} + else + { + if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) + {echo "
ALIAS GRUPPO NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
GRUPPO ALIAS AGGIUNTO\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; + } ###################### @@ -7201,8 +7996,7 @@ $ADD=32111111111; ###################### if ($ADD==211111111111) -{ -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 ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_query($stmt, $link); @@ -7220,17 +8014,17 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; @@ -13578,13 +15808,13 @@ if ($ADD==3111) echo "\n"; - echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -13592,25 +15822,25 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -13620,63 +15850,65 @@ if ($ADD==3111) echo "$Xgroups_menu"; echo "$NWB#vicidial_inbound_groups-default_xfer_group$NWE\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - 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 * from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status"; + ##### 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); - $statuses_to_print = mysql_num_rows($rslt); - $qc_statuses_list=''; - + $group_alias_to_print = mysql_num_rows($rslt); + $group_alias_menu=''; + $group_alias_selected=0; $o=0; - while ($statuses_to_print > $o) + while ($group_alias_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $qc_statuses_list .= "$rowx[0] - $rowx[1]\n"; $o++; } - $stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); + echo "\n"; - $o=0; - while ($Cstatuses_to_print > $o) + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSqc_features_active > 0) { - $rowx=mysql_fetch_row($rslt); - if (!ereg("\"$rowx[0]\"",$qc_statuses_list)) + 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 * 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"; } - ##### get scripts listings for 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); - $QCscripts_list=""; - $o=0; - while ($scripts_to_print > $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 "
\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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|AGGIUNGI UN NUOVO SERVER |$stmt|\n"); - fclose($fp); - } + ### 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=311111111111; + } ###################### @@ -7238,7 +8032,7 @@ $ADD=311111111111; ###################### if ($ADD==221111111111) -{ + { echo ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -7277,18 +8071,90 @@ if ($ADD==221111111111) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW VICIDIAL TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 SERVER TRUNK', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } -$ADD=311111111111; -} + $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 "
CONF TEMPLATE NON AGGIUNTO - vi è già un modello del sistema con questo ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
CONF TEMPLATE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
CONF TEMPLATE AGGIUNTO\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 "
Vettore non AGGIUNTO - vi è già un elemento portante del sistema con questo ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
Vettore non AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\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) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $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='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; + } ###################### @@ -7296,8 +8162,7 @@ $ADD=311111111111; ###################### if ($ADD==2111111111111) -{ -echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "RIMUOVI\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + $dtl = 'Balanced'; + if ($n<0) {$dtl = 'Less Intense';} + if ($n>0) {$dtl = 'More Intense';} + if ($n == $adaptive_intensity) + {echo "\n";} + else + {echo "\n";} + $n--; } + echo " $NWB#vicidial_campaigns-adaptive_intensity$NWE\n"; } - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; echo "\n"; @@ -12299,71 +14464,129 @@ if ($ADD==34) echo "
\n"; + { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -7316,8 +8181,8 @@ echo "\n"; echo "\n"; 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 ($Ds_to_print > $o) + if ($SSoutbound_autodial_active > 0) { - $o++; - $Dstatus = $Dstatuses[$o]; + echo "\n"; - echo "\n"; + $o++; + $Dstatus = $Dstatuses[$o]; + + echo "\n"; + } + else + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "RIMUOVI\n"; + } } + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + $n--; } + echo "% $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; } - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - 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"; - + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } echo "\n"; echo "\n"; @@ -11467,8 +13508,12 @@ if ($ADD==31) echo "\n"; - echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -11477,53 +13522,108 @@ if ($ADD==31) echo "\n"; - echo "\n"; - + if ($SSoutbound_autodial_active > 0) + { + 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"; 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"; + 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"; + } + else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } if ($campaign_allow_inbound == 'Y') { @@ -11549,33 +13649,88 @@ if ($ADD==31) echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=3111111111111; -} + $ADD=3111111111111; + } ###################### @@ -7325,8 +8190,7 @@ $ADD=3111111111111; ###################### if ($ADD==21111111111111) -{ -echo ""; echo ""; echo ""; - echo ""; - echo ""; + + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo ""; - echo ""; - echo ""; - echo ""; + if ($SSqc_features_active > 0) + { + echo ""; + } + if ($SSoutbound_autodial_active < 1) + { + echo "\n"; + } echo "\n"; echo "
\n"; + { echo ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); @@ -7345,8 +8209,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) { @@ -10879,10 +12862,18 @@ if ($ADD==3) 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"; + if ($SSqc_features_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } } if ($LOGuser_level > 8) { @@ -10919,6 +12913,8 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -10926,8 +12922,8 @@ if ($ADD==3) echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -10935,19 +12931,24 @@ if ($ADD==3) 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"; - echo "\n"; - echo "\n"; - echo "\n"; } echo "\n"; echo "
\n"; $rslt=mysql_query($stmt, $link); } } -$ADD=31111111111111; -} + $ADD=31111111111111; + } ###################### @@ -7354,8 +8218,7 @@ $ADD=31111111111111; ###################### if ($ADD==221111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status';"; $rslt=mysql_query($stmt, $link); @@ -7384,18 +8247,18 @@ if ($ADD==221111111111111) $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category) values('$status','$status_name','$selectable','$human_answered','$category');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SYSTEMSTATUSES', event_type='ADD', record_id='$status', 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=321111111111111; + } ###################### @@ -7403,8 +8266,7 @@ $ADD=321111111111111; ###################### if ($ADD==231111111111111) -{ - + { echo ""; $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_query($stmt, $link); @@ -7421,7 +8283,7 @@ if ($ADD==231111111111111) } else { - echo "
STATUS CATEGORY ADDED: $vsc_id - $vsc_name\n"; + 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); @@ -7435,17 +8297,17 @@ if ($ADD==231111111111111) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATUS CATEGORY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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=331111111111111; + } @@ -7454,40 +8316,39 @@ $ADD=331111111111111; ###################### 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 "
QC STATUS CODE NOT ADDED - there is already a qc status code in the system with this name: $row[0]\n";} + {echo "
QC CODICE STATO NON AGGIUNTO- vi è già un qc codice di stato del sistema con questo nome: $row[0]\n";} else { if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) { - echo "
QC STATUS CODE NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
code must be between 1 and 8 characters in length\n"; - echo "
code name must be between 2 and 30 characters in length\n"; + echo "
QC CODICE STATO NON AGGIUNTO- Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
codice deve essere compreso tra 1 e 8 caratteri di lunghezza\n"; + echo "
nome in codice deve essere compreso tra 2 e 30 caratteri di lunghezza\n"; } else { - echo "
QC STATUS CODE ADDED: $code_name - $code\n"; + echo "
QC STATUS CODICE AGGIUNTO:$code_name - $code\n"; $stmt="INSERT INTO vicidial_qc_codes (code,code_name) values('$code','$code_name');"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW QC STATUS CODE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='QCSTATUSES', 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; -} + $ADD=341111111111111; + } @@ -7516,19 +8377,211 @@ if ($ADD=="4A") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
UTENTE MODIFICATO - 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' where user='$user';"; + $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' 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='USERS', 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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ############################################################### + ##### 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Attivo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -7557,18 +8610,211 @@ if ($ADD=="4B") } else { + if ($SSoutbound_autodial_active < 1) + { + $closer_default_blended = '0'; + $delete_filters = '0'; + $load_leads = '0'; + } echo "
UTENTE MODIFICATO - 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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USERS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Attivo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -7600,16 +8846,203 @@ if ($ADD==4) { echo "
UTENTE MODIFICATO: $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' where user='$user';"; + $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' where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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='USERS', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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 = 'Attivo'; + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 @@ -7621,90 +9054,164 @@ $ADD=3; # go to user modification below } ###################### -# ADD=41 submit campaign modifications to the system +# ADD=41 submit campaign modifications to the system - DETAIL ###################### if ($ADD==41) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
CAMPAÚA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - echo "
|$campaign_name|$active|\n"; - } - else - { - echo "
CAMPAGNA MODIFICATA: $campaign_id\n"; + echo ""; - if ($dial_method == 'MANUAL') + if ($SSoutbound_autodial_active < 1) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + $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 = '8300'; + $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'; + } + if (ereg('list_activation',$stage)) + { + $p=0; + echo "
ATTIVO LISTE CAMBIAMENTO"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTE', 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 ($dial_level_override > 0) + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $adlSQL = "auto_dial_level='$auto_dial_level',"; + echo "
CAMPAÚA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; + echo "
|$campaign_name|$active|\n"; } - else + else { - if ($dial_method == 'RATIO') + echo "
CAMPAGNA MODIFICATA: $campaign_id\n"; + + if ($dial_method == 'MANUAL') { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; } else { - $adlSQL = ""; - if ($auto_dial_level < 1) + if ($dial_level_override > 0) { - $auto_dial_level = "1.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' 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 "
- Espera 1 minuto antes de marcar el número siguiente\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - 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' 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 "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; - } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } $ADD=31; # go to campaign modification form below } @@ -7736,14 +9243,13 @@ if ($ADD==42) $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmtA, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } if (ereg('modify',$stage)) { @@ -7752,13 +9258,13 @@ if ($ADD==42) $stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -7795,13 +9301,13 @@ if ($ADD==43) $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Esito: $status|HotKey: $hotkey';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -7820,76 +9326,139 @@ $ADD=31; # go to campaign modification form below if ($ADD==44) { if ($LOGmodify_campaigns==1) - { - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - echo "
CAMPAÚA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - } - else - { - echo "
CAMPAGNA MODIFICATA: $campaign_id\n"; + echo ""; - if ($dial_method == 'RATIO') + if ($SSoutbound_autodial_active < 1) { - if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} - $adlSQL = "auto_dial_level='$auto_dial_level',"; + $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 = '8300'; + $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 "
ATTIVO LISTE CAMBIAMENTO"; + $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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTE', 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 ($dial_method == 'MANUAL') + + if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { - $auto_dial_level='0'; - $adlSQL = "auto_dial_level='0',"; + echo "
CAMPAÚA NO MODIFICADA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; } - else + else { - $adlSQL = ""; - if ($auto_dial_level < 1) + echo "
CAMPAGNA MODIFICATA: $campaign_id\n"; + + if ($dial_method == 'RATIO') { - $auto_dial_level = "1.0"; + 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='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', 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 "
- Espera 1 minuto antes de marcar el número siguiente\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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } } } - 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); - - if ($reset_hopper == 'Y') - { - echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } } - } - else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; - } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } $ADD=34; # go to campaign modification form below } @@ -7907,7 +9476,7 @@ if ($ADD==45) { echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos and less than 43200 seconds or 12 hours\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos e meno di 43200 secondi o 12 ore\n"; echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; } else @@ -7917,13 +9486,13 @@ if ($ADD==45) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -7949,7 +9518,7 @@ if ($ADD==47) { echo "
Co`DIGO DE LA PAUSA DEL AGENTE NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
pause_code must be between 1 and 6 characters in length\n"; - echo "
pause_code name must be between 2 and 30 characters in length\n"; + echo "
pause_nome in codice deve essere compreso tra 2 e 30 caratteri di lunghezza\n"; } else { @@ -7958,13 +9527,13 @@ if ($ADD==47) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -7980,16 +9549,15 @@ $ADD=31; # go to campaign modification form below ###################### # ADD=48 modify campaign QC settings in the system ###################### - if ($ADD==48) { - if ($LOGmodify_campaigns==1) + if ( ($LOGmodify_campaigns==1) and ($SSqc_features_active) ) { echo ""; if (strlen($campaign_id) < 2) { - echo "
QC SETTINGS NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
QC IMPOSTAZIONI NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n"; } else { @@ -8011,18 +9579,18 @@ if ($ADD==48) if (strlen($QC_statuses)>0) {$QC_statuses .= " -";} if (strlen($QC_lists)>0) {$QC_lists .= " -";} - echo "
QC SETTINGS MODIFIED: $campaign_id\n"; + echo "
IMPOSTAZIONI CQ MODIFICATI: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMP QC SETTING|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -8047,22 +9615,22 @@ if ($ADD=='40A') if (strlen($campaign_id) < 2) { - echo "
SURVEY SETTINGS NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
INDAGINE IMPOSTAZIONI NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n"; } else { - echo "
SURVEY SETTINGS MODIFIED: $campaign_id\n"; + echo "
INDAGINE SETTINGS MODIFICATI: $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' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMP SV SETTING|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -8105,22 +9673,22 @@ if ($ADD==49) if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) ) { - echo "
MIX LISTA NON MODIFICATO - Per favore torna indietro e ricontrolla i dati inseriti\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"; + echo "
MIX LISTA NON MODIFICATO - Per favore torna indietro e ricontrolla i dati inseriti\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA MODIFICATO: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -8148,13 +9716,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA MODIFICATO: $campaign_id - $vcl_id - $list_id\n"; } @@ -8221,13 +9789,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA MODIFICATO: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; } @@ -8259,13 +9827,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA LIST MIX', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA AGGIUNTO: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -8287,13 +9855,13 @@ if ($ADD==49) $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA CANCELLATO: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -8317,13 +9885,13 @@ if ($ADD==49) $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='Elenco Mix: $vcl_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); echo "
MIX LISTA ATTIVATO: $campaign_id - $vcl_id - $vcl_name\n"; } @@ -8361,19 +9929,27 @@ if ($ADD==411) $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate' 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='LISTE', 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 "
RESET ESITI CONTATTI DELLA LISTA CHIAMATI\n"; $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; $rslt=mysql_query($stmtB, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } + ### 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='LISTE', 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") { @@ -8381,14 +9957,6 @@ if ($ADD==411) $stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; $rslt=mysql_query($stmtC, $link); } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|$stmt|$stmtB|$stmtC|\n"); - fclose($fp); - } } } else @@ -8437,16 +10005,16 @@ if ($ADD==4111) echo "
GRUPPO MODIFICATO: $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' where group_id='$group_id';"; + $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' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -8471,23 +10039,23 @@ if ($ADD==4311) if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) ) { - echo "
DID NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
did_extension must be at least 1 character in length\n"; } else { - echo "
DID MODIFIED: $did_pattern\n"; + echo "
HA MODIFICATO: $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' where did_id='$did_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY DID INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -8522,13 +10090,13 @@ if ($ADD==41111) echo "
LOS AGENTES ALEJADOS SE MODIFICARON\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY OPERATORI REMOTI ENTRY |$PHP_AUTH_USER|$ip|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'|\n"); - fclose($fp); - } + ### 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 @@ -8566,17 +10134,98 @@ if ($ADD==411111) $GROUP_shifts .= "$group_shifts[$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' where user_group='$OLDuser_group';"; + $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' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
GRUPPO UTENTI MODIFICATO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + ### 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 Utente Group', 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) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + $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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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 + ###################################### } } } @@ -8612,13 +10261,13 @@ if ($ADD==4111111) echo "
SCRIPT MODIFICATO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SCRIPT', 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 @@ -8652,13 +10301,13 @@ if ($ADD==41111111) echo "
FILTRO MODIFICATO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='FILTRI', 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 @@ -8708,13 +10357,13 @@ if ($ADD==411111111) echo "
TIEMPO DE LA LLAMADA MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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 @@ -8764,13 +10413,13 @@ if ($ADD==4111111111) echo "
TIEMPO DE LA LLAMADA DEL ESTADO MODIFICADO\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } + ### 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 @@ -8796,9 +10445,9 @@ if ($ADD==431111111) 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 - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Shift ID and name must be at least 2 characters in length\n"; - echo "
Shift Start Time must be 4 digits in length and be a valid time\n"; - echo "
Shift Length must be 5 characters in length and be 24 hours or less\n"; + echo "
Maiusc ID e il nome deve essere di almeno 2 caratteri\n"; + echo "
Start Time Shift 4 cifre devono essere di lunghezza e da tempo una valida\n"; + echo "
Maiusc Lunghezza deve essere di 5 caratteri di lunghezza e di 24 ore o meno\n"; } else { @@ -8813,15 +10462,15 @@ if ($ADD==431111111) $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 "
SHIFT MODIFIED\n"; + echo "
SHIFT MODIFICATI\n"; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SHIFT ENTRY |$stmt|\n"); - fclose($fp); - } + ### 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 @@ -8856,16 +10505,19 @@ if ($ADD==41111111111) { echo "
TELEFONO MODIFICATO: $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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $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' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFICAR EL telefonO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $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 MODIFICAR EL telefonO', event_sql=\"$SQL_log\", event_notes='IP Server: $server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -8892,21 +10544,21 @@ if ($ADD==42111111111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) - {echo "
PHONE ALIAS NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n";} + {echo "
ALIAS TELEFONO NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - echo "
PHONE ALIAS MODIFIED: $alias_id\n"; + echo "
TELEFONO ALIAS MODIFICATI: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFICAR EL telefonOS ALIAS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 MODIFICA ALIAS TELEFONO', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } else @@ -8918,6 +10570,46 @@ $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 GRUPPO NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
GRUPPO ALIAS MODIFICATI: $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 MODIFICA GRUPPO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } +$ADD=33111111111; # go to group alias modification form below +} + + ###################### # ADD=411111111111 modify server record in the system ###################### @@ -8948,16 +10640,19 @@ if ($ADD==411111111111) { echo "
SERVER MODIFICATO: $server_ip\n"; - $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' where server_id='$old_server_id';"; + $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' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFICAR EL SERVIDOR |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $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='MODIFY', record_id='$server_id', event_code='ADMIN MODIFICAR EL SERVIDOR', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -9010,13 +10705,13 @@ if ($ADD==421111111111) $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFICAR EL SERVIDOR TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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='SERVERBauli', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN MODIFICAR EL SERVIDOR TRUNK', event_sql=\"$SQL_log\", event_notes='Campagna: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } @@ -9029,6 +10724,86 @@ $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 "
CONF TEMPLATE NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $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); + + ### 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 MODIFICA TEMPLATE CONF', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 "
VETTORE NON MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
VETTORE MODIFICATI: $carrier_id\n"; + + $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' 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); + + ### 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 MODIFICA DEL VETTORE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } +$ADD=341111111111; # go to carrier modification form below +} + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -9110,31 +10885,31 @@ $ADD=31111111111111; # go to vicidial conference modification form below ###################### if ($ADD==411111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo ""; - - echo "
IMPOSTAZIONI DI SISTEMA MODIFICATE\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';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM SETTINGS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo ""; + + echo "
IMPOSTAZIONI DI SISTEMA MODIFICATE\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';"; + $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 "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=311111111111111; # go to vicidial system settings form below } -$ADD=311111111111111; # go to vicidial system settings form below -} ###################### @@ -9142,70 +10917,70 @@ $ADD=311111111111111; # go to vicidial system settings form below ###################### 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 ""; + + if (ereg('delete',$stage)) { - echo "
ESITO DI DEFAULT NON ELIMINATO - Per favore torna indietro e ricontrolla i dati inseriti\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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); + echo "
ESITO DI DEFAULT NON ELIMINATO - Per favore torna indietro e ricontrolla i dati inseriti\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='SYSTEMSTATUSES', 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 "
ESITO DI DEFAULT NON MODIFICATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; + echo "
il nome di un esito di default deve essere lungo almeno 1 carattere\n"; + } + else + { + echo "
ESITO DI DEFAULT MODIFICATO: $status\n"; + + $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' 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='SYSTEMSTATUSES', 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); } } } - if (ereg('modify',$stage)) - { - if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
ESITO DI DEFAULT NON MODIFICATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el estado de sistema necesita ser por lo menos los caracteres 1 enlongitud\n"; - echo "
il nome di un esito di default deve essere lungo almeno 1 carattere\n"; - } - else - { - echo "
ESITO DI DEFAULT MODIFICATO: $status\n"; - - $stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category' where status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SYSTEM STATUS |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=321111111111111; # go to system settings modification form below } -$ADD=321111111111111; # go to system settings modification form below -} ###################### @@ -9213,67 +10988,67 @@ $ADD=321111111111111; # go to system settings modification form below ###################### if ($ADD==431111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo ""; + { + echo ""; - if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) - { - echo "
CATEGORIA ESITI NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
la categoria di esiti non puo` essere una categoria riservata: UNDEFINED\n"; - echo "
il nome delle categorie di esiti deve essere lungo almeno 2 caratteri\n"; - } - else - { - if (ereg('delete',$stage)) + if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) { - echo "
CATEGORIA ESISI CANCELLATA: $vsc_id\n"; - - $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + echo "
CATEGORIA ESITI NON MODIFICATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
la categoria di esiti non puo` essere una categoria riservata: UNDEFINED\n"; + echo "
il nome delle categorie di esiti deve essere lungo almeno 2 caratteri\n"; } - if (ereg('modify',$stage)) + else { - echo "
CATEGORIA ESITI MODIFICATA: $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)) ) + if (ereg('delete',$stage)) { - $tovdad_display = 'N'; - echo "
ERRORE: Ci sono gia` 4 Categorie di Stato attivi nel display TimeOnVDAD\n"; + echo "
CATEGORIA ESISI CANCELLATA: $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); } - - $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (ereg('modify',$stage)) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATUS CATEGORY|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
CATEGORIA ESITI MODIFICATA: $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 "
ERRORE: Ci sono gia` 4 Categorie di Stato attivi nel display 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 "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=331111111111111; # go to system settings modification form below } -$ADD=331111111111111; # go to system settings modification form below -} ###################### @@ -9282,7 +11057,7 @@ $ADD=331111111111111; # go to system settings modification form below if ($ADD==441111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { echo ""; @@ -9290,48 +11065,48 @@ if ($ADD==441111111111111) { if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) { - echo "
QC STATUS CODE NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
QC CODICE STATO NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
the qc status code cannot be a reserved esito: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; - echo "
the qc status code needs to be at least 1 characters in length\n"; + echo "
qc il codice di stato deve essere di almeno 1 caratteri di lunghezza\n"; } else { - echo "
QC STATUS CODE DELETED: $code\n"; + echo "
QC STATUS CODICE DELETED:$code\n"; $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE QC STATUS CODE |$PHP_AUTH_USER|$ip|$stmt|$stmtA|\n"); - fclose($fp); - } + ### 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 "
QC STATUS CODE NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
the qc status code needs to be at least 1 characters in length\n"; - echo "
the qc status code name needs to be at least 1 characters in length\n"; + echo "
QC CODICE STATO NON MODIFICATI- Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
qc il codice di stato deve essere di almeno 1 caratteri di lunghezza\n"; + echo "
qc stato il nome in codice deve essere di almeno 1 caratteri di lunghezza\n"; } else { - echo "
QC STATUS CODE MODIFIED: $code\n"; + echo "
QC CODICE STATO MODIFICATO:$code\n"; $stmt="UPDATE vicidial_qc_codes SET code_name='$code_name' where code='$code';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY QC STATUS CODE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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); } } } @@ -9364,7 +11139,7 @@ if ($ADD==5) if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) { echo "
UTENTE NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Utente be at least 2 characters in length\n"; } else { @@ -9501,13 +11276,13 @@ if ($ADD==5311) if ( (strlen($did_id) < 1) or ($LOGdelete_dids < 1) ) { - echo "
DID NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
NON HA ELIMINATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
did_id be at least 1 characters in length\n"; } else { - echo "
DID DELETION CONFIRMATION: $group_id\n"; - echo "

Click here to delete DID $did_id


\n"; + echo "
LO CONFERMA ELIMINAZIONE: $group_id\n"; + echo "

Clicca qui per cancellareDID $did_id


\n"; } $ADD='3311'; # go to did modification below @@ -9546,7 +11321,7 @@ if ($ADD==511111) if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) { echo "
GRUPO DE USUARIO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
Utente_group be at least 2 characters in length\n"; } else { @@ -9617,7 +11392,7 @@ if ($ADD==511111111) else { echo "
CONFIRMACIo`N DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; + echo "

Clicca qui per cancellarecall time $call_time_id


\n"; } $ADD='311111111'; # go to call time modification below @@ -9639,7 +11414,7 @@ if ($ADD==5111111111) else { echo "
CONFIRMACIo`N DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; + echo "

Clicca qui per cancellarestate call time $call_time_id


\n"; } $ADD='3111111111'; # go to state call time modification below @@ -9655,13 +11430,13 @@ if ($ADD==531111111) if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
SHIFT NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
SHIFT non eliminati - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
Shift ID must be at least 2 characters in length\n"; } else { - echo "
SHIFT DELETION CONFIRMATION: $shift_id\n"; - echo "

Click here to delete shift $shift_id


\n"; + echo "
SHIFT DELETION CONFERMA:$shift_id\n"; + echo "

Clicca qui per cancellare turno $shift_id


\n"; } $ADD='331111111'; # go to call time modification below @@ -9700,18 +11475,40 @@ if ($ADD==52111111111) if ( (strlen($alias_id) < 1) or ($LOGast_delete_phones < 1) ) { - echo "
PHONE ALIAS NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
ALIAS TELEFONO NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
Alias ID must be at least 2 characters in length\n"; } else { - echo "
PHONE ALIAS DELETION CONFIRMATION: $alias_id\n"; - echo "

Clicca qui per cancellare il telefono alias $alias_id


\n"; + echo "
TELEFONO ALIAS CONFERMA ELIMINAZIONE: $alias_id\n"; + echo "

Clicca qui per cancellare telefono alias $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 GRUPPO NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Gruppo Alias ID must be at least 2 characters in length\n"; + } + else + { + echo "
ALIAS GRUPPO CONFERMA ELIMINAZIONE: $group_alias_id\n"; + echo "

Clicca qui per eliminare gruppo alias $group_alias_id


\n"; + } +$ADD='33111111111'; # go to group alias modification below +} + + ###################### # ADD=511111111111 confirmation before deletion of server record ###################### @@ -9735,6 +11532,50 @@ $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 "
CONF TEMPLATE NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Template ID essere almeno 2 caratteri\n"; + } + else + { + echo "
CONF TEMPLATE CONFERMA ELIMINAZIONE: $template_id - $template_name\n"; + echo "

Clicca qui per cancellare conf modello $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 "
Vettore non DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Vettore ID essere almeno 2 caratteri\n"; + } + else + { + echo "
CONFERMA ELIMINAZIONE DEL VETTORE: $carrier_id - $carrier_name\n"; + echo "

Clicca qui per cancellare vettore $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier modification below +} + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -9794,15 +11635,15 @@ $ADD='31111111111111'; # go to vicidial conference modification below ###################### if ($ADD==6) -{ + { echo ""; - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) + if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) { echo "
UTENTE NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
User be at least 2 characters in length\n"; + echo "
Utente be at least 2 characters in length\n"; } - else + else { $stmtA="DELETE from vicidial_users where user='$user' limit 1;"; $rslt=mysql_query($stmtA, $link); @@ -9813,37 +11654,38 @@ if ($ADD==6) $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|$user|$stmtA|$stmt|\n"); - fclose($fp); - } + ### 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='USERS', 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 "
CANCELADURA DEL USUARIO TERMINADA: $user\n"; echo "

\n"; } -$ADD='0'; # go to user list -} + $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) ) + if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) { echo "
CAMPAGNA NON CANCELLATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; echo "
Campagna_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -9882,58 +11724,60 @@ if ($ADD==61) $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } + ### 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='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
LA CANCELADURA DE LA CAMPAÑA TERMINo`: $campaign_id\n"; echo "

\n"; } -$ADD='10'; # go to campaigns list -} + $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 "
OPERATORI NON DISCONNESSI DALLA CAMPAGNA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Campagna_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENT LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
OPERATORI NON DISCONNESSI DALLA CAMPAGNA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Campagna_id be at least 2 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_live_agents 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='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
DISCONNESSIONE OPERATORI COMPLETATA: $campaign_id\n"; + echo "

\n"; } - echo "
DISCONNESSIONE OPERATORI COMPLETATA: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD='31'; # go to campaign modification below } -$ADD='31'; # go to campaign modification below -} ###################### @@ -9941,45 +11785,46 @@ $ADD='31'; # go to campaign modification below ###################### if ($ADD==63) -{ + { if ($LOGmodify_campaigns==1) - { - if (eregi('IN',$stage)) - {$group_id=$campaign_id;} - echo ""; - - if (strlen($campaign_id) < 2) { - echo "
VDAC NO DESPEJo` PARA LA CAMPAÑA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Campagna_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); + if (eregi('IN',$stage)) + {$group_id=$campaign_id;} + echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($campaign_id) < 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|EMERGENCY VDAC CLEAR|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); + echo "
VDAC NO DESPEJo` PARA LA CAMPAÑA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Campagna_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='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
DE REGISTRO PASADO DE VDAC DESPEJADA PARA LA CAMPAÑA: $campaign_id\n"; + echo "

\n"; } - echo "
DE REGISTRO PASADO DE VDAC DESPEJADA PARA LA CAMPAÑA: $campaign_id\n"; - echo "

\n"; } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + # go to campaign modification below + if (eregi('IN',$stage)) + {$ADD='3111';} + else + {$ADD='31';} } -# go to campaign modification below -if (eregi('IN',$stage)) - {$ADD='3111';} -else - {$ADD='31';} -} ###################### @@ -9987,42 +11832,42 @@ else ###################### if ($ADD==65) -{ - if ($LOGmodify_campaigns==1) { - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) + if ($LOGmodify_campaigns==1) { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; - echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; - } - else - { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $campaign_id - $status - $attempt_delay\n"; + echo ""; - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
EL PLOMO DE LA CAMPAÑA RECICLA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; + echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; + } + else + { + echo "
EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $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='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $SUB=25; + $ADD=31; # go to campaign modification form below } -$SUB=25; -$ADD=31; # go to campaign modification form below -} ###################### @@ -10030,92 +11875,92 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - este estado del dial del alt del automo`vil no está en esta campaña\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - este estado del dial del alt del automo`vil no está en esta campaña\n";} + else { - echo "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - } - else - { - echo "
ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AUTALTDIALSTTUS|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ESTADO AUTO DEL DIAL DEL ALT NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + } + else + { + echo "
ESTADO AUTO DEL DIAL DEL ALT SUPRIMIDO: $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='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $SUB=26; + $ADD=31; # go to campaign modification form below } -$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) ) + if ($LOGmodify_campaigns==1) { - echo "
Co`DIGO DE LA PAUSA DE LA CAMPAÑA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
pause code must be between 1 and 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code\n"; + echo ""; - $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
Co`DIGO DE LA PAUSA DE LA CAMPAÑA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
pause code must be between 1 and 6 characters in length\n"; + } + else + { + echo "
CAMPAIGN 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='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Esito: $pause_code';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $SUB=27; + $ADD=31; # go to campaign modification form below } -$SUB=27; -$ADD=31; # go to campaign modification form below -} ###################### @@ -10123,67 +11968,67 @@ $ADD=31; # go to campaign modification form below ###################### 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 "
ESITO CAMPAGNA NON RIMOSSO - questo esito di chiamata non e` selezionato per questa campagna\n";} - else + if ($LOGmodify_campaigns==1) { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 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 "
ESITO CAMPAGNA NON RIMOSSO - questo esito di chiamata non e` selezionato per questa campagna\n";} + else { - echo "
ESITO CAMPAGNA NON RIMOSSO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - } - else - { - echo "
ESITO CAMPAGNA RIMOSSO: $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 CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DIAL STATUS REMOVED |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); + echo "
ESITO CAMPAGNA NON RIMOSSO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; + } + else + { + echo "
ESITO CAMPAGNA RIMOSSO: $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='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Esito: $status';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } } } - } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + #$SUB=28; + $ADD=31; # go to campaign modification form below } -#$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) ) + if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) { - echo "
LISTA NON CANCELLATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
List_id be at least 2 characters in length\n"; + echo "
LISTA NON CANCELLATA - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
List_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; $rslt=mysql_query($stmt, $link); @@ -10196,37 +12041,38 @@ if ($ADD==611) $stmt="DELETE from vicidial_list where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } + ### 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='LISTE', 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 "
LA CANCELADURA DE LA LISTA TERMINo`: $list_id\n"; echo "

\n"; } -$ADD='100'; # go to lists list -} + $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) ) + if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) { - echo "
GRUPPO INBOUND NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Group_id be at least 2 characters in length\n"; + echo "
GRUPPO INBOUND NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Group_id be at least 2 characters in length\n"; } - else + else { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -10237,147 +12083,152 @@ if ($ADD==6111) $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } + ### 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 "
ELIMINAZIONE GRUPPO INBOUND COMPLETATA: $group_id\n"; echo "

\n"; } -$ADD='1000'; # go to in-group list -} + $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) ) + if ( (strlen($did_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { - echo "
DID NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
did_id be at least 1 characters in length\n"; + echo "
NON HA ELIMINATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
did_id be at least 1 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING DID!!!!!!!|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - echo "
DID DELETION COMPLETED: $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='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 "
DELETION HA COMPIUTO: $did_id\n"; echo "

\n"; } -$ADD='1300'; # go to did list -} + $ADD='1300'; # go to did 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) ) + if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { - echo "
AGENTE ALEJADO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; + echo "
AGENTE ALEJADO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Remote_agent_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } + ### 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 "
CANCELADURA ALEJADA DEL AGENTE TERMINADA: $remote_agent_id\n"; echo "

\n"; } -$ADD='10000'; # go to remote agents list -} + $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) ) + if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) { - echo "
GRUPO DE USUARIO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
User_group be at least 2 characters in length\n"; + echo "
GRUPO DE USUARIO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Utente_group be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } + ### 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 Utente Group', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; echo "

\n"; } -$ADD='100000'; # go to user group list -} + $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) ) + if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) { - echo "
SCRIPT NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Script_id be at least 2 characters in length\n"; + echo "
SCRIPT NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Script_id be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } + ### 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='SCRIPT', 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 "
CANCELADURA DE LA ESCRITURA TERMINADA: $script_id\n"; echo "

\n"; } -$ADD='1000000'; # go to script list -} + $ADD='1000000'; # go to script list + } ###################### @@ -10385,32 +12236,33 @@ $ADD='1000000'; # go to script list ###################### if ($ADD==61111111) -{ + { echo ""; - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) + if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) { - echo "
FILTRO NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
ID Filtro deve essere lungo almeno 2 caratteri\n"; + echo "
FILTRO NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
ID Filtro deve essere lungo almeno 2 caratteri\n"; } - else + else { $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } + ### 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='FILTRI', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE FILTRI', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + echo "
CANCELLAZIONE FILTRO COMPLETATA: $lead_filter_id\n"; echo "

\n"; } -$ADD='10000000'; # go to filter list -} + $ADD='10000000'; # go to filter list + } ###################### @@ -10418,32 +12270,33 @@ $ADD='10000000'; # go to filter list ###################### if ($ADD==611111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
_ llamar tiempo identificacio`n deber ser por lo menos 2 carácter enlongitud\n"; + echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
_ llamar tiempo identificacio`n deber ser por lo menos 2 carácter enlongitud\n"; } - else + else { $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 "
_ LLAMAR TIEMPO CANCELADURA TERMINAR: $call_time_id\n"; echo "

\n"; } -$ADD='100000000'; # go to call times list -} + $ADD='100000000'; # go to call times list + } ###################### @@ -10451,18 +12304,18 @@ $ADD='100000000'; # go to call times list ###################### if ($ADD==6111111111) -{ + { echo ""; - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
_ llamar tiempo identificacio`n deber ser por lo menos 2 carácter enlongitud\n"; + echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
_ llamar tiempo identificacio`n deber ser por lo menos 2 carácter enlongitud\n"; } - else + else { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); + $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); @@ -10470,36 +12323,38 @@ if ($ADD==6111111111) $sct_list=''; $o=0; - while ($sct_to_print > $o) { + 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) { + 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 "Regla Del Estado Quitada: $sct_ids[$o]
\n"; $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); } + + ### 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 "
CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO TERMINADA: $call_time_id\n"; echo "

\n"; } -$ADD='1000000000'; # go to call times list -} + $ADD='1000000000'; # go to call times list + } ###################### @@ -10507,32 +12362,33 @@ $ADD='1000000000'; # go to call times list ###################### if ($ADD==631111111) -{ + { echo ""; - if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) + if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) { - echo "
SHIFT NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Shift ID must be at least 2 characters in length\n"; + echo "
SHIFT non eliminati - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Shift ID must be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SHIFT!!!!!|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - echo "
SHIFT DELETION COMPLETED: $shift_id\n"; + ### 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 "
SHIFT DELETION Completato: $shift_id\n"; echo "

\n"; } -$ADD='130000000'; # go to shifts list -} + $ADD='130000000'; # go to shifts list + } ###################### @@ -10540,32 +12396,33 @@ $ADD='130000000'; # go to shifts list ###################### if ($ADD==61111111111) -{ + { echo ""; - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
TELEFONO NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Server be at least 7 characters in length\n"; + echo "
TELEFONO NON CANCELLATO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Extension be at least 2 characters in length\n"; + echo "
IP Server be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + ### 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 "
LA CANCELADURA DEL telefonO TERMINo`: $extension - $server_ip\n"; echo "

\n"; } -$ADD='10000000000'; # go to phone list -} + $ADD='10000000000'; # go to phone list + } ###################### @@ -10573,31 +12430,65 @@ $ADD='10000000000'; # go to phone list ###################### if ($ADD==62111111111) -{ + { echo ""; - if ( (strlen($alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
PHONE ALIAS NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Alias ID must be at least 2 characters in length\n"; + echo "
ALIAS TELEFONO NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Alias ID must be at least 2 characters in length\n"; } - else + else { $stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETE PHONE ALIAS!|$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - echo "
PHONE ALIAS DELETION COMPLETED: $alias_id\n"; + ### 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 DELETE TELEFONO ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
TELEFONO ALIAS DELETION COMPIUTI: $alias_id\n"; echo "

\n"; } -$ADD='12000000000'; # go to phone alias list -} + $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 GRUPPO NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Gruppo Alias ID 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 Elimina gruppo ALIAS', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
GRUPPO ALIAS DELETION COMPIUTI: $group_alias_id\n"; + echo "

\n"; + } + $ADD='13000000000'; # go to group alias list + } ###################### @@ -10605,32 +12496,33 @@ $ADD='12000000000'; # go to phone alias list ###################### if ($ADD==611111111111) -{ + { echo ""; - if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
SERVER NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
ID Server be at least 2 characters in length\n"; - echo "
IP Server be at least 7 characters in length\n"; + echo "
SERVER NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
ID Server be at least 2 characters in length\n"; + echo "
IP Server be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING SERVER!!|$PHP_AUTH_USER|$ip|server_id='$server_id'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 "
SERVER DELETION COMPLETED: $server_id - $server_ip\n"; echo "

\n"; } -$ADD='100000000000'; # go to server list -} + $ADD='100000000000'; # go to server list + } ###################### @@ -10638,40 +12530,123 @@ $ADD='100000000000'; # go to server list ###################### if ($ADD==621111111111) -{ + { if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + { + echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
la campaña debe estar entre 3 y 8 caracteres en longitud\n"; + echo "
el server_ip retrasa debe ser por lo menos 7 caracteres\n"; + } + else + { + echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL SUPRIMIDO: $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='SERVERBauli', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE SERVER TRUNK', event_sql=\"$SQL_log\", event_notes='Campagna: $campaign_id';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=311111111111; # go to server modification form below + } + + +###################### +# ADD=631111111111 delete conf template record +###################### + +if ($ADD==631111111111) { echo ""; - if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { - echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL NO SUPRIMIDO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
la campaña debe estar entre 3 y 8 caracteres en longitud\n"; - echo "
el server_ip retrasa debe ser por lo menos 7 caracteres\n"; + echo "
CONF TEMPLATE NON DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Template ID essere almeno 2 caratteri\n"; } - else + else { - echo "
EXPEDIENTE DEL TRONCO DEL SERVIDOR DE VICIDIAL SUPRIMIDO: $campaign_id - $server_ip\n"; - - $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; + $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); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE SERVER TRUNK |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } + $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 CANC CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
CONF TEMPLATE DELETION COMPIUTI: $server_id - $server_ip\n"; + echo "

\n"; } + $ADD='130000000000'; # go to conf template list } - else + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
Vettore non DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Vettore ID essere almeno 2 caratteri\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 CANC VETTORE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
VETTORE DELETION COMPIUTI: $carrier_id\n"; + echo "

\n"; + } + $ADD='140000000000'; # go to carrier list } -$ADD=311111111111; # go to server modification form below -} ###################### @@ -10679,32 +12654,33 @@ $ADD=311111111111; # go to server modification form below ###################### if ($ADD==6111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
CONFERENCE NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Server be at least 7 characters in length\n"; + echo "
CONFERENCE NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Server be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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='1000000000000'; # go to conference list + } ###################### @@ -10712,32 +12688,33 @@ $ADD='1000000000000'; # go to conference list ###################### if ($ADD==61111111111111) -{ + { echo ""; - if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) + if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { - echo "
VICIDIAL CONFERENCE NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
Conference be at least 2 characters in length\n"; - echo "
IP Server be at least 7 characters in length\n"; + echo "
VICIDIAL CONFERENCE NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
Conference be at least 2 characters in length\n"; + echo "
IP Server be at least 7 characters in length\n"; } - else + else { $stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;"; $rslt=mysql_query($stmt, $link); - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING CONF!!!!|$PHP_AUTH_USER|$ip|conf_exten='$conf_exten'|server_ip='$server_ip'|\n"); - fclose($fp); - } + ### 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 -} + $ADD='10000000000000'; # go to vicidial conference list + } @@ -10819,7 +12796,12 @@ if ($ADD==3) $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]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -10868,6 +12850,7 @@ if ($ADD==3) echo "$NWB#vicidial_users-user_group$NWE
Login Telefono: $NWB#vicidial_users-phone_login$NWE
Password Telefono: $NWB#vicidial_users-phone_pass$NWE
Attivo: $NWB#vicidial_users-active$NWE
Chiamata Manuale Operatore: $NWB#vicidial_users-agentcall_manual$NWE
Registrazione Vicidial: $NWB#vicidial_users-vicidial_recording$NWE
Trasferimenti Vicidial: $NWB#vicidial_users-vicidial_transfers$NWE
Un Defecto Más cercano Mezclado: $NWB#vicidial_users-closer_default_blended$NWE
Un Defecto Más cercano Mezclado: $NWB#vicidial_users-closer_default_blended$NWE
Invalidacio`n De la grabacion de VICIDIAL:$NWB#vicidial_users-vicidial_recording_override$NWE
El Agente Altera La Invalidacio`n De los Datos Del Cliente: $NWB#vicidial_users-alter_custdata_override$NWE
Agent Alter Customer Phone Override: $NWB#vicidial_users-alter_custphone_override$NWE
Agente Alter clienti Sovrascrive Telefono:$NWB#vicidial_users-alter_custphone_override$NWE
Agente Maiusc esecuzione Sovrascrive: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Alert Attivato: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Classifiche Campagna:$NWB#vicidial_users-campaign_ranks$NWE
\n"; echo "\n"; echo "$RANKcampaigns_list"; @@ -10893,11 +12884,14 @@ if ($ADD==3) echo "$RANKgroups_list"; echo "
\n"; echo "
QC Enabled: $NWB#vicidial_users-qc_enabled$NWE
QC Livello Utente: $NWB#vicidial_users-qc_user_level$NWE
QC Pass: $NWB#vicidial_users-qc_pass$NWE
QC Finish: $NWB#vicidial_users-qc_finish$NWE
QC Commit: $NWB#vicidial_users-qc_commit$NWE
QC Enabled:$NWB#vicidial_users-qc_enabled$NWE
QC Utente Livello:$NWB#vicidial_users-qc_user_level$NWE
QC Pass:$NWB#vicidial_users-qc_pass$NWE
QC Fine:$NWB#vicidial_users-qc_finish$NWE
QC Impegni:$NWB#vicidial_users-qc_commit$NWE
Cancella Liste: $NWB#vicidial_users-delete_lists$NWE
Carica Contatti: $NWB#vicidial_users-load_leads$NWE
Modifica Contatti: $NWB#vicidial_users-modify_leads$NWE
Download liste: $NWB#vicidial_users-modify_leads$NWE
Rapporti Export: $NWB#vicidial_users-export_reports$NWE
Modifica Campagne: $NWB#vicidial_users-modify_sections$NWE
Dettagli Campagna: $NWB#vicidial_users-campaign_detail$NWE
Modifica Gruppi Inbound: $NWB#vicidial_users-modify_sections$NWE
En-Grupos de la cancelacio`n: $NWB#vicidial_users-delete_ingroups$NWE
Modify DIDs: $NWB#vicidial_users-modify_sections$NWE
Delete DIDs: $NWB#vicidial_users-delete_ingroups$NWE
Modificare DIDs:$NWB#vicidial_users-modify_sections$NWE
Elimina DIDs:$NWB#vicidial_users-delete_ingroups$NWE
Modifica Operatori Remoti: $NWB#vicidial_users-modify_sections$NWE
Suprima los agentes alejados: $NWB#vicidial_users-delete_remote_agents$NWE
Modifica Script: $NWB#vicidial_users-modify_sections$NWE
Cancella Script: $NWB#vicidial_users-delete_scripts$NWE
Modifica Filtri: $NWB#vicidial_users-modify_sections$NWE
Cancella Filtros: $NWB#vicidial_users-delete_filters$NWE
Modifica Filtri: $NWB#vicidial_users-modify_sections$NWE
Cancella Filtros: $NWB#vicidial_users-delete_filters$NWE
Acceso de AGC Admin: $NWB#vicidial_users-ast_admin_access$NWE
La cancelacio`n de AGC telefona: $NWB#vicidial_users-ast_delete_phones$NWE
Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
Delete Orari Chiamata: $NWB#vicidial_users-delete_call_times$NWE
EliminareOrari Chiamata: $NWB#vicidial_users-delete_call_times$NWE
Modifica Server: $NWB#vicidial_users-modify_sections$NWE
Agent API Access: $NWB#vicidial_users-vdc_agent_api_access$NWE
Agente API Accesso:$NWB#vicidial_users-vdc_agent_api_access$NWE
Aggiungi orologio Entra record: $NWB#vicidial_users-add_timeclock_log$NWE
Modificare orologio Entra record: $NWB#vicidial_users-modify_timeclock_log$NWE
Elimina orologio Entra record: $NWB#vicidial_users-delete_timeclock_log$NWE
Shift Manager esecuzione Sovrascrive: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
Add Timeclock Log Record: $NWB#vicidial_users-add_timeclock_log$NWE
Modify Timeclock Log Record: $NWB#vicidial_users-modify_timeclock_log$NWE
Delete Timeclock Log Record: $NWB#vicidial_users-delete_timeclock_log$NWE
\n"; @@ -10959,7 +12960,12 @@ if ($ADD==3) echo "

Clicca qui per la tabella degli orari dell`utente\n"; echo "

Clicca qui per visualizzare lo stato dell`utente\n"; echo "

Clicca qui per le statistiche dell`utente\n"; + echo "

Clicca qui per lutente più giorni status dettaglio relazione\n"; echo "

Clicca qui per i richiami dell`utente\n"; + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo record
\n"; + } } } else @@ -10994,6 +13000,12 @@ if ($ADD==31) $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 * from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -11004,7 +13016,7 @@ if ($ADD==31) $dial_status_d = $row[6]; $dial_status_e = $row[7]; $lead_order = $row[8]; - $web_form_address = $row[11]; + $web_form_address = stripslashes($row[11]); $allow_closers = $row[12]; $hopper_level = $row[13]; $auto_dial_level = $row[14]; @@ -11070,7 +13082,7 @@ if ($ADD==31) $qc_shift_id = $row[74]; $qc_get_record_launch = $row[75]; $qc_show_recording = $row[76]; - $qc_web_form_address = $row[77]; + $qc_web_form_address = stripslashes($row[77]); $qc_script = $row[78]; $survey_first_audio_file = $row[79]; $survey_dtmf_digits = $row[80]; @@ -11091,6 +13103,14 @@ if ($ADD==31) $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]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -11212,7 +13232,8 @@ if ($ADD==31) } ##### get in-groups listings for dynamic drop in-group pulldown - $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; + $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); $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; @@ -11285,12 +13306,23 @@ if ($ADD==31) echo "
Dettagliata EsitiHot-KeyRiciclaggio ContattiChiama Auto Num AlternRiciclaggio ContattiChiama Auto Num AlternElenco MixIndagineCodici PausaQCList MixSurveyQC Real-Time
\n"; @@ -11308,131 +13340,136 @@ if ($ADD==31) echo "
ID Campagna: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE
Campagna Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagna Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campagna Cambia Data: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Attivo: $NWB#vicidial_campaigns-active$NWE
Extension del parking: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Web Form Target: $NWB#vicidial_campaigns-web_form_target$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Permita de entrada y mezclado:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Permita de entrada y mezclado:$NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Esito Chiamata $o: \n"; - - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Esito Chiamata $o: \n"; + + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Aggiungi Un Esito Chiamata:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
Elenco Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Metodo Chiamata: $NWB#vicidial_campaigns-dial_method$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       FORZA LIVELLO ANCHE CON MODALITA` ADAPT
Conta Solo Disponibili: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Limita Percentuale Abbattuti:
Livello Auto-Dial Massimo In Modalita` Adapt: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Ultimo Orario Chiamate: 4 solo cifre $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Modifica Intensita` Adapt Auto-Dial: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Blanco Llana De la Diferencia Del Dial: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Coda di priorità: $NWB#vicidial_campaigns-queue_priority$NWE
El Marcar Auto Del Alt-Nu`mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Aggiungi Un Esito Chiamata:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Metodo Chiamata: $NWB#vicidial_campaigns-dial_method$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE       FORZA LIVELLO ANCHE CON MODALITA` ADAPT
Conta Solo Disponibili: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Limita Percentuale Abbattuti: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Livello Auto-Dial Massimo In Modalita` Adapt: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Ultimo Orario Chiamate: 4 solo cifre $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Modifica Intensita` Adapt Auto-Dial: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Blanco Llana De la Diferencia Del Dial: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Transferencias Concurrentes: $NWB#vicidial_campaigns-concurrent_transfers$NWE
Queue Priority: $NWB#vicidial_campaigns-queue_priority$NWE
El Marcar Auto Del Alt-Nu`mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_campaigns-next_agent_call$NWE
Orario Chiamate: $NWB#vicidial_campaigns-local_call_time$NWE
Timeout Chiamata: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Timeout Chiamata: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Prefisso Chiamata: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Ometti Prefisso Telefono: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID della Campagna: $NWB#vicidial_campaigns-campaign_cid$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Interno Registrazioni Per Questa Campagna: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Registrazioni Per Questa Campagna: $NWB#vicidial_campaigns-campaign_recording$NWE
Messaggio Segreteria Telefonica: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD envían a la VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
AMD envían a la VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
CPD AMD Azione: $NWB#vicidial_campaigns-cpd_amd_action$NWE
Transfiera -Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
El Marcar Del Número Del Alt: $NWB#vicidial_campaigns-alt_number_dialing$NWE
El Marcar Del Número Del Alt: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Secondi Abbattimento Telefonata: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Secondi Abbattimento Telefonata: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Drop Action: $NWB#vicidial_campaigns-drop_action$NWE
Goccia dazione:$NWB#vicidial_campaigns-drop_action$NWE
Interno Messaggio Telefonata Abbattuta: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Interno Messaggio Telefonata Abbattuta: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Casella Vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Drop Transfer Gruppo: $NWB#vicidial_campaigns-drop_inbound_group$NWE
Casella Vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
Trasferimento Drop Group:$NWB#vicidial_campaigns-drop_inbound_group$NWE
Secondi Riposo Operatore: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Messaggio Riposo Operatore: $NWB#vicidial_campaigns-wrapup_message$NWE
Controlla In Lista Contatti Da NON CHIAMARE: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Use Campagna DNC List: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
Usa campagna DNC Elenco: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
AgentCodici PausaAttivo: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Aggiornamento Statistiche Campagna: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Disabilita modifica dati clienti: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
Disable Alter Customer Phone: $NWB#vicidial_campaigns-disable_alter_custphone$NWE
Disattiva Alter Clienti Telefono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Abilita Login Senza Contatti Da Chiamare: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Agent Display Queue Count: $NWB#vicidial_campaigns-display_queue_count$NWE
Abilita Login Senza Contatti Da Chiamare: $NWB#vicidial_campaigns-no_hopper_leads_logins$NWE
Agente Mostra Coda Count:$NWB#vicidial_campaigns-display_queue_count$NWE
ID Lista Chiamate Manuali:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manual Dial Filter: $NWB#vicidial_campaigns-manual_dial_filter$NWE
Manuale Dial Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Agent Screen Clipboard Copy: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Appunti di agente Schermata Copia: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agent Screen Extended Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Way Call CallerID De salida: $NWB#vicidial_campaigns-three_way_call_cid$NWE
Agente Screen estensione Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Way chiamate in uscita CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Way Call Prefisso Chiamata: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Gruppo Alias ammessi: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
Predefinito Gruppo Alias: $NWB#vicidial_campaigns-default_group_alias$NWE
Vtiger Ricerca Categoria: $NWB#vicidial_campaigns-vtiger_search_category$NWE
Vtiger Crea chiamate record: $NWB#vicidial_campaigns-vtiger_create_call_record$NWE
Vtiger Crea Piombo record: $NWB#vicidial_campaigns-vtiger_create_lead_record$NWE
Vtiger Screen accesso: $NWB#vicidial_campaigns-vtiger_screen_login$NWE
\n"; echo "
\n"; - echo "
LISTE IN QUESTA CAMPAGNA:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $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=''; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + if ($SSoutbound_autodial_active > 0) + { + echo "
LISTE IN QUESTA CAMPAGNA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID LISTANOME LISTAATTIVO
\n"; - } - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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=0; - while ($lists_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "
ID LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVODATA ULTIMA CHIAMATAMODIFICA
$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]MODIFICA

\n"; - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; echo "
\n"; $filterSQL = $filtersql_list[$lead_filter_id]; @@ -11600,22 +13755,23 @@ if ($ADD==31) echo " - MOSTRA

"; } - - - - - $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]"; + $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 "Questa campagna ha $hopper_leads contatti nella coda chiamate

\n"; echo "Clicca qui per vedere quali numeri sono nella coda chiamate in questo momento

\n"; - echo "Clicca qui per visualizzare tutti i richiami in attesa per questa campagna

\n"; echo "Clicca qui per vedere il report VDAD per questa campagna

\n"; - echo "
\n"; } + echo "Clicca qui per visualizzare tutti i richiami in attesa per questa campagna

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

Clicca qui per visualizzare Admin chages a questa campagna
\n"; + } + echo "\n"; + } ##### CAMPAIGN CUSTOM STATUSES ##### @@ -11793,7 +13949,7 @@ if ($ADD==31) echo "

CONTATTI DA RICICLARE IN QUESTA CAMPAGNA:   $NWB#vicidial_lead_recycle$NWE
\n"; echo "\n"; - echo "\n"; + echo "\n"; while ($recycle_to_print > $o) { @@ -11844,7 +14000,7 @@ if ($ADD==31) echo "
\n"; echo "
\n"; - echo "* Lead counts taken from active lists in the campaign only.\n"; + echo "* Piombo conta prese da elenchi attiva nella campagna solo.\n"; } ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### @@ -11928,7 +14084,7 @@ if ($ADD==31) } ##### CAMPAIGN QC SETTINGS ##### - if ($SUB==28) + 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); @@ -11981,27 +14137,27 @@ if ($ADD==31) $o++; } - echo "

QC SETTINGS FOR THIS CAMPAIGN:
\n"; + echo "

IMPOSTAZIONI CQ per questa campagna:
\n"; echo "
ESITORITARDO NUOVO TENTATIVOMASSIMO TENTATIVILEADS AT LIMITATTIVO CANCELLA
ESITORITARDO NUOVO TENTATIVOMASSIMO TENTATIVIPORTA AL LIMITEATTIVO CANCELLA
\n"; echo "\n"; - echo "\n"; + echo "QC Enabled:\n"; + echo "\n"; # echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo "\n"; - echo "QC Enabled: $NWB#vicidial_campaigns-qc_enabled$NWE
QC Esiti:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
$NWB#vicidial_campaigns-qc_enabled$NWE
QC Status:
$NWB#vicidial_campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#vicidial_campaigns-qc_lists$NWE
$qc_lists_list
QC WebForm: $NWB#vicidial_campaigns-qc_web_form_address$NWE
QC Web Form:$NWB#vicidial_campaigns-qc_web_form_address$NWE
QC Script: $NWB#vicidial_campaigns-qc_script$NWE
QC Shift:
QC Maiusc: $NWB#vicidial_campaigns-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
QC Show Recording: $NWB#vicidial_campaigns-qc_show_recording$NWE
QC ottenere il record di lancio: $NWB#vicidial_campaigns-qc_get_record_launch$NWE
Visualizza la registrazione, QC: $NWB#vicidial_campaigns-qc_show_recording$NWE
\n"; @@ -12012,22 +14168,22 @@ if ($ADD==31) if ($SUB=='20A') { - echo "

SURVEY SETTINGS FOR THIS CAMPAIGN:
\n"; + echo "

INDAGINE SETTINGS per questa campagna:
\n"; echo "
\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -12201,9 +14357,16 @@ if ($ADD==34) echo ""; echo ""; echo ""; - echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + } echo "\n"; echo "\n"; + if ($SSoutbound_autodial_active < 1) + { + echo ""; + } echo "
\n"; echo "\n"; - echo "
Survey First Audio File: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Survey DTMF Digits: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Survey Not Interested Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Survey Opt-in Audio File: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Survey Not Interested Audio File: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Survey Method: $NWB#vicidial_campaigns-survey_method$NWE
Survey No-Response Action: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Survey Not Interested Esito: $NWB#vicidial_campaigns-survey_ni_status$NWE
Survey Response Digit Map: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Survey Survey Xfer Extension: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Survey Registrazioni Per Questa Campagna Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Indagine primo file audio: $NWB#vicidial_campaigns-survey_first_audio_file$NWE
Indagine sulle cifre DTMF: $NWB#vicidial_campaigns-survey_dtmf_digits$NWE
Indagine non interessa Digit: $NWB#vicidial_campaigns-survey_ni_digit$NWE
Indagine Opt-in File Audio: $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE
Indagine non interessa File Audio: $NWB#vicidial_campaigns-survey_ni_audio_file$NWE
Indagine Metodo: $NWB#vicidial_campaigns-survey_method$NWE
Indagine n.-Azione di risposta: $NWB#vicidial_campaigns-survey_no_response_action$NWE
Indagine Stato non è interessato: $NWB#vicidial_campaigns-survey_ni_status$NWE
Indagine risposta Digit Mappa: $NWB#vicidial_campaigns-survey_response_digit_map$NWE
Indagine Indagine Xfer Estensione: $NWB#vicidial_campaigns-survey_xfer_exten$NWE
Indagine Campagna Registrazione Directory: $NWB#vicidial_campaigns-survey_camp_record_dir$NWE
Casella Vocale: $NWB#vicidial_campaigns-voicemail_ext$NWE
$row[0]: Vista Generale Vista Dettagliata List Mix Elenco Mix Schermata Tempo Reale  
\n"; if ($SUB < 1) @@ -12217,80 +14380,82 @@ if ($ADD==34) echo "
ID Campagna: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
Descrizione Campagna: $row[57]$NWB#vicidial_campaigns-campaign_description$NWE
Campagna Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagna Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campagna Cambia Data: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE
Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Attivo: $NWB#vicidial_campaigns-active$NWE
Extension del parking: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
Permita de entrada y mezclado:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Permita de entrada y mezclado:$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE
Esito Chiamata $o: \n"; - if ($DEFstatusDISABLED > 0) + $o=0; + while ($Ds_to_print > $o) { - echo "$Dstatus - $statname_list[$Dstatus]         \n"; - echo "REMOVE
Esito Chiamata $o: \n"; + if ($DEFstatusDISABLED > 0) + { + echo "$Dstatus - $statname_list[$Dstatus]         \n"; + echo "REMOVE
Aggiungi Un Esito Chiamata:   \n"; + echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
Elenco Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Metodo Chiamata: $NWB#vicidial_campaigns-dial_method$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Modifica Intensita` Adapt Auto-Dial:
Aggiungi Un Esito Chiamata:   \n"; - echo "     $NWB#vicidial_campaigns-dial_status$NWE
Ordine Lista: $NWB#vicidial_campaigns-lead_order$NWE
List Mix: $NWB#vicidial_campaigns-list_order_mix$NWE
Filtro Contatti: $NWB#vicidial_campaigns-lead_filter_id$NWE
Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
Forza Il Reset Della Coda Chiamate: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Metodo Chiamata: $NWB#vicidial_campaigns-dial_method$NWE
Livello Auto Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Modifica Intensita` Adapt Auto-Dial: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
Esegui all`avvio della telefonata: $get_call_launch
\n"; echo "
\n"; - echo "
LISTE IN QUESTA CAMPAGNA:   $NWB#vicidial_campaign_lists$NWE
\n"; - echo "\n"; - echo "\n"; - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LISTE IN QUESTA CAMPAGNA:   $NWB#vicidial_campaign_lists$NWE\n"; + + echo "
ID LISTANOME LISTAATTIVO
\n"; - - } - - echo "
\n"; + echo ""; + + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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); - $camp_lists=''; + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); + 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++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} + } - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + echo "
ID LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVODATA ULTIMA CHIAMATAMODIFICA
$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]MODIFICA

\n"; + echo "
\n"; + + $filterSQL = $filtersql_list[$lead_filter_id]; + $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); + if (strlen($filterSQL)>4) + {$fSQL = "and $filterSQL";} else - {$bgcolor='bgcolor="#9BB9FB"';} + {$fSQL = '';} - echo "
$rowx[0]$rowx[2]$rowx[1]

\n"; - echo "
\n"; - - $filterSQL = $filtersql_list[$lead_filter_id]; - $filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); - if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} - else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); - echo "Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

\n"; + $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Questa campagna ha $active_lists liste attive e $inactive_lists lista inattive

\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,$fSQL); - echo " - NASCONDI

"; - } - else - { - echo "Popup Dialable Leads Count"; - echo " - MOSTRA

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

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

"; + } - $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]"; + $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 "Questa campagna ha $hopper_leads contatti nella coda chiamate

\n"; - echo "Clicca qui per vedere quali numeri sono nella coda chiamate in questo momento

\n"; + echo "Questa campagna ha $hopper_leads contatti nella coda chiamate

\n"; + echo "Clicca qui per vedere quali numeri sono nella coda chiamate in questo momento

\n"; + echo "Clicca qui per vedere il report VDAD per questa campagna

\n"; + } echo "Clicca qui per visualizzare tutti i richiami in attesa per questa campagna

\n"; - echo "Clicca qui per vedere il report VDAD per questa campagna

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

Clicca qui per visualizzare Admin chages a questa campagna
\n"; + } + echo "
\n"; echo "
\n"; @@ -13347,11 +15570,16 @@ if ($ADD==311) echo "
\n"; echo "

Clicca qui per visualizzare tutti i richiami in attesa in questa lista

\n"; + echo "

Clicca qui per scaricare lelenco

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

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

Clicca qui per visualizzare Admin chages a questo elenco
\n"; + } } else { @@ -13379,7 +15607,7 @@ if ($ADD==3111) $group_name = $row[1]; $group_color = $row[2]; $active = $row[3]; - $web_form_address = $row[4]; + $web_form_address = stripslashes($row[4]); $voicemail_ext = $row[5]; $next_agent_call = $row[6]; $fronter_display = $row[7]; @@ -13414,7 +15642,7 @@ if ($ADD==3111) $qc_shift_id = $row[36]; $qc_get_record_launch = $row[37]; $qc_show_recording = $row[38]; - $qc_web_form_address = $row[39]; + $qc_web_form_address = stripslashes($row[39]); $qc_script = $row[40]; $play_place_in_line = $row[41]; $play_estimate_hold_time = $row[42]; @@ -13430,6 +15658,8 @@ if ($ADD==3111) $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]; + ##### 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"; @@ -13519,10 +15749,10 @@ if ($ADD==3111) echo "
Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
Colore Gruppo: $NWB#vicidial_inbound_groups-group_color$NWE
Attivo: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Operatore Da Scegliere Per La Chiamata Successiva: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Queue Priority:
Coda di priorità:
Secondi Abbattimento Telefonata: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Drop Action: $NWB#vicidial_inbound_groups-drop_action$NWE
Goccia dazione:$NWB#vicidial_inbound_groups-drop_action$NWE
Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Casella Vocale: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop Transfer Gruppo:
Trasferimento Drop Group:$NWB#vicidial_inbound_groups-drop_inbound_group$NWE
Despue`s De las Horas Casella Vocale:$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
After Hours Transfer Gruppo:
Dopo ore di trasferimento del gruppo:$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Nombre de fichero Agradable Del Mensaje:$NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Play Benvenuti Message: $NWB#vicidial_inbound_groups-play_welcome_message$NWE
Lettura del messaggio di benvenuto:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Context Musica di Attesa:$NWB#vicidial_inbound_groups-moh_context$NWE
En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
Play Place in Line: $NWB#vicidial_inbound_groups-play_place_in_line$NWE
Gioca Luogo in Linea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Play Estimated Hold Time: $NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Gioca Tenere Tempo stimato:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Hold Time Option: $NWB#vicidial_inbound_groups-hold_time_option$NWE
Tenere Tempo Opzione:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Hold Time Option Seconds: $NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Tenere Opzione Secondi Tempo:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Hold Time Option Extension: $NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Tenere Opzione Tempo Estensione:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Hold Time Option Casella Vocale: $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Tenere Tempo Opzione Segreteria:$NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Hold Time Option Transfer In-Gruppo:
Tenere Opzione Tempo trasferimento in gruppo:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Hold Time Option Callback Filename: $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Tenere il tempo di richiamata Opzione Nome file:$NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Option Callback ID Lista: $NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Tenere Opzione Tempo richiamata Elenco ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Extension Alerta Del Agente:$NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Hold Recall Transfer In-Gruppo: $NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
No Delay Call Route: $NWB#vicidial_inbound_groups-no_delay_call_route$NWE
In-Group Recording Override: $NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
In-Group Recording Filename: $NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Stats Percent of Calls Answered Within X seconds 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Stats Percent of Calls Answered Within X seconds 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
 
Inbound Group QC Settings:
Predefinito Gruppo Alias: $NWB#vicidial_inbound_groups-default_group_alias$NWE
Tenere Ricorda Trasferimento in gruppo:$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE
Scadenza Bando n. Percorso:$NWB#vicidial_inbound_groups-no_delay_call_route$NWE
Nel gruppo di registrazione Override:$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE
Nel gruppo Registrazione Nome file:$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE
Statistiche per cento delle chiamate risposta entro X secondi 1: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
Statistiche per cento delle chiamate risposta entro X secondi 2: $NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE
 
Inbound Gruppo QC Impostazioni:
QC Enabled: $NWB#vicidial_inbound_groups-qc_enabled$NWE
QC Status:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC Web Form:$NWB#vicidial_inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#vicidial_inbound_groups-qc_script$NWE
QC Maiusc: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
QC ottenere il record di lancio: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
Visualizza la registrazione, QC: $NWB#vicidial_inbound_groups-qc_show_recording$NWE
QC Enabled: $NWB#vicidial_inbound_groups-qc_enabled$NWE
QC Esiti:
$NWB#vicidial_inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC WebForm: $NWB#vicidial_inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#vicidial_inbound_groups-qc_script$NWE
QC Shift: $NWB#vicidial_inbound_groups-qc_shift_id$NWE
QC Get Record Launch: $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE
QC Show Recording: $NWB#vicidial_inbound_groups-qc_show_recording$NWE
\n"; echo "

\n"; @@ -13777,6 +16035,10 @@ if ($ADD==3111) echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

CANCELLA QUESTO GRUPPO INBOUND\n"; } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages per questo gruppo di in -
\n"; + } } else { @@ -13883,39 +16145,38 @@ if ($ADD==3311) {$Dgroups_menu .= "\n";} - echo "
MODIFY A DID RECORD: $row[0]
\n"; + echo "
A MODIFICARE LO RECORD:$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 "
DID Extension: $NWB#vicidial_inbound_dids-did_pattern$NWE
DID Descrizione: $NWB#vicidial_inbound_dids-did_description$NWE
HA Estensione:$NWB#vicidial_inbound_dids-did_pattern$NWE
HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
Attivo: $NWB#vicidial_inbound_dids-did_active$NWE
DID Route: $NWB#vicidial_inbound_dids-did_route$NWE
Extension: $NWB#vicidial_inbound_dids-extension$NWE
Extension Context: $NWB#vicidial_inbound_dids-exten_context$NWE
Buzon de voz: $NWB#vicidial_inbound_dids-voicemail_ext$NWE
Phone Extension: $NWB#vicidial_inbound_dids-phone$NWE
HA Percorso:$NWB#vicidial_inbound_dids-did_route$NWE
Estensione:$NWB#vicidial_inbound_dids-extension$NWE
Estensione Contesto:$NWB#vicidial_inbound_dids-exten_context$NWE
Buzon de voz:$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Estensione Telefono:$NWB#vicidial_inbound_dids-phone$NWE
IP Server: $NWB#vicidial_inbound_dids-server_ip$NWE
User Agent: $NWB#vicidial_inbound_dids-user$NWE
User Unavailable Action: $NWB#vicidial_inbound_dids-user_unavailable_action$NWE
User Route Settings In-Gruppo:
Utente Agent:$NWB#vicidial_inbound_dids-user$NWE
Lutente non disponibile Azione:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Utente percorso Impostazioni In-Group:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
In-ID Gruppo: $NWB#vicidial_inbound_dids-group_id$NWE
In-Group Call Handle Method: $NWB#vicidial_inbound_dids-call_handle_method$NWE
In-Group Agent Search Method: $NWB#vicidial_inbound_dids-agent_search_method$NWE
In-Group ID Lista: $NWB#vicidial_inbound_dids-list_id$NWE
In-ID Gruppo Campagna:
Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Nel gruppo di agente Metodo di ricerca:$NWB#vicidial_inbound_dids-agent_search_method$NWE
Nel gruppo Elenco ID:$NWB#vicidial_inbound_dids-list_id$NWE
Nel gruppo-ID campagna:$NWB#vicidial_inbound_dids-campaign_id$NWE
In-Group Phone Code: $NWB#vicidial_inbound_dids-phone_code$NWE
Nel gruppo Codice Telefono:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; @@ -13925,7 +16186,11 @@ if ($ADD==3311) if ($LOGdelete_dids > 0) { - echo "

DELETE THIS DID\n"; + echo "

CANCELLA QUESTO HA\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo DID\n"; } } else @@ -13987,6 +16252,10 @@ if ($ADD==31111) { echo "

SUPRIMA ESTE AGENTE ALEJADO\n"; } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo agente remoto\n"; + } } else { @@ -14014,6 +16283,8 @@ if ($ADD==311111) $group_name = $row[1]; $GROUP_shifts = $row[5]; $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + echo ""; echo "
MODIFICA UN GRUPPO UTENTI\n"; @@ -14023,14 +16294,16 @@ if ($ADD==311111) echo "
Gruppo: (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE
Descrizione: (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE
Force Timeclock Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Forza orologio Login: $NWB#vicidial_user_groups-forced_timeclock_login$NWE
Maiusc esecuzione: $NWB#vicidial_user_groups-shift_enforcement$NWE
Campagne Permesse:
$NWB#vicidial_user_groups-allowed_campaigns$NWE
\n"; echo "$campaigns_list
 "; echo "
Group Shifts:
$NWB#vicidial_user_groups-group_shifts$NWE
\n"; + echo "
Gruppo Turni:
$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); @@ -14055,12 +16328,15 @@ if ($ADD==311111) } echo "
 
QC Campagne Permesse:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; - echo "$qc_campaigns_list"; - echo "
 
QC Grupos De entrada Permitidos:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; - echo "$qc_groups_list"; - echo "
 
QC ammessi Campagne:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; + echo "$qc_campaigns_list"; + echo "
 
QC ammessi Inbound Gruppi:
$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE
\n"; + echo "$qc_groups_list"; + echo "
 
\n"; @@ -14069,14 +16345,14 @@ if ($ADD==311111) ### list of users in this user group $active_confs = 0; - $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; + $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 "
UTENTI IN QUESTO GRUPPO: $users_to_print
\n"; echo "\n"; - echo "\n"; + echo "\n"; $o=0; while ($users_to_print > $o) @@ -14093,6 +16369,7 @@ if ($ADD==311111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } @@ -14101,12 +16378,16 @@ if ($ADD==311111) echo "

Clicca qui per visualizzare tutti i richiami di questo utente

\n"; - echo "

Click here to see the Timeclock Status for this user group

\n"; + echo "

Clicca qui per visualizzare lorologio di stato per questo gruppo di utenti

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

CANCELLA QUESTO GRUPPO UTENTI\n"; } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo gruppo di utenti\n"; + } } else { @@ -14194,6 +16475,10 @@ if ($ADD==3111111) { echo "

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

Clicca qui per visualizzare Admin chages a questo script\n"; + } } else { @@ -14260,6 +16545,10 @@ if ($ADD==31111111) { echo "

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

Clicca qui per visualizzare Admin chages a questo filtro\n"; + } } else { @@ -14455,6 +16744,10 @@ if ($LOGdelete_call_times > 0) { echo "

ELIMINA QUESTO ORARIO CHIAMATE\n"; } +if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages tempo al presente invito\n"; + } } else { @@ -14591,44 +16884,44 @@ echo "
UTENTENOME COMPLETOLIVELLO
UTENTENOME COMPLETOLIVELLOATTIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]
\n"; echo ""; -echo "
MODIFY A SHIFT\n"; +echo "
Modificare una SHIFT\n"; echo "\n"; echo "\n"; echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Shift ID: $shift_id
Shift Name: (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE
Shift Start Time: \n"; -echo "   Shift End Time: \n"; -echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Length: $NWB#vicidial_shifts-shift_length$NWE
Shift Weekdays:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; +echo "
Maiusc ID:$shift_id
Maiusc Nome: (breve descrizione del turno)$NWB#vicidial_shifts-shift_name$NWE
Maiusc Start Time:\n"; +echo "   Fine Time Shift:\n"; +echo " $NWB#vicidial_shifts-shift_start_time$NWE
Maiusc Lunghezza: $NWB#vicidial_shifts-shift_length$NWE
Maiusc Feriali:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; echo "Sunday
\n"; +echo ">Domenica
\n"; echo "Monday
\n"; +echo ">Lunedi
\n"; echo "Tuesday
\n"; +echo ">Martedì
\n"; echo "Wednesday
\n"; +echo ">Mercoledì
\n"; echo "Thursday
\n"; +echo ">Giovedi
\n"; echo "Friday
\n"; +echo ">Venerdì
\n"; echo "Saturday
\n"; +echo ">Sabato
\n"; echo "
\n"; echo "


\n"; -echo "GRUPPI UTENTI USING THIS SHIFT:
\n"; +echo "LUSO DI QUESTO MANUALE GRUPPI SHIFT:
\n"; echo "\n"; @@ -14648,7 +16941,11 @@ echo "

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

DELETE THIS SHIFT DEFINITION\n"; + echo "

Elimina questo SHIFT DEFINIZIONE\n"; + } +if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo passaggio\n"; } } else @@ -14681,7 +16978,7 @@ if ($ADD==31111111111) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -14696,7 +16993,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -14751,6 +17048,25 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "
Interno Telefono: $NWB#phones-extension$NWE
Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
Direccion IP del telefono: (optional)$NWB#phones-phone_ip$NWE
Direccion IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del telefono: $NWB#phones-phone_type$NWE
Nome Completo: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Email: $NWB#phones-email$NWE
Compania: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Messaggi Nuovi: $row[14]$NWB#phones-messages$NWE
Usuario de DBY: (Secondario DB Login)$NWB#phones-DBY_user$NWE
Contraseña de DBY: (Secondario DB Secret)$NWB#phones-DBY_pass$NWE
Puerto de DBY: (Secondario DB Port)$NWB#phones-DBY_port$NWE
Template ID: $NWB#phones-template_id$NWE
Conf. Sovrascrive: $NWB#phones-conf_override$NWE
\n"; @@ -14784,12 +17100,12 @@ if ($ADD==32111111111) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "
MODIFY A PHONE ALIAS RECORD: $row[0]\n"; + echo "
MODIFICARE UN TELEFONO ALIAS RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
Alias ID: $row[0] $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Alias ID:$row[0] $NWB#phones-alias_id$NWE
Alias Nome: $NWB#phones-alias_name$NWE
Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; @@ -14799,7 +17115,7 @@ if ($ADD==32111111111) $phone_alias_SQL = ereg_replace(',',"','",$row[2]); echo "
\n"; - echo "
PHONES WITHIN THIS PHONES ALIAS:
\n"; + echo "
TELEFONI CELLULARI PRESENTE IN ALIAS:
\n"; echo "\n"; echo "\n"; @@ -14823,16 +17139,58 @@ if ($ADD==32111111111) echo "
LOGININTERNOSERVERPROTOCOLIP

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

CANC questo telefono ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo telefono cellulare alias
\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 "
MODIFICARE UN GRUPPO ALIAS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Gruppo Alias ID:$row[0] $NWB#phones-group_alias_id$NWE
Alias Nome Gruppo: $NWB#phones-group_alias_name$NWE
Numero CallerID: $NWB#phones-caller_id_number$NWE
CallerID Nome: $NWB#phones-caller_id_name$NWE
Attivo:
\n"; if ($LOGast_delete_phones > 0) { - echo "

CANCELLA QUESTO TELEFONO ALIAS\n"; + echo "

CANCELLA QUESTO GRUPPO ALIAS\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo gruppo alias
\n"; } } else @@ -14854,39 +17212,86 @@ if ($ADD==311111111111) echo "
\n"; echo ""; - $stmt="SELECT * from servers where server_id='$server_id' or server_ip='$server_ip';"; + $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 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_ip = $row[2]; + $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]; + + $cpu = (100 - $cpu_idle_percent); + $disk_usage = preg_replace("/ /"," - ",$disk_usage); + $disk_usage = preg_replace("/\|/","%     ",$disk_usage); echo "
MODIFICAR UN REGISTRO DEL 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 "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\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 Server: $NWB#servers-server_id$NWE
Descrizione Server: $NWB#servers-server_description$NWE
Indirizzo IP del Server: $NWB#servers-server_ip$NWE
Attivo: $NWB#servers-active$NWE
Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
El Marcar Del Balance de VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Balance Offlimits de VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Host Telnet: $NWB#servers-telnet_host$NWE
Porta Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Fuso Orario Locale: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extension de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extension del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
Performance Di Sistema: $NWB#servers-sys_perf_log$NWE
Log Server: $NWB#servers-vd_server_logs$NWE
Salida de AGI: $NWB#servers-agi_output$NWE
ID Server: $NWB#servers-server_id$NWE
Descrizione Server: $NWB#servers-server_description$NWE
Indirizzo IP del Server: $NWB#servers-server_ip$NWE
Attivo: $NWB#servers-active$NWE
Sistema di carico: $sysload - $cpu%   $NWB#servers-sysload$NWE
Live Canali: $channels_total   $NWB#servers-channels_total$NWE
Utilizzo del disco: $disk_usage   $NWB#servers-disk_usage$NWE
Versione Di Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Max chiede al secondo: $NWB#servers-outbound_calls_per_second$NWE
El Marcar Del Balance de VICIDIAL: $NWB#servers-vicidial_balance_active$NWE
Balance Offlimits de VICIDIAL: $NWB#servers-balance_trunks_offlimits$NWE
Host Telnet: $NWB#servers-telnet_host$NWE
Porta Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Fuso Orario Locale: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extension de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extension del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
Performance Di Sistema: $NWB#servers-sys_perf_log$NWE
Log Server: $NWB#servers-vd_server_logs$NWE
Salida de AGI: $NWB#servers-agi_output$NWE
Registrazione Web Link: $NWB#servers-recording_web_link$NWE
Alternate Recording IP Server: $NWB#servers-alt_server_ip$NWE
Attivo Server Asterisk: $NWB#servers-active_asterisk_server$NWE
Genera file di configurazione: $NWB#servers-generate_vicidial_conf$NWE
Ricostruire i file di configurazione: $NWB#servers-rebuild_conf_files$NWE
\n"; @@ -14924,7 +17329,7 @@ if ($ADD==311111111111) echo "
AGREGUE EL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL
\n"; echo "\n"; echo "\n"; - echo "TRUNKS:
\n"; + echo "Bauli:
\n"; echo "CAMPAGNA:
\n"; @@ -14934,23 +17339,56 @@ if ($ADD==311111111111) echo "

\n"; + ### list of carriers on this server + echo "
\n"; + echo "
PORTARINFUSE IN QUESTO SERVER:
\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 IDNOMEREGISTRATIONATTIVO
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + ### list of phones on this server echo "
\n"; echo "
TELEFONI IN QUESTO SERVER:
\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=''; + $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++; + $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++;} @@ -14971,17 +17409,18 @@ if ($ADD==311111111111) echo "
INTERNONOMEATTIVO
\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=''; + $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++; + $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"';} @@ -15000,17 +17439,18 @@ if ($ADD==311111111111) echo "
CONFERENCEINTERNO
\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=''; + $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++; + $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"';} @@ -15026,6 +17466,7 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = eregi_replace(".$","",$camp_lists); + echo "Questo server ha $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "Questo server ha $active_phones telefoni attivi e $inactive_phones telefoni inattivi

\n"; echo "Questo server ha $active_confs active conferences

\n"; echo "Questo server ha $active_vdconfs active vicidial conferences

\n"; @@ -15034,6 +17475,218 @@ if ($ADD==311111111111) { echo "

CANCELLA QUESTO SERVER\n"; } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo server\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } +} + + +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
VD CONFERENCEINTERNO
\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 "
MODIFICARE UN RECORD CONF TEMPLATE: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $template_id
Nome modello: $NWB#vicidial_conf_templates-template_name$NWE
Template Sommario: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
PHONES LUSO DI QUESTO MODELLO 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 "
INTERNONOMESERVERATTIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
PORTARINFUSE LUSO DI QUESTO MODELLO 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 "
CARRIERNOMESERVERATTIVO
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

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

CONF CANC QUESTO MODELLO\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo modello di conf
\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\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 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]; + + echo "
MODIFICARE UN RECORD DEL VETTORE: $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 "
Vettore ID: $carrier_id
Nome del vettore: $NWB#vicidial_server_carriers-carrier_name$NWE
Stringa di registrazione: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Conto Entrata: $NWB#vicidial_server_carriers-account_entry$NWE
Protocollo: $NWB#vicidial_server_carriers-protocol$NWE
Globals Stringa: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan entrata: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Server: $NWB#vicidial_server_carriers-server_ip$NWE
Attivo: $NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

Elimina questo VETTORE\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages a questo vettore
\n"; + } } else { @@ -15147,7 +17800,7 @@ if ($ADD==311111111111111) 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 from system_settings;"; + $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 from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -15175,33 +17828,25 @@ if ($ADD==311111111111111) $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]; echo "
MODIFICA IMPOSTAZIONI DI SISTEMA\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; echo "$NWB#settings-vdc_header_phone_format$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
Versione: $version
DB Schema Versione: $db_schema_version
Auto User-add Value: $auto_user_add_value
Install Date: $install_date
Auto Utente-add Value: $auto_user_add_value
Installare Data: $install_date
UsA Non-Latino: $NWB#settings-use_non_latin$NWE
Webroot Escribible: $NWB#settings-webroot_writable$NWE
Permita La Registracion De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
conexion del DB De QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Contraseña del DB De QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
Log ID QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
El Agente de VICIDIAL Inhabilita La Exhibicio`n:
Permetti messaggi SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
URL Home Amministrazione: $NWB#settings-admin_home_url$NWE
Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
Timeclock End Of Day: $NWB#settings-timeclock_end_of_day$NWE
Timeclock Last Auto Logout: $timeclock_last_reset_date
QC Last Pull Time: $qc_last_pull_time
Agent Screen Header Date Format:
Orologio End of Day:$NWB#settings-timeclock_end_of_day$NWE
Ultimo Logout orologio automatico: $timeclock_last_reset_date
QC Ultimo Tirare Tempo: $qc_last_pull_time
Agente Screen Formato Data Header: $NWB#settings-vdc_header_date_format$NWE
Agent Screen Customer Date Format:
Cliente di agente Screen Formato Data: $NWB#settings-vdc_customer_date_format$NWE
Agent Screen Customer Phone Format:
Agente Cliente Telefono Formato schermo:
Agent API Attivo: $NWB#settings-vdc_agent_api_active$NWE
API di agente attivo:$NWB#settings-vdc_agent_api_active$NWE
QC Attivo Caratteristiche: $NWB#settings-qc_features_active$NWE
Outbound Attivo Auto-Dial: $NWB#settings-outbound_autodial_active$NWE
Max COMPILA invita al secondo: $NWB#settings-outbound_calls_per_second$NWE
Permita La Registracion De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
conexion del DB De QueueMetrics: $NWB#settings-queuemetrics_login$NWE
Contraseña del DB De QueueMetrics: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
Log ID QueueMetrics: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
Attiva Vtiger Integrazione: $NWB#settings-enable_vtiger_integration$NWE\n"; + echo "   Clicca qui per sincronizzare gli utenti con Vtiger\n"; + echo "
Vtiger DB IP Server: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Password: $NWB#settings-vtiger_pass$NWE
Vtiger URL: $NWB#settings-vtiger_url$NWE
\n"; echo "\n"; + if ($LOGuser_level >= 9) + { + echo "

Clicca qui per visualizzare Admin chages per le impostazioni di sistema
\n"; + } + } else { @@ -15380,9 +18063,9 @@ if ($ADD==331111111111111) echo ""; echo "
\n"; - echo "VICIDIAL STATUS CATEGORIES:   $NWB#vicidial_status_categories$NWE
\n"; + echo "VICIDIAL Status CATEGORIE:   $NWB#vicidial_status_categories$NWE
\n"; echo "\n"; - echo "\n"; + echo "\n"; $stmt="SELECT * from vicidial_status_categories order by vsc_id;"; $rslt=mysql_query($stmt, $link); @@ -15439,7 +18122,7 @@ if ($ADD==331111111111111) echo "$CATstatuses"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -15454,9 +18137,9 @@ if ($ADD==331111111111111) echo "\n"; echo "Category ID:   \n"; echo "Name:  
\n"; - echo "TimeOnVDAD Display:   \n"; - echo "Sale Categoria:   \n"; - echo "Dead Lead Categoria:  
\n"; + echo "TimeOnVDAD Visualizzare:   \n"; + echo "Vendita Categoria:   \n"; + echo "Morto leader Categoria:  
\n"; echo "Descrizione:   \n"; echo "
\n"; @@ -15480,13 +18163,13 @@ if ($ADD==331111111111111) if ($ADD==341111111111111) { - if ($LOGmodify_servers==1) + if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) ) { echo "
CATEGORIANOMESTATUSES IN THIS CATEGORY
CATEGORIANOMEStati in questa categoria
TO VDAD Display:     Sale Categoria:     Dead Lead Categoria:  
TO VDAD Visualizzare:     Vendita Categoria:     Morto leader Categoria:  
Descrizione:
        \n"; echo "   CANCELLA
\n"; echo ""; echo "
\n"; - echo "VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM:   $NWB#vicidial_qc_status_codes$NWE
\n"; + echo "QC VICIDIAL Status CODICI Nellambito di questo sistema:  $NWB#vicidial_qc_status_codes$NWE
\n"; echo "\n"; echo "\n"; @@ -15532,7 +18215,7 @@ if ($ADD==341111111111111) } echo "
STATUS CODEDESCRIZIONEMODIFICA/CANCELLA
\n"; - echo "
ADD NEW QC STATUS CODE
\n"; + echo "
ADD NEW QC CODICE STATO
\n"; echo "\n"; echo "Esito:   \n"; echo "Descrizione:
\n"; @@ -15646,13 +18329,13 @@ if ($ADD==8) { $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status='LIVE' and callback_time < '$past_month_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one month have been made INACTIVE\n"; + echo "
Utente($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='LIVE' and callback_time < '$past_week_date';"; $rslt=mysql_query($stmt, $link); - echo "
User($user) callback listings LIVE for more than one week have been made INACTIVE\n"; + echo "
Utente($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
"; @@ -15754,7 +18437,7 @@ if ($ADD==8111) $CBquerySQLwhere = "and user_group='$user_group'"; -echo "
USER GROUP CALLBACK HOLD LISTINGS: $list_id\n"; +echo "
Utente Group CALLBACK HOLD LISTINGS: $list_id\n"; $oldADD = "ADD=8111&user_group=$user_group"; $ADD='82'; } @@ -15771,7 +18454,7 @@ $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,'; $LEVELlink='stage=LEVELUP';} +if (eregi("ENDATEDOWN",$stage)) {$SQLorder='order by entry_time desc,'; $LIVELLOlink='stage=LIVELLOUP';} $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') $CBquerySQLwhere $SQLorder recipient,status desc,callback_time"; $rslt=mysql_query($stmt, $link); @@ -15827,103 +18510,165 @@ echo "$CBinactiveLINK"; # ADD=0 display all active users ###################### if ($ADD==0) -{ -echo "
\n"; -echo ""; + { + echo "
\n"; + echo ""; + echo "
ELENCO UTENTI: "; + if (ereg('display_all',$status)) + { + $SQLstatus = ''; + echo "   mostra solo utenti attivi\n"; + } + else + { + $SQLstatus = "where active='Y'"; + echo "   mostra tutti gli utenti\n"; + } -$USERlink='stage=USERIDDOWN'; -$NAMElink='stage=NAMEDOWN'; -$LEVELlink='stage=LEVELDOWN'; -$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("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} -if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} -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 * from vicidial_users $SQLorder"; + $USERlink='stage=USERIDDOWN'; + $NAMElink='stage=NAMEDOWN'; + $LIVELLOlink='stage=LIVELLODOWN'; + $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("LIVELLOUP",$stage)) {$SQLorder='order by user_level asc'; $LIVELLOlink='stage=LIVELLODOWN';} + if (eregi("LIVELLODOWN",$stage)) {$SQLorder='order by user_level desc'; $LIVELLOlink='stage=LIVELLOUP';} + 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 $SQLstatus $SQLorder"; $rslt=mysql_query($stmt, $link); $people_to_print = mysql_num_rows($rslt); -echo "
ELENCO UTENTI:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
ID UTENTENOME COMPLETOLIVELLOGRUPPOLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
ID UTENTENOME COMPLETOLIVELLOGRUPPOATTIVOLINK
$row[1]$row[3]$row[4]$row[5]MODIFICA | STATISTICHE | ESITO | TIME
$row[0]$row[1]$row[2]$row[3]$row[4]
MODIFICA | STATISTICHE | ESITO | TIME
\n"; -} + echo "
\n"; + } ###################### # ADD=10 display all campaigns ###################### if ($ADD==10) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $campaigns_to_print = mysql_num_rows($rslt); -echo "
ELENCO CAMPAGNE:\n"; -echo "
\n"; + echo "
ELENCO CAMPAGNE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "\n"; $o=0; - while ($people_to_print > $o) { + 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 ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + if ($SSoutbound_autodial_active > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + } echo "\n"; $o++; - } + } -echo "
CAMPAGNA ID
NOME
ACTIVE   DIAL METODO   LIVELLO   PIOMBO PER   DIAL status   MODIFICA
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  
$row[0]   $row[1]   $row[2]   $row[3]   $row[4]   $row[5]   $row[6]MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=100 display all lists ###################### if ($ADD==100) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lists order by list_id"; + $LISTlink='stage=LISTIDDOWN'; + $TALLYlink='stage=TALLYDOWN'; + $ACTIVElink='stage=ACTIVEDOWN'; + $CAMPAIGNlink='stage=CAMPAIGNDOWN'; + $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("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} + if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} + 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 group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $lists_to_print = mysql_num_rows($rslt); -echo "
ELENCO LISTE:\n"; -echo "
\n"; + echo "
ELENCO LISTE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + $lists_printed = ''; $o=0; - while ($people_to_print > $o) { + while ($lists_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -15931,14 +18676,40 @@ echo "
ID LISTANOME LISTADESCRIZIONEPORTA CONTEATTIVODATA ULTIMA CHIAMATACAMPAGNAMODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; 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 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 "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]   $row[2] $row[3] $row[4] $row[5] $row[6]MODIFICA
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFICA
\n"; -} + echo "
\n"; + } @@ -15946,28 +18717,29 @@ echo "
\n"; # ADD=1000 display all inbound groups ###################### if ($ADD==1000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; + $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); - $people_to_print = mysql_num_rows($rslt); + $ingroups_to_print = mysql_num_rows($rslt); -echo "
ELENCO GRUPPI INBOUND:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo "\n"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
ELENCO GRUPPI INBOUND:\n"; + echo "
IN-GROUPNOMEPRIORITYATTIVOTIMECOLORMODIFICA
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($ingroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -15975,43 +18747,44 @@ echo "\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; $o++; - } + } -echo "
IN-GROUPNOMEPRIORITYATTIVOTIMECOLORMODIFICA
$row[0] $row[1] $row[29] $row[2] $row[3] $row[17]   $row[4]  MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=1300 display all inbound dids ###################### if ($ADD==1300) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_inbound_dids order by did_pattern"; + $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 "
ELENCO GRUPPI INBOUND:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo "\n"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; + echo "
ELENCO GRUPPI INBOUND:\n"; + echo "
#DIDDESCRIZIONEATTIVOROUTEMODIFICA
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; $o=0; - while ($dids_to_print > $o) { + while ($dids_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16024,29 +18797,38 @@ echo "\n"; echo ""; echo "\n"; $o++; - } + } -echo "
#DIDDESCRIZIONEATTIVOROUTEMODIFICA
$row[4]MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=10000 display all remote agents ###################### if ($ADD==10000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $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); - $people_to_print = mysql_num_rows($rslt); + $remoteagents_to_print = mysql_num_rows($rslt); -echo "
ELENCO OPERATORI REMOTI:\n"; -echo "
\n"; + echo "
ELENCO OPERATORI REMOTI:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($remoteagents_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16058,31 +18840,37 @@ echo "
UTENTELINESSERVER   CONF-EXTEN   STATUS   CAMPAIGN   MODIFICA
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[4] $row[5] $row[6]MODIFICA
MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=100000 display all user groups ###################### if ($ADD==100000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_user_groups order by user_group"; + $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $usergroups_to_print = mysql_num_rows($rslt); -echo "
ELENCO GRUPPI UTENTI:\n"; -echo "
\n"; + echo "
ELENCO GRUPPI UTENTI:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($usergroups_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16090,31 +18878,38 @@ echo "
Utente GroupNOME GRUPPOVIGORE orologio   MODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICA
$row[2]MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000 display all scripts ###################### if ($ADD==1000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_scripts order by script_id"; + $stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id"; $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); + $scripts_to_print = mysql_num_rows($rslt); -echo "
ELENCO SCRIPT:\n"; -echo "
\n"; + echo "
ELENCO SCRIPT:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($people_to_print > $o) { + while ($scripts_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16122,32 +18917,37 @@ echo "
SCRIPT IDNome scriptACTIVE   MODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICA
$row[2]MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000 display all filters ###################### if ($ADD==10000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; + $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 "
ELENCO FILTRI CONTATTI:\n"; -echo "
\n"; + echo "
ELENCO FILTRI CONTATTI:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($filters_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16155,32 +18955,38 @@ echo "
FILTER IDFILTER NAMEMODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1]MODIFICA
MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=100000000 display all call times ###################### if ($ADD==100000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_call_times order by call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $calltimes_to_print = mysql_num_rows($rslt); -echo "
ELENCO ORARI CHIAMATE:\n"; -echo "
\n"; + echo "
ELENCO ORARI CHIAMATE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($calltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16188,33 +18994,41 @@ echo "
CALLTIME IDCALLTIME NOMEINIZIO DI MORADEFAULT STOPMODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; + echo ""; echo ""; - echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFICA
MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=1000000000 display all state call times ###################### if ($ADD==1000000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $statecalltimes_to_print = mysql_num_rows($rslt); + + echo "
ELENCO ORARI CHIAMATE PER STATO:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; -echo "
ELENCO ORARI CHIAMATE PER STATO:\n"; -echo "
CALLTIME IDCALLTIME STATECALLTIME NOMEINIZIO DI MORADEFAULT STOPMODIFICA
\n"; $o=0; - while ($filters_to_print > $o) { + while ($statecalltimes_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16225,31 +19039,38 @@ echo "
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[2] $row[3] $row[4] MODIFICA
MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=130000000 display all shifts ###################### if ($ADD==130000000) -{ -echo "
\n"; - + { + echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_shifts order by shift_id"; + $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); - $filters_to_print = mysql_num_rows($rslt); + $shifts_to_print = mysql_num_rows($rslt); -echo "
SHIFT LISTINGS:\n"; -echo "
\n"; + echo "
SHIFT LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($filters_to_print > $o) { + while ($shifts_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16260,182 +19081,341 @@ echo "
SHIFT IDSHIFT NOMESHIFT INIZIOSHIFT DURATASETTIMANALEMODIFICA
\n"; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; $o++; - } + } -echo "
$row[2] $row[3] $row[4] MODIFICA
MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000000 display all phones ###################### if ($ADD==10000000000) -{ -echo "
\n"; -echo ""; + { + 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 * from phones $SQLorder"; + $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 "
ELENCO TELEFONI:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
ELENCO TELEFONI:\n"; + echo "
EXTENPROTOSERVERDIAL PLANESITONOMEVMAILLINKS
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo " + + + + + + + + "; + echo "\n"; $o++; - } + } -echo "
EXTENPROTOSERVERDIAL PIANOESITONOMEVMAILLINK
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFICA | STATISTICHE
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFICA | STATISTICHE
\n"; -} + echo "
\n"; + } ###################### # ADD=12000000000 display all phones alias ###################### if ($ADD==12000000000) -{ -echo "
\n"; -echo ""; + { + echo "
\n"; + echo ""; - $stmt="SELECT * from phones_alias order by alias_id;"; + $stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $phonealias_to_print = mysql_num_rows($rslt); -echo "
PHONE ALIAS LISTINGS:\n"; -echo "
\n"; -echo ""; -echo ""; -echo ""; -echo ""; -echo "\n"; + echo "
TELEFONO ALIAS LISTINGS:\n"; + echo "
ALIAS IDALIAS NAMEPHONE LOGINS LISTMODIFICA
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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 "\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; + } + + echo "
ALIAS IDALIAS NOMELogin ELENCO TELEFONICOMODIFICA
$row[0]$row[1]$row[2]MODIFICA
$row[0]$row[1]$row[2]MODIFICA
\n"; } -echo "
\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 "
GRUPPO ALIAS LISTINGS:\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 "
GRUPPO ALIAS IDALIAS NOME GRUPPOCID NUMEROCID NOMEATTIVOMODIFICA
$row[0]$row[1]$row[2]$row[3]$row[4]MODIFICA
\n"; + } ###################### # ADD=100000000000 display all servers ###################### if ($ADD==100000000000) -{ -echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from servers order by server_id"; + $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); - $phones_to_print = mysql_num_rows($rslt); + $servers_to_print = mysql_num_rows($rslt); -echo "
ELENCO SERVER:\n"; -echo "
\n"; + echo "
ELENCO SERVER:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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 "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o++; + } + + echo "
SERVER IDNOMESERVER IPATTIVOASTERISKBauliGMTMODIFICA
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFICA
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFICA
\n"; } -echo "
\n"; -} +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + 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 "
CONF TEMPLATE ELENCOINGS:\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 "
Template IDNome modelloMODIFICA
$row[0]$row[1]MODIFICA
\n"; + } + +###################### +# ADD=140000000000 display all carriers +###################### +if ($ADD==140000000000) + { + echo "\n"; 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 "
VETTORE LISTINGS:\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 "
Vettore IDNome del vettoreIP ServerProtocolRegistrazioneAttivoMODIFICA
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]MODIFICA
\n"; + } ###################### # ADD=1000000000000 display all conferences ###################### if ($ADD==1000000000000) -{ -echo "\n"; echo "\n"; +echo "
\n"; + { + echo "
\n"; echo ""; - $stmt="SELECT * from conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $conferences_to_print = mysql_num_rows($rslt); -echo "
ELENCO CONFERENZE:\n"; -echo "
\n"; + echo "
ELENCO CONFERENZE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + 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"; + echo ""; + echo ""; + echo "\n"; $o++; - } + } -echo "
CONFERENCESERVER IPINTERNOMODIFICA
$row[0] $row[1] $row[2]$row[4]  MODIFICA
$row[1]$row[2]MODIFICA
\n"; -} + echo "
\n"; + } ###################### # ADD=10000000000000 display all vicidial conferences ###################### if ($ADD==10000000000000) -{ -echo "\n"; echo "
\n"; + { + echo "\\n\";"; + if ($file_name =~ /admin/) {$link_file_name = 'admin.php';} + else {$link_file_name = $file_name;} + $file[$LINESct] .= "echo \"\\n\";"; } $e++; } diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index f04b9099..8c30bd1f 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -360,7 +360,7 @@ installation that is self contained and needs no other local servers to operate, so we will need to install mysql on this machine. *REQUIRED and OPTIONAL* (only install MySQL server locally if you don't want to use an installation on another machine, Mysql client is required on all VICIDIAL servers) -NOTE: a minimum of MySQL server 4.0.X is required +NOTE: a minimum of MySQL server 5.0.X is required You should increase the connect_timeout so connections do not fail on a more loaded system. diff --git a/translations/br_language.txt b/translations/br_language.txt index 416fe502..35ef0880 100644 --- a/translations/br_language.txt +++ b/translations/br_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"JAN"| @@ -373,7 +373,7 @@ City|Cidade| State|Estado| PostCode|CEP| Province|Bairro| -Vendor ID|ID do Vendedor| +Vendor ID|Vendedor| DialCode|Codigo de Area| Alt. Phone|Telefone Alternativo| Show|Mostrar| @@ -427,3 +427,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE DAR ENTR 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| +### 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| +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 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:| +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| diff --git a/translations/de_language.txt b/translations/de_language.txt index 1b83c87d..eea18e79 100644 --- a/translations/de_language.txt +++ b/translations/de_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"JAN"| @@ -437,3 +437,43 @@ Active: |Aktiv: | Alt Count: |Anzahl Alternativen: | Change this phone number to INACTIVE|Diese Telfonnummer DEAKTIVIEREN| Change this phone number to ACTIVE|Diese Telefonnummer AKTIVIEREN| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Geschlecht:| +Date of Birth: |Geburtsdatum:| +YOU MUST BE PAUSED TO CHANGE GROUPS|SIE IST ZU ÄNDERN Paused GRUPPEN| +Calls in Queue:|Anrufe in der Warteschlange:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|Die Benutzer-und Passwort, das Sie eingetragen sind nicht aktiv in das System| +Please try again|Bitte versuchen Sie es erneut| +You cannot log in or out within 30 seconds of your last login or logout|Sie können sich nicht mehr anmelden, oder innerhalb von 30 Sekunden des letzten An-oder Abmeldung| +You have now logged-out|Sie haben nun abgemeldet| +You logged out at |Sie abgemeldet auf| +Amount of time you were logged-in: |Höhe der Zeit, die Sie angemeldet waren-in:| +ERROR: timeclock log entry already made: |FEHLER: timeclock Log-Eintrag bereits gemacht:| +BACK to Agent Login Screen|BACK, um Agent Login Screen| +BACK to Administration|Zurück zur Verwaltung| +BACK to Welcome Screen|Zurück zur Willkommen-Bildschirm| +Time since you were last logged-in: |Zeit seit dem letzten Einloggen-in:| +You last logged-out at: |Sie zuletzt eingeloggt am:| +Click LOGIN below to log-in|Klicken Sie auf LOGIN unten, um die Log-in| +Amount of time you have been logged-in: |Höhe der Zeit, die Sie wurden protokolliert-in:| +You logged-in at:|Sie eingeloggt am:| +Click LOGOUT below to log-out|Klicken Sie unten, um sich LOGOUT-out| +Undefined|Undefined| +This phone number is not in the campaign lists|Diese Telefonnummer ist nicht in der Listen-Kampagne| +Unspecified error|Unbekannter Fehler| +Extended Alt Phone Information: |Erweiterte Alt Information Telefon:| +ALT DIAL NUMBER:|ALT DIAL NUMBER:| +Phone Code and Number:|Telefon-und Code-Nummer:| +Notes: |Anmerkungen:| +Active: |Aktiv:| +Alt Count: |Alt Graf:| +Change this phone number to INACTIVE|Ändern Sie diese Telefonnummer an INACTIVE| +Change this phone number to ACTIVE|Ändern Sie diese Telefonnummer an AKTIVEN| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|Sie müssen sich in die TIMECLOCK ERSTE| +There is a time synchronization problem with your system, please tell your system administrator|Es ist eine Zeit-Synchronisation Problem mit Ihrem System haben, wenden Sie sich bitte sagen Sie sich an Ihren Systemadministrator| +Preview Call|Vorschau Call| +SELECT A GROUP ALIAS|Wählen Sie eine Gruppe ALIAS| +Group Alias Selection|Gruppe Alias Auswahl| +Click Here to Choose a Group Alias|Klicken Sie hier, um eine Gruppe Alias| +Group Alias|Alias-Gruppe| diff --git a/translations/de_language_admin.txt b/translations/de_language_admin.txt index 4584e6d2..4b3e23e4 100644 --- a/translations/de_language_admin.txt +++ b/translations/de_language_admin.txt @@ -43,6 +43,27 @@ 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 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| @@ -1414,3 +1435,661 @@ Allowed Transfer Groups: |Gewährte Übergangsgruppen:| 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|Gewährte Übergangsgruppen - mit diesen checkbox Auflistungen könnenSie die Gruppen vorwählen, denen Mittel in dieser Kampagne bringenkönnen Anrufe zu. Erlauben Sie Closers muß ermöglicht werden, damitdiese Wahl oben darstellt| 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|Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird| 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|Auch in diesem Abschnitt ist die Fähigkeit, dem Mittel einen Rankfür jede inbound Gruppe zu geben. Diese Rank können für bevorzugteAnrufwegewahl verwendet werden, wenn diese Wahl auf dem IngruppeSchirm vorgewählt wird| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|QC aktiv - Diese Option ermöglicht es dem Benutzer, um sich in der Quality Control Agent-Bildschirm| +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|QC-User Level - Diese Einstellung legt fest, was die Qualität der User-Agent ist. Dies wird diktieren der Ebene der Funktionalität für den Agenten in der QC-Abschnitt| +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|QC-Datensatz Pass - Diese Option ermöglicht es dem Agenten, um anzugeben, dass ein Datensatz hat die erste Runde der QC nach Überprüfung der Aufnahme| +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|QC-Datensatz Finish - Diese Option ermöglicht es dem Agenten, um anzugeben, dass eine Aufzeichnung beendet ist die zweite Runde der QC nach Überprüfung durch die Aufnahme| +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|QC-Datensatz Commit - Diese Option ermöglicht es dem Agenten festlegen, dass ein Datensatz wurde, die in QC. Es kann nicht mehr geändert werden, indem man| +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|QC erlaubt Kampagnen - Dies ist eine Liste der wählbaren Kampagnen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-KAMPAGNEN Option ermöglicht es dem Benutzer in dieser Gruppe, QC einer Kampagne auf dem System| +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|QC erlaubt Inbound Groups - Dies ist eine Liste der wählbaren Eingang Gruppen, die Mitglieder dieser Gruppe in der Lage, QC. Die ALL-GRUPPEN Option ermöglicht es dem Benutzer in dieser Benutzergruppe zu QC jede eingehende Gruppe über das System| +QC Enabled: |QC aktiv:| +QC User Level: |QC-User Level:| +QC Pass: |QC-Pass:| +QC Finish: |QC-Finish:| +QC Commit: |QC-Commit:| +Modify Nothing|Nichts ändern| +Modify Nothing Except Status|Ändern Sie nichts außer Status| +Modify All Fields|Ändern Sie alle Felder| +Verify First Round of QC|Überprüfen ersten QC| +View QC Statistics|QC Statistiken anzeigen| +Ability to Modify FINISHed records|Möglichkeit, Aufzeichnungen FINISHED| +Manager Level|Manager Level| +USERS CAN VIEW ANY CAMPAIGN|Benutzer können einer Kampagne| +USERS CAN QC ANY CAMPAIGN|Benutzer können alle Kampagnen, QC| +USERS CAN QC ANY INBOUND GROUP|Benutzer können QC JEDENFALLS INBOUND GROUP| +QC Allowed Campaigns: |QC erlaubt Kampagnen:| +QC Allowed Inbound Groups: |QC erlaubt Inbound Gruppen:| +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|Queue-Priorität - Diese Einstellung wird verwendet, um die Reihenfolge, in der die Anrufe von diesem ausgehende Kampagne zu beantworten in Bezug auf die eingehenden Anrufe, wenn diese Kampagne ist in Blended-Modus| +Queue Priority: |Queue-Priorität:| +Drop Action: |Drop-Aktion:| +Drop Transfer Group: |Drop-Transfer-Gruppe:| +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|Drop-Aktion - Mit diesem Menü können Sie wählen, was passiert, wenn er einen Anruf wartet seit mehr als das, was ist in der Drop-Call Sekunden ein. HANGUP einfach auflegen, das Gespräch, MESSAGE wird die Forderung der Drop-Erweiterung, die Sie definiert haben, unten, Voicemail wird der Anruf an die Voicemail-Box, die Sie definiert haben, und unter IN_GROUP wird der Aufruf an die Inbound-Gruppe, die weiter unten definiert ist| +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|Drop-Erweiterung - Wenn Drop-Aktion ist auf MESSAGE Dies ist der Plan wählen, dass sich die Aufforderung an, wenn sie erreicht Drop Call Sekunden| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Drop Call Sekunden - Die Anzahl der Sekunden eines Gesprächs bleibt in der Warteschlange, bevor sie als 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|Drop-Transfer-Fraktion - Wenn Drop-Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie erreicht Drop Call Sekunden| +QC SETTINGS FOR THIS CAMPAIGN|QK-EINSTELLUNGEN für diese Kampagne| +QC Enabled: |QC aktiv:| +QC Statuses: |QK-Status:| +Modify Campaign QC Settings|Ändern Kampagne QC Einstellungen| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|QC aktiv - Wenn Sie diesen Bereich auf Y-Agent ermöglicht die Quality Control Funktionen zur Verfügung stehen. Der Standardwert ist 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|QC-Status - Dieser Bereich ist, in dem Sie auswählen, welche Zustände führt sollte weg von der QC-System. Aktivieren Sie das Kontrollkästchen neben den Status, die Sie wollen, QC, zu überprüfen| +QC SETTINGS NOT MODIFIED|QK-EINSTELLUNGEN NICHT MODIFIZIERT| +QC SETTINGS MODIFIED|QK-EINSTELLUNGEN MODIFIZIERT| +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|QC WebForm Adresse - Dies ist die Website-Adresse, dass ein QC Agenten können sich an, wenn Sie auf den Link WebForm in der QC-Bildschirm| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|QC-Script - Das ist das Skript, das verwendet werden kann, indem QC Agenten in den SCRIPT Registerkarte in der QC-Bildschirm| +QC WebForm: |QC-Webformular:| +QC Script|QC-Script| +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|In-Group-Aufnahme Override - Dieses Feld ermöglicht die zwingende der Kampagne rufen die Aufnahme-Einstellung. Diese Einstellung kann über die Aufnahme überschreiben vicidial_user Einstellung. Behinderte nicht überschreiben die Kampagne die Aufnahme-Einstellung. NIEMALS deaktiviert Aufnahme auf dem Client. OnDemand ist der Standard und ermöglicht es dem Agenten zu starten und stoppen Sie die Aufnahme wie gewünscht. ALLCALLS Starten der Aufnahme wird auf dem Client, wenn ein Anruf an einen Agenten. ALLFORCE Starten der Aufnahme wird auf dem Client, wenn ein Anruf an einen Agenten, die der Agent keine Option um die Aufnahme zu stoppen| +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|In-Group-Aufnahme Dateiname - Mit diesem Feld werden die Aufnahme der Kampagne Dateibenennungsschemata Regelung, es sei denn, es ist auf Keine eingestellt. Die Variablen sind erlaubt KAMPAGNE CUSTPHONE FullDate TINYDATE EPOCH AGENT. Der Standardwert ist FULLDATE_AGENT und würde so aussehen 20051020-103108_6666. Ein weiteres Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, die wie folgt aussehen TESTCAMP_51020103108_3125551212. 50 Zeichen max. Der Standardwert ist KEINE| +In-Group Recording Override: |In-Group-Aufnahme AllowOverride:| +In-Group Recording Filename: |In-Group-Aufnahme Dateiname:| +ADDING VICIDIAL QC STATUS CODE|HINZUFÜGEN VICIDIAL QC-Statuscode| +MODIFY VICIDIAL QC STATUS CODE|MODIFY VICIDIAL QC-Statuscode| +VICIDIAL QC STATUS CODES|VICIDIAL QC-Status-Codes| +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.|Das Quality Control QC-System innerhalb VICIDIAL hat seinen eigenen Satz der Status-Codes, getrennt von denen der Call-Handling Funktionen der VICIDIAL. QC statuse Codes muss zwischen 2 und 8 Zeichen lang sein und keine Sonderzeichen wie Leerzeichen oder Doppelpunkt. Die QK-Status-Code Beschreibung muss zwischen 2 und 30 Zeichen lang sein.| + QC Status Codes |QK-Status-Codes| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |VICIDIAL QC-Status-Codes mit Hilfe dieses Systems:| +ADD NEW QC STATUS CODE|Neue QC-Statuscode| +QC STATUS CODE NOT DELETED|QC-Statuscode nicht gelöscht| +QC STATUS CODE DELETED: |QC-Statuscode gestrichen:| +QC STATUS CODE NOT MODIFIED |QK-Status-Code nicht geändert| +QC STATUS CODE MODIFIED: |QK-Status-Code geändert:| +the qc status code needs to be at least 1 characters in length|qc der Status-Code muss mindestens 1 Zeichen lang sein| +the qc status code name needs to be at least 1 characters in length|qc Status der Code-Name muss mindestens 1 Zeichen lang sein| +QC STATUS CODE NOT ADDED |QK-Status-Code nicht ADDED| +there is already a qc status code in the system with this name:|Es gibt bereits eine qc Status Code in das System mit diesem Namen:| +QC STATUS CODE ADDED: |QK-Status-Code hinzuzufügen:| +code must be between 1 and 8 characters in length|Code muss zwischen 1 und 8 Zeichen lang sein| +code name must be between 2 and 30 characters in length|Code-Name muss zwischen 2 und 30 Zeichen lang sein| +CALL HANGUP REASON STATS|CALL HANGUP GRUND STATS| +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|After Hours Aktion - Die Aktion durchführen, wenn sie nach Stunden wie in der Ausschreibung für diesen eingehenden Gruppe. HANGUP sofort hangup den Anruf, MESSASGE wird die Datei im After Hours Nachricht Filenam Bereich, AUSDEHNUNG wird die Aufforderung an die After Hours-Erweiterung in der dialplan und Voicemail wird der Anruf an die Voicemail-Box, die in den Bereich After Hours Voicemail , IN_GROUP wird die Aufforderung an die Inbound-Gruppe in der After Hours Transfer-Gruppe Wählen Sie Liste. Der Standardwert ist 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|After Hours Transfer Group - , wenn After Hours Aktion ist auf IN_GROUP, wird der Anruf wird an die Inbound-Gruppe, wenn sie die in der Gruppe außerhalb der Aufforderung zur Einreichung von Zeitplanung für die in-group| +After Hours Transfer Group: |After Hours Transfer-Gruppe:| +Total calls taken in to this In-Group:|Insgesamt fordert die in dieser In-Group:| +CALL HOLD TIME BREAKDOWN IN SECONDS|CALL HALTEZEIT AUFTEILUNG IN SEKUNDEN| +Date Range:|Zeitraum:| +ADDING NEW PHONE ALIAS|Neue TEL ALIAS| +ADD NEW PHONE ALIAS|ADD NEW TEL ALIAS| +MODIFY PHONE ALIAS|MODIFY TEL ALIAS| +DELETE PHONE ALIAS|DELETE PHONE ALIAS| +PHONE ALIAS LIST|TEL ALIAS LISTE| +Phone Alias List|Telefon Alias Liste| +Add A New Phone Alias|Hinzufügen einer neuen Telefon Alias| +ADD A NEW PHONE ALIAS|Hinzufügen einer neuen TEL ALIAS| +Alias ID: |Alias-ID:| +Alias Name: |Alias-Name:| +Phone Logins List: |Telefon Logins Liste:| +PHONE ALIAS NOT ADDED|TEL ALIAS NOT ADDED| +there is already a Phone Alias in the system with this ID|Es gibt bereits eine Telefon-Alias in das System mit dieser ID| +there is already a Phone Login in the system with this ID|Es gibt bereits eine Telefon-Login in das System mit dieser ID| +PHONE ALIAS ADDED|TEL ALIAS ADDED| +PHONE ALIAS NOT MODIFIED|TEL ALIAS NICHT MODIFIZIERT| +PHONE ALIAS MODIFIED|TEL ALIAS VERÄNDERTE| +PHONE ALIAS NOT DELETED|TEL ALIAS nicht gelöscht| +PHONE ALIAS DELETION CONFIRMATION|TEL ALIAS STREICHUNG BESTÄTIGUNG| +Click here to delete phone alias|Klicken Sie hier, um zu löschen Telefon Alias| +PHONE ALIAS DELETION COMPLETED|TEL ALIAS STREICHUNG COMPLETED| +PHONE ALIAS LISTINGS|TEL ALIAS LISTINGS| +there is already a Phone alias in the system with this login|Es gibt bereits eine Telefon-Alias in das System mit diesem Login| +there is already a Phone in the system with this login|Es gibt bereits eine Telefonnummer in das System mit diesem Login| +DELETE THIS PHONE ALIAS|DELETE Dieses Telefon ALIAS| +MODIFY A PHONE ALIAS RECORD|MODIFY A Telefon ALIAS RECORD| +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|Alias-ID - Die ID des Alias verwendet, um für Telefon-Lastenausgleich Logins. keine Leerzeichen oder andere Sonderzeichen erlaubt. Muss zwischen 2 und 20 Zeichen lang sein| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Alias-Name - Der Name für die Bezeichnung eines Handys Alias, muss zwischen 2 und 50 Zeichen lang sein| +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|Telefone Logins List - Das Komma getrennt Liste der Telefonnummern Logins verwendet, wenn ein Agent meldet sich mit Telefon Lastenausgleich Logins. Der Agent-Anwendung finden Sie die Active Server mit den wenigsten Makler eingeloggt ist und ein Anruf aus, dass der Server-Agent bei der Anmeldung| +PHONES WITHIN THIS PHONES ALIAS|PHONES IN DIESER PHONES ALIAS| +Add New Shift|Add New Shift| +New Shift Addition|Neue Shift Zusatz| +Modify Shift|Ändern Shift| +Delete Shift|Löschen Shift| +Shifts|Verschiebungen| +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|Shift-ID - Das ist der kurze Name der Vicidial Shift Definition. Dies muss eine eindeutige Kennung. Verwenden Sie keine Leerzeichen oder Satzzeichen für dieses Feld. max 20 Zeichen, mindestens 2-Zeichen| +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|Shift Name - Dies ist eine beschreibende Bezeichnung der Shift Definition. Dies ist eine kurze Zusammenfassung der Shift Definition. max 50 Zeichen, mindestens 2-Zeichen| +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|Start Time Shift - Es ist an der Zeit, dass die Kampagne Schicht beginnt. Darf nur Zahlen, 9:30 AM wäre 0930 und 5:00 PM wäre 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|Shift Länge - Das ist die Zeit in Stunden und Minuten, dass die Kampagne Schicht dauert. 8 Stunden wäre 08:00 Uhr und 7 Stunden und 30 Minuten würde 07:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Shift Wochentage - In diesem Abschnitt sollten Sie die Tage der Woche, dass diese Verschiebung ist aktiv| +Show Shifts|Show Verschiebungen| +Add A New Shift|Fügen Sie eine neue Schicht| +Shift ID: |Shift-ID:| +Shift Name: |Shift Name:| +Shift Start Time: |Start Time Shift:| +Shift End Time: |Shift End Time:| +SHIFT DEFINITION NOT ADDED|UMSCHALT DEFINITION NICHT HINZUGEFÜGT| +there is already a shift entry with this ID|Es gibt bereits eine Verschiebung Eintrag mit dieser ID| +Shift ID and name must be at least 2 characters in length|Shift-ID und Name muss mindestens 2 Zeichen lang sein| +Shift Start Time must be 4 digits in length and be a valid time|Start Time Shift muss aus 4 Ziffern in der Länge und eine gültige Uhrzeit| +Shift Length must be 5 characters in length and be 24 hours or less|Shift Länge muss mindestens 5 Zeichen lang sein und 24 Stunden oder weniger| +SHIFT ADDED: |UMSCHALT ANGEFÜGT:| +MODIFY A SHIFT|MODIFY A SHIFT| +USER GROUPS USING THIS SHIFT:|USER-Gruppen, die diese Verschiebung:| +DELETE THIS SHIFT DEFINITION|DELETE Diese Verschiebung DEFINITION| +MODIFY A SHIFT|MODIFY A SHIFT| +SHIFT NOT DELETED|UMSCHALT nicht gelöscht| +SHIFT DELETION CONFIRMATION: |UMSCHALT STREICHUNG Bestätigung:| +Click here to delete shift|Klicken Sie hier, um zu löschen Verschiebung| +SHIFT DELETION COMPLETED:|UMSCHALT STREICHUNG fertig gestellt:| +SHIFT MODIFIED|UMSCHALT VERÄNDERTE| +SHIFT LISTINGS:|UMSCHALT LISTINGS:| +Shift Weekdays: |Shift der Woche:| +Sunday|Sonntag| +Monday|Montag| +Tuesday|Dienstag| +Wednesday|Mittwoch| +Thursday|Donnerstag| +Friday|Freitag| +Saturday|Samstag| +Group Shifts: |Gruppe Verschiebungen:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Gruppe Verschiebungen - Dies ist eine Liste der wählbaren Schichten, die sich die Agenten anmelden, Zeit auf dem System| + Timeclock|Timeclock| +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|Timeclock End of Day - Diese Einstellung legt fest, wenn alle Benutzer werden automatisch abgemeldet der timeclock System. Läuft nur einmal pro Tag. darf nur 4 Ziffern 2 Digit Stunden und 2 Minuten in Ziffer 24 Stunden Zeit. Standard ist 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Letzte Timeclock Auto Logout - Dieses Feld zeigt das Datum der letzten Auto-logout| +Timeclock Last Auto Logout: |Letzte Timeclock Auto Logout:| +Timeclock End Of Day: |Timeclock End-of-Day:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|UMFRAGE EINSTELLUNGEN für diese Kampagne:| +Modify Campaign Survey|Ändern Sie den Kampagnen| +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.|Umfrage Erste Audio-Datei - Dies ist der Audio-Datei, die gespielt wird, sobald der Kunde nimmt das Telefon, wenn Sie eine Umfrage Kampagne.| +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 |Umfrage DTMF Digits - Dieses Feld ist, in dem Sie die Zahlen, dass ein Kunde kann Presse als eine Option auf eine Umfrage-Kampagne. gültig von DTMF-Ziffern sind| +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Umfrage nicht interessiert Digit - Dieses Feld ist, wo Sie den Kunden Ziffer gedrückt wird, dass sie nicht daran interessiert sind.| +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.|Umfrage nicht interessiert Status - Dieses Feld ist, wo Sie den Status, der für die nicht interessiert. Wenn DNC verwendet wird und die Kampagne für die Verwendung DNC dann die Telefonnummer wird automatisch auf die interne VICIDIAL DNC Liste.| +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.|Umfrage Opt-in Audio-Datei - Dies ist der Audio-Datei, die gespielt wird, wenn der Kunde hat sich bei der Erhebung, sich nicht-oder nicht reagiert, wenn die Nicht-Antwort-Aktion ist auf OptOut. Nach dieser Audio-Datei gespielt wird, die Umfrage-Methode Maßnahmen ergriffen werden.| +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|Umfrage nicht interessiert Audio Datei - Dies ist der Audio-Datei, die gespielt wird, wenn der Kunde hat sich aus der Umfrage, nicht Opt-in ist oder nicht reagiert, wenn die Nicht-Antwort-Aktion ist auf OptIn. Nach dieser Audio-Datei gespielt wird, wird der Anruf wird dann| +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.|Umfrage-Methode - Diese Option legt fest, was geschieht, auf eine Ausschreibung nach den Kunden hat sich in. AGENT_XFER wird der Anruf an den nächsten verfügbaren Agenten. VOICEMAIL wird der Anruf an die Voicemail-Box, die in den Bereich Voicemail. AUSDEHNUNG wird der Kunde auf die Ausdehnung der Definition in der Umfrage XFER Erweiterung Bereich. HANGUP hängt die Kunden. CAMPREC_60_WAV wird der Kunde auf eine Aufnahme, die mit ihrer Antwort, diese Aufnahme wird in einem Ordner mit dem Namen, wie sich die Kampagne innerhalb der Umfrage Kampagne Aufnahme Directory.| +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.|Umfrage Nr.-Response Action - Hier wird definiert, was passieren wird, wenn es keine Reaktion auf die Umfrage Frage. OptIn wird nur dann den Aufruf an die an der Umfrage-Methode, wenn der Kunde Pressen eine DTMF-Ziffern. OptOut wird der Kunde auf die Umfrage-Methode, auch wenn sie nicht drücken Sie eine DTMF-Ziffern.| +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.|Antworten Digit Karte - Das ist der Abschnitt, in dem Sie eine Beschreibung zu jedem DTMF-Ziffern Option, dass der Kunde auswählen kann.| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Umfrage XFER Extension - , wenn die Methode der Erhebung AUSDEHNUNG ausgewählt ist dann der Kunde Aufruf richten Sie bitte an dieser dialplan Erweiterung| +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.|Umfrage Kampagne Aufnahme der Dienststellen - , wenn die Methode der Erhebung CAMPREC_60_WAV ausgewählt ist dann der Kunde Reaktion wird erfasst und in ein Verzeichnis mit dem Namen nach der Kampagne innerhalb dieses Verzeichnisses.| +SURVEY SETTINGS NOT MODIFIED|UMFRAGE EINSTELLUNGEN NICHT MODIFIZIERT| +SURVEY SETTINGS MODIFIED|UMFRAGE EINSTELLUNGEN MODIFIZIERT| +Survey First Audio File|Umfrage Erste Audio-Datei| +Survey DTMF Digits|Umfrage DTMF Digits| +Survey Not Interested Digit|Umfrage nicht interessiert Digit| +Survey Not Interested Status|Umfrage kein Interesse Status| +Survey Opt-in Audio File|Umfrage Opt-in Audio-Datei| +Survey Not Interested Audio File|Umfrage nicht interessiert Audio-Datei| +Survey Method|Umfrage-Methode| +Survey No-Response Action|Umfrage Nr. Response-Aktion| +Survey Response Digit Map|Antworten Digit Karte| +Survey Xfer Extension|Umfrage XFER Erweiterung| +Survey Campaign Recording Directory|Umfrage Kampagne Aufnahme Directory| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Add Timeclock Log Record - Diese Option ermöglicht es dem Benutzer, um an das timeclock Log| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Ändern Timeclock Log Record - Diese Option ermöglicht es dem Benutzer zu ändern, Einträge in der Log-timeclock| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Löschen der Registrierung Timeclock Record - Diese Option ermöglicht es dem Benutzer zu löschen, Einträge in der Log-timeclock| +Add Timeclock Log Record|Add Timeclock Log Record| +Modify Timeclock Log Record|Ändern Timeclock Log Record| +Delete Timeclock Log Record|Löschen der Registrierung Timeclock Record| +USER GROUP TIMECLOCK STATUS REPORT|USER-GROUP TIMECLOCK DER BERICHT| +Click here to see the Timeclock Status for this user group|Klicken Sie hier, um zu sehen, die Timeclock Status für diese Gruppe| +ADD NUMBERS TO THE DNC LIST|ADD Nummern auf dem DNC-LISTE| +Phone Numbers: |Telefon-Nummern:| +one phone number per line only|einer Telefonnummer pro Zeile nur| +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|VICIDIAL DNC Liste - Diese Dont Call Liste enthält alle führen, die auf einen Status der DNC in das System. Durch die Listen - ADD Nummer DNC Seite können Sie manuell hinzufügen, Zahlen zu dieser Liste, so dass sie nicht durch Kampagnen, die die interne Liste DNC| + Time Sheet |Time Sheet| +Timeclock Record Edit|Timeclock Datensatz bearbeiten| +Default date format with year month day|Standard-Datum-Format Jahr Monat Tag| +USA date format with month day year|USA Datum-Format mit Monat Tag Jahr| +European date format with day month year|Europäische Datumsformat mit Tag Monat Jahr| +Text date format with abbreviated month day|Text-Format mit Datum abgekürzt Monat Tag| +followed by 24 hour time|gefolgt von 24-Stunden-Zeit| +followed by 12 hour time|gefolgt von 12-Stunden-Zeit| +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|Agent Screen Header Datum Format - Mit diesem Menü können Sie das Format des Datums, das zeigt sich an der Spitze der VICIDIAL Agent Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist| +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|Agent Screen Kunden Datum Format - Mit diesem Menü können Sie das Format des Kunden Zeitzone Datum, zeigt sich an der Spitze der Customer Information des VICIDIAL Agent Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist| +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|Agent Screen Kunden Telefon Format - Mit diesem Menü können Sie das Format des Kunden Rufnummer, zeigt sich in den Status des Agenten VICIDIAL Bildschirm. Die Optionen für diese Einstellung sind: In der Voreinstellung ist| +dash separated phone number|Bindestrich getrennt Telefonnummer| +dash separated number with area code in parenthesis|Bindestrich getrennt Nummer mit Vorwahl in Klammern| +No formatting|Keine Formatierung| +with space after city code|mit Leerzeichen nach Stadt-Code| +space separated phone number|Leerzeichen getrennt Telefonnummer| +Agent Screen Header Date Format|Agent-Header Datum Screen Format| +Agent Screen Customer Date Format|Agent Screen Kunden Datum Format| +Agent Screen Customer Phone Format|Agent Screen Kunden Telefon Format| +ERROR- There is a problem with the data that you entered, please go back|ERROR-Es gibt ein Problem mit den Daten, die Sie eingegeben haben, gehen Sie bitte zurück| +A timeclock session cannot overlap another timeclock session|Ein timeclock Tagung können sich nicht ein anderes timeclock Sitzung| +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|Deaktivieren Alter Customer Telefon - Bei der Einstellung Y, ändert nichts an den Kunden die Telefonnummer, wenn ein Agent Verfügungen den Anruf zu tätigen. Der Standardwert ist Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agent API-Zugang - Diese Option ermöglicht es, das Konto für die Verwendung mit der vicidial Agenten-API-Befehle| +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|Agent Alter Kunden Telefon Override - Mit dieser Option werden die unabhängig von der Option ist in der Kampagne für die Änderung der Kunde die Rufnummer ein. NOT_ACTIVE wird unabhängig Einstellung ist für die Kampagne. ALLOW_ALTER wird immer für den Agenten, um die Kunden-Nummer, egal, was die Kampagne Einstellung. Der Standardwert ist NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|Agent API Active - Wenn auf 1 gesetzt, wird die Agent-API-Schnittstelle zu funktionieren. Standard ist 0| +Agent Alter Customer Phone Override: |Agent Alter Kunden Telefon AllowOverride:| +Agent API Access: |Agent API-Zugang:| +Disable Alter Customer Phone: |Deaktivieren Alter Kunde Telefon:| +Agent API Active: |Agent API Active:| +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|Agent Display Queue Count - Wenn Sie auf Y, wenn ein Kunde wartet auf einen Agenten, der Queue fordert Display oben auf der Agenten-Bildschirm wird rot und zeigen die Anzahl der wartenden Anrufe. Der Standardwert ist Y| +Agent Display Queue Count: |Agent Display Queue Count:| +agents in dead calls|Agenten in fordert Toten| +QC Last Pull Time: |QC Letzte Pull Zeit:| +and less than 43200 seconds or 12 hours|und weniger als 43.200 Sekunden oder 12 Stunden| +LEADS AT LIMIT|LEADS AT LIMIT| +Lead counts taken from active lists in the campaign only|Blei zählt, die aus dem aktiven Listen in der Kampagne nur| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|QC Get Record Launch- Auf diese Weise können Sie eine der folgenden Aktionen ausgelöst werden dürfte, auf einem QC Agenten erhalten einen neuen Rekord| +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|QC Show Recording - Auf diese Weise können für eine Aufnahme, die im Zusammenhang mit der QC-Datensatz werden in der QC-Agent-Bildschirm| +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|QC Shift - Das ist die Verlagerung Zeitrahmen für die Pull-QC-Datensätze für eine Kampagne. Die Tage der Woche sind nicht für diese Funktionen| +QC Get Record Launch|QC Get Record Launch| +QC Show Recording|QC Show-Aufnahme| +QC Shift|QC-Shift| +Inbound Group QC Settings|Inbound-Fraktion QC Einstellungen| +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|QC Shift - Das ist die Verlagerung Zeitrahmen für die Pull-QC-Datensätze für eine inbound_group. Die Tage der Woche sind nicht für diese Funktionen| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|Der Verkauf Kategorie und Dead Lead Kategorie sind auch die von den US-Vorschlag, wenn die Analyse Liste Statistiken.| +Sale Category: |Verkauf Kategorie:| +Dead Lead Category: |Dead Lead Kategorie:| +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|Manual Dial Filter - Auf diese Weise können Sie zum Filtern der Anrufe, die Agenten sind im manuellen Modus wählen Sie für diese Kampagne durch eine Kombination der folgenden: DNC - die Kick Out, CAMPAIGNLISTS - die Zahl muss innerhalb der Listen für die Kampagne KEINE - kein Filter auf manuelle Einwahl oder schnelle Einwahl Listen| +Manual Dial Filter: |Manual Dial Filter:| +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|Agent Screen Zwischenablage kopieren - Diese Funktion ist derzeit nur in die Lage für den Internet Explorer. Diese Funktion ermöglicht es Ihnen, wählen Sie einen Bereich, der kopiert werden an den Computer Zwischenablage des Maklers Computer auf einen Anruf wird an einen Agenten. Häufig verwendet für diese sind, damit für die einfache Einfügen von Kontonummern oder Telefonnummern in Legacy-Anwendungen auf dem Client-Agent-Computer| +Agent Screen Clipboard Copy|Agent Screen Zwischenablage kopieren| +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.|EXTENDED stellvertretenden Zahlen sind die Zahlen in das System außerhalb der Standard-Bildschirm führen. Mit Extended können Sie Hunderte von Telefonnummern für einen einzigen Kunden aufnehmen.| +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|Agent Screen Erweiterte Alt Dial - Diese Funktion erlaubt es Agenten für den Zugriff auf erweiterte stellvertretenden Telefonnummern führt über die Standard-Telefon-und Alt Address3 Felder, die verwendet werden können in VICIDIAL für Telefonnummern außerhalb der Haupt-Telefonnummer. Die Ausdehnung Telefonnummern gewählt werden können automatisch über die Auto-Alt-Dial-Funktion in VICIDIAL Kampagne Einstellungen, aber die Aktivierung dieser Agent Screen-Funktion wird auch für den Agenten, um diese Zahlen aus ihrer Bevollmächtigten Bildschirm sowie Informationen zu bearbeiten| +Agent Screen Extended Alt Dial:|Agent Screen Erweiterte Alt Zifferblatt:| +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.|Verwenden Sie Kampagne DNC List - Diese legt fest, ob dieser Kampagne ist es, Filter führt gegen eine DNC-Liste, die sich speziell auf die Kampagne nur. Wenn es auf Y, der Trichter wird für jede Telefonnummer in der Kampagne-spezifische DNC-Liste, bevor sie in den Trichter. Wenn es in der Kampagne-spezifische DNC Liste, dann wird sich ändern, die Status DNCC, so kann er nicht gewählt werden. Der Standardwert ist N.| +Use Campaign DNC List|Verwenden Sie Kampagne DNC Liste| +and possibly the campaign-specific DNC list|und möglicherweise die Kampagne-spezifische DNC Liste| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Es besteht auch die Option, mit der Sie führt zu der Kampagne DNC-spezifische Listen für die Kampagnen, die sie| +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|Hinweis: Das Kopieren einer Kampagne kopiert alle Einstellungen aus dem Master-Kampagne, die Sie wählen, aber es wird nicht kopiert eine Kampagne-spezifische DNC, wenn es eine auf dem ausgewählten Master-Kampagne| +Add New |Add New| +Copy |Kopieren| +New DID Addition|Neue DID-Zusatz| +New Copied DID Addition|Neue Copied DID-Zusatz| +Modify |Ändern| +Delete |Löschen| +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|Jetzt in den Line - Diese legt fest, ob die Anrufer hören, ihren Platz in der Zeile, wenn sie in der Warteschlange als auch, wenn sie hören, die announcemend. Der Standardwert ist 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|Jetzt Geschätzte Hold Time - Diese legt fest, ob die Anrufer hören, halten Sie die geschätzte Zeit, bevor sie übertragen werden, zu einem Makler. Der Standardwert ist 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|Hold Time Option - Auf diese Weise können Sie die Weiterleitung von den Anruf halten, wenn die geschätzte Zeit über dem Betrag von Sekunden aus. Der Standardwert ist KEINE| +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|Hold Time Option Sekunden - Wenn Hold Time-Option ist gesetzt, was aber keiner, das ist die Anzahl der Sekunden des geschätzten halten auslösen wird Zeit, dass die Hold-Zeit-Option. Der Standardwert ist 360 Sekunden| +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|Hold Time Option Extension - Wenn Hold Time-Option auf Verlängerung, ist dies die dialplan, dass sich die Aufforderung an, wenn der geschätzte halten länger als die Hold Time Option Sekunden| +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|Hold Time Option Voicemail - Wenn Hold Time auf Voicemail, das ist die Voice-Mailbox, dass der Anruf an, wenn der geschätzte halten länger als die Hold Time Option Sekunden| +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|Hold Time Option Transfer In-Group - Wenn Hold Time-Option ist auf IN_GROUP, das ist die Gruppe, dass die eingehenden Anruf werden, wenn der geschätzte halten länger als die Hold Time Option Sekunden| +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|Hold Time Option Rückruf Dateiname - Wenn Hold Time-Option ist auf CALLERID_CALLBACK, Dies ist der Dateiname ein, dass gespielt wird, bevor der Anruf wird protokolliert, als eine neue dazu führen, dass die ID-Liste unten, wenn der geschätzte halten länger als die Hold Time Option Sekunden| +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|Hold Time Option Liste Rückruf-ID - Wenn Hold Time Option ist auf CALLERID_CALLBACK, Dies ist die Liste der Anruf-ID wird als neues führen, wenn der geschätzte halten länger als die Hold Time Option Sekunden| +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|Hold Recall Transfer In-Group - Wenn ein Kunde, um zu dieser Gruppe mehr als einmal, und das ist nicht auf None gesetzt wird, dann wird der Anruf automatisch an das In-Gruppe in diesem Bereich ausgewählt . Der Standardwert ist KEINE| +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|Nr. Delay Call Route - Wenn Sie diesen auf Y werden alle Wartezeiten und akustische und versuchen, den Anruf zu einem Agenten. Nicht überschreiben Willkommensnachricht oder halten Prompt Einstellungen. Der Standardwert ist 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|Jetzt Grußwort - Diese Einstellungen wählen Sie, wann Sie spielen die definierten Willkommensnachricht, immer spielen sie jedes Mal, nie nie spielen, IF_WAIT_ONLY nur spielen die Welcome-Nachricht, wenn die Forderung nicht sofort zu einem Agenten , und YES_UNLESS_NODELAY immer spielen die Welcome-Nachricht, es sei denn, die NO_DELAY Einstellung aktiviert ist. Der Standardwert ist IMMER| +Play Place in Line: |Jetzt im Einklang:| +Play Estimated Hold Time: |Jetzt Geschätzte Hold Time:| +Hold Time Option: |Hold Time Option:| +Hold Time Option Seconds: |Hold Time Option Sekunden:| +Hold Time Option Extension: |Hold Time Option Extension:| +Hold Time Option Voicemail: |Hold Time Option Voicemail:| +Hold Time Option Transfer In-Group: |Hold Time Option Transfer In-Group:| +Hold Time Option Callback Filename: |Hold Time Option Rückruf Dateiname:| +Hold Time Option Callback List ID: |Hold Time Option Liste Rückruf-ID:| +Hold Recall Transfer In-Group: |Hold Recall Transfer In-Group:| +No Delay Call Route: |Nr. Delay Call Route:| +Play Welcome Message: |Jetzt Grußwort:| +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|DID-Erweiterung - Das ist die Zahl, die Erweiterung oder das getan hat, löst diesen Eintrag, und dass Sie Route innerhalb des Systems mit dieser Funktion| +DID Description -<\/B> This is the description of the DID routing entry|DID-Beschreibung - Das ist die Beschreibung von der DID-Routing-Eintrag| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DID-Active - Das ist der Bereich, in dem Sie die DID Eintrag aktiv oder nicht. Der Standardwert ist 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|DID-Route - Diese Art der Route, die Sie der DID zu verwenden. Verlängerung wird ersucht, um die Erweiterung in unten, Voicemail senden Anrufe direkt an die Voicemail-Box eingetragen unter, der Agent wird Gespräche auf eine VICIDIAL Agenten, wenn sie angemeldet sind, TEL wird der Anruf zu einem ausgewählten Eintrag Telefone unter, IN_GROUP wird Senden Sie Anrufe direkt auf die angegebene Inbound-Gruppe. Standard ist die Erweiterung| +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|Extension - , wenn die Erweiterung ist als der DID-Route, dann ist dies die Erweiterung dialplan, dass Anrufe werden an. Der Standardwert ist 9998811112, no-Service| +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|Erweiterung Kontext - , wenn die Erweiterung ist als der DID-Route, dann ist dies die dialplan Zusammenhang, dass Anrufe werden an. Die Voreinstellung ist Standard| +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|Voicemail-Box - Wenn Voicemail ist als der DID-Route, dann ist dies die Voicemail-Box, die Anrufe werden an. Der Standardwert ist leer| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Telefon Extension - Wenn PHONE ist als der DID-Route, dann ist das Telefon-Erweiterung, wird der Aufruf an.| +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|Server-IP-Telefon - Wenn PHONE ist als der DID-Route, dann ist dies der Server-IP-Telefon für die Erweiterung, die Anrufe werden an| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|User Agent - Wenn agent ist als der DID-Route, dann ist dies die VICIDIAL Agent, dass Anrufe werden an| +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|User-Aktion nicht verfügbar - Wenn agent ist als der DID-Route, und der Benutzer ist nicht angemeldet oder verfügbar sind, dann ist dies der Weg, den die Anrufe wird| +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|User-Einstellungen Route In-Group - Wenn agent ist als der DID-Route, dann ist dies die In-Group, die verwendet werden für die Queue-Einstellungen wie der Anrufer wartet, die an den Agenten. Der Standardwert ist 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|In-Group-ID - Wenn IN_GROUP ist als der DID-Route, dann ist dies die In-Group, die Anrufe werden an| +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|In-Group Call Griff Methode - Wenn IN_GROUP ist als der DID-Route, dann ist dies die Forderung Umgang Methode für diese Anrufe. CID wird eine neue Aufnahme führen mit jedem Anruf über die CallerID wie die Telefonnummer, CIDLOOKUP Lookup wird versuchen, die Telefonnummer von der CallerID im gesamten System, CIDLOOKUPRL wird attampt und auf die Telefonnummer von der CallerID nur in einem bestimmten Verzeichnis , CIDLOOKUPRC wird attampt und auf die Telefonnummer von der CallerID in allen von den Listen, die zu den angegebenen Kampagne, näher ist für VICIDIAL engere fordert ANI wird eine neue Aufnahme führen mit jedem Anruf mit der ANI wie die Telefonnummer, ANILOOKUP Lookup wird versuchen, die Telefonnummer von der ANI in das gesamte System, ANILOOKUPRL wird attampt und auf die Telefonnummer von der ANI nur in einem bestimmten Verzeichnis, XDIGITID wird der Anrufer für einen X-stelligen Code vor dem Aufruf wird in Betrieb genommen werden der Warteschlange. Der Standardwert ist 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|In-Group-Agent Suche Methode - Wenn IN_GROUP ist als der DID-Route, dann ist dies der Agent Suche Methode für die Inbound-Gruppe, LO ist Load-Balanced-Overflow und versuchen um den Ruf zu senden einem Agenten auf dem lokalen Server, bevor Sie versuchen, senden Sie sie an einen Agenten auf einem anderen Server, Load-LB ist ausgewogen und wird versuchen, um den Ruf zu senden, um zur nächsten Agent-Server, egal was sie sind, so ist nur Server-und nur versuchen, die Forderungen an Agenten auf dem Server, dass der Anruf kam auf. Der Standardwert ist 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|In-Group-ID-Liste - Wenn IN_GROUP ist als der DID-Route, dann ist dies die ID-Liste führt, dass kann man suchen, durch und führt werden, wenn notwendig, in| +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|In-Group-ID-Kampagne - Wenn IN_GROUP ist als der DID-Route, dann ist dies die Kampagnen-ID, was kann man suchen, wenn das Gespräch mit Methode ist 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|In-Group Telefon Code - Wenn IN_GROUP ist als der DID-Route, dann ist das Telefon-Code verwendet, wenn eine neue Führung wird erstellt| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Telefon E-Mail - Die E-Mail-Adresse im Zusammenhang mit diesem Telefon-Eintrag. Dies ist für die Mailbox-Einstellungen| +ADD A NEW DID|Hinzufügen einer neuen DID| +DID Extension: |DID-Erweiterung:| +DID Description: |DID-Beschreibung:| +COPY DID|COPY DID| +Source DID: |Quelle DID:| +DID NOT ADDED|NICHT HINZUGEFÜGT| +there is already a DID in the system with this ID|Es gibt bereits eine DID in das System mit dieser ID| +there is already a DID in the system with this extension|Es gibt bereits eine DID in das System mit dieser Erweiterung| +DID NOT MODIFIED|NICHT MODIFIZIERT| +DID MODIFIED|DID VERÄNDERTE| +MODIFY A DID RECORD: |MODIFY eine DID RECORD:| +DID Route: |DID-Route:| +Extension: |Erweiterung:| +Extension Context: |Erweiterung Kontext:| +Voicemail Box: |Voicemail-Box:| +Phone Extension: |Tel. Durchwahl:| +User Agent: |User Agent:| +User Unavailable Action: |User-Aktion nicht verfügbar:| +User Route Settings In-Group: |User-Einstellungen In Route-Gruppe:| +In-Group ID: |In-Group-ID:| +In-Group Call Handle Method: |In-Group Call Griff Methode:| +In-Group Agent Search Method: |In-Group-Agent Suche Methode:| +In-Group List ID: |In-Group US-ID:| +In-Group Campaign ID: |In-Group Kampagnen-ID:| +In-Group Phone Code: |In-Group Telefon Code:| +DELETE THIS DID|DELETE Das war| +Email: |E-Mail:| +DID NOT DELETED|NICHT GELÖSCHT| +DID DELETION CONFIRMATION|DID STREICHUNG BESTÄTIGUNG| +Click here to delete |Klicken Sie hier, um zu löschen| +DID DELETION COMPLETED|DID STREICHUNG COMPLETED| +Delete DIDs: |Löschen DIDS:| +Modify DIDs: |Ändern DIDS:| +To disable the On Hold Prompt, set the interval to 0|So deaktivieren Sie die On-Hold-Prompt, das Intervall auf 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|3-Wege-Call Outbound CallerID - Diese legt fest, was gesendet wird, wie der Ausgang CallerID Reihe von 3-Wege-Anrufe, die von den Agenten, die Kampagne verwendet die eigene Kampagne CallerID, Kunde nutzt die Zahl der Kunden ist, dass aktive auf dem Bildschirm und Agenten AGENT_PHONE verwendet die CallerID für das Telefon, dass der Agent angemeldet ist, in| +3-Way Call Outbound CallerID:|3-Wege-Call Outbound CallerID:| +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 ermöglicht es dem Agenten, um manuelle Einwahl Anrufe von einer Kampagne Liste, während in der Lage, die eingehenden Anrufe zwischen manuelle Einwahl fordert| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|FORCE wird erzwungen, dass der Makler, um eine PAUSE-Code, wenn sie klicken Sie auf die PAUSE-Taste| +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|3-Wege-Call-Vorwahl - Diese legt fest, was als Vorwahl für 3-Wege-Anrufe, standardmäßig ist leer, so dass die Kampagne Vorwahl verwendet wird, so können Sie passthru Klingelton hören ist 88| +3-Way Call Dial Prefix|3-Wege-Call-Vorwahl| +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|Force Timeclock Login - Diese Option ermöglicht es Ihnen, nicht zulassen, ein Agent der Anmeldung an der VICIDIAL Agent-Schnittstelle, wenn sie nicht angemeldet haben, in die timeclock. Der Standardwert ist N. Es ist eine Option zu befreien admin Benutzer, Stufen 8 und 9| +Force Timeclock Login|Force Timeclock Login| +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|Statistiken Prozent der Anrufe innerhalb von X Sekunden - In diesem Feld können Sie die Anzahl der Sekunden, halten Sie die Echtzeit-Statistiken angezeigt wird zur Berechnung der Anteil der Anrufe, die beantwortet wurden beantwortet X Anzahl von Sekunden zu halten| +Stats Percent of Calls Answered Within X seconds|Statistiken Prozent der Anrufe innerhalb von X Sekunden| +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.|Web Form-Target- Hier können Sie die eigene Web-Seite, dass der Rahmen Web-Formular wird geöffnet, wenn der Nutzer auf die Web Form-Taste. Der Standardwert ist _blank.| +Web Form Target|Web Form-Target| +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|So passen Sie die Abfragezeichenfolge nach dem Web-Formular, einfach beginnen, die Web-Formular mit VAR und dann die URL, die Sie verwenden möchten, ersetzt die Variablen mit den Variablen-Namen, die Sie verwenden möchten - A - phone_number - B -- genau wie in der Registerkarte SCRIPTS Abschnitt| +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|Aufnahme Web-Link - Diese Einstellung erlaubt es Ihnen, sich über die Standard in der Anzeige der Aufnahme-Link im Admin-Web-Seiten. Der Standardwert ist 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|Alternate Recording Server IP - Diese Einstellung können Sie eine Server-IP oder andere Rechner-Namen ein, kann anstelle der server_ip in die Links zu den Aufnahmen in der Admin-Web-Seiten. Der Standardwert ist leer| +Recording Web Link|Aufnahme Web-Link| +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|Aktivieren vtiger Integration - Diese Einstellung erlaubt es Ihnen zu ermöglichen vtiger Integration mit VICIDIAL. Derzeit Links zu vtiger admin und als auch als Nutzer Replikation sind die einzigen Integration Features zur Verfügung stehen. Standard ist 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|Vtiger HE Server IP - Das ist die IP-Adresse der Datenbank für Ihre vtiger-Installation| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Vtiger Datenbankname - Dies ist die Datenbank-Namen für Ihre Datenbank vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Vtiger Datenbank Login - Das ist die Benutzernamen verwendet, um sich in Ihrem vtiger-Datenbank| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Vtiger Passwort für die Datenbank - Dies ist das Passwort für die Anmeldung in Ihrem vtiger-Datenbank| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|Vtiger URL - Das ist die URL oder Website-Adresse, um an Ihr vtiger-Installation| +Enable Vtiger Integration:|Aktivieren vtiger Integration:| +Vtiger DB Server IP|Vtiger HE Server IP| +Vtiger Database Name|Vtiger Datenbank Name| +Vtiger Database Login|Vtiger Datenbank Login| +Vtiger Database Password|Vtiger Passwort für die Datenbank| +Vtiger URL|Vtiger URL| +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|Active - Dieses Feld legt fest, ob der Benutzer in das System und können VICIDIAL Ressourcen. Der Standardwert ist Y| +show only active users|Nur aktive Benutzer| +show all users|Alle Nutzer anzeigen| +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|Vtiger Suche Kategorie - Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung definieren, wo die vtiger_search.php Seite wird nach der Telefonnummer, die eingegeben wurde. Es gibt 4 Möglichkeiten, die genutzt werden kann in diesem Bereich: Lead-Diese Option wird die Suche durch die vtiger führt nur, Konto-Diese Option wird durch die Suche und vtiger alle Kontakte und sub-Kontakte für die Telefonnummer, Vendor-Diese Option wird nur durch die Suche vtiger Lieferanten, ACCTID-Diese Option funktioniert nur für Konten, und es wird die vicidial vendor_lead_code Bereich und versuchen Sie es um die Suche nach der vtiger-Konto-ID. Wenn es erfolglos versucht, andere Methoden zu finden, die Sie ausgewählt haben. Mehrere Optionen können verwendet werden, für jede Suche, sondern auf großen Datenbanken ist dies nicht empfohlen. Der Standardwert ist BLEI| +Vtiger Search Category:|Vtiger Suche Kategorie:| +ACTIVE LISTS CHANGED|ACTIVE LISTEN CHANGED| +SUBMIT ACTIVE LIST CHANGES|SUBMIT AKTIVEN LISTE ÄNDERUNGEN| +LAST CALL DATE|LAST CALL DATUM| +User Group Bulk Change|User Group Bulk ändern| +Bulk Group Change|Bulk-Gruppe ändern| +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 Erstellen Call Record - Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung festlegen, ob eine neue vtiger Aktivität wird für den Anruf, wenn der Agent geht an die vtiger_search Seite. Der Standardwert ist Y| +Vtiger Create Call Record:|Vtiger Erstellen Call Record:| +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|Vtiger Erstellen Lead Record - Wenn vtiger Integration aktiviert ist in den System-Einstellungen und vtiger Suche Kategorie umfasst BLEI, dann wird diese Einstellung festlegen, ob eine neue vtiger führen wird erstellt, wenn der Agent geht an die vtiger_search Seite und wird nicht festgestellt, dass die Call-Telefonnummer. Der Standardwert ist Y| +Vtiger Create Lead Record:|Vtiger Erstellen Lead Record:| +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|Vtiger Login Screen - Wenn vtiger Integration aktiviert ist in den System-Einstellungen, dann wird diese Einstellung festlegen, ob der Benutzer angemeldet ist in der vtiger-Schnittstelle automatisch, wenn sie zur Anmeldung VICIDIAL. Der Standardwert ist Y| +Vtiger Screen Login:|Vtiger Login Screen:| +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|Alarm aktiv - Dieses Feld zeigt an, ob der Agent hat Warnungen Web-Browser aktiviert, wenn Anrufe in Berührung kommen, ihre vicidial.php Sitzung. Der Standardwert ist 0 für NO| +Alert Enabled:|Alarm aktiv:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|QC Funktionen Active - Mit dieser Option können Sie aktivieren oder deaktivieren Sie die QC oder Quality Control-Funktionen. Der Standardwert ist 0 für inaktiv| +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|Outbound Auto-Dial Active - Mit dieser Option können Sie aktivieren oder deaktivieren Sie ausgehende Auto-Einwahl in VICIDIAL, in diesem Bereich auf 0 werden die Listen und Filter Abschnitte und viele Felder aus der Kampagne Änderung Bildschirme. Manuelle Eingabe Wählfeld wird noch innerhalb der zulässigen Agent-Bildschirm, aber keine Liste Einwahl möglich sein wird. Der Standardwert ist 1 für aktive| +QC Features Active:|QC Funktionen aktiv:| +Outbound Auto-Dial Active:|Outbound Auto-Dial Aktiv:| +Close Panel|Fenster schließen| +Choose Report Display Options|Wählen Sie Report anzeigen Optionen| +To select more than 1 campaign, hold down the Ctrl key and click|Um mehr als 1 Kampagne, halten Sie die Strg-Taste gedrückt und klicken Sie auf| +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|CPD AMD Action - Wenn Sie die Sangoma ParaXip Rufen Fortschritte Detection-Software, dann werden Sie zum Aktivieren dieser Einstellung, entweder sie DISPO, die Disposition der Anruf als AA und hängen Sie es, wenn der Anruf wird bearbeitet und wurde nicht gesendet, um noch ein Agent oder eine Nachricht zu senden, die den Aufruf der Anrufbeantworter die Nachricht für diese Kampagne. Standardwert ist deaktiviert| +CPD AMD Action:|CPD AMD Aktion:| +Click here for user multiple day status detail report|Klicken Sie hier für die Benutzer mehrere Tage Status ausführlicher Bericht| +Click here to download this list|Klicken Sie hier, um diese Liste| +Download Lists:|Download-Listen:| +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|Active Server Asterisk - , wenn Asterisk läuft nicht auf diesem Server, oder, wenn VICIDIAL sollten nicht mit diesem Server, oder, wenn es nur mit diesem Server für andere Skripte wie die Be-Hopper Skript ausführen möchten, um dies zu N. Standard ist 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|Conf-Dateien erzeugen - Wenn Sie möchten, dass das System für die automatische Generierung von Sternchen conf-Dateien auf der Grundlage der Telefone Einträge, Träger Einträge und Load-Balancing-Setup in VICIDIAL dann dies auf Y. Der Standardwert ist 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|Rebuild conf Dateien - Wenn Sie wollen, um einen Wiederaufbau der Asterisk conf-Dateien, oder wenn eines der Handys oder Carrier-Einträge geändert haben, dann sollte so eingestellt werden, dass Y. Nach der conf-Dateien wurden erzeugt und Asterisk hat wurden neu geladen, so wird diese Veränderung zu N. Voreingestellt ist Y| +Active Asterisk Server:|Aktive Asterisk Server:| +Generate conf files:|Conf-Dateien erzeugen:| +Rebuild conf files:|Rebuild conf-Dateien:| +Show Templates|Show-Vorlagen| +Add A New Template|Fügen Sie eine neue Vorlage| +ADD NEW CONF TEMPLATE|Neue CONF TEMPLATE| +ADD NEW CARRIER|ADD NEW CARRIER| +ADDING NEW CONF TEMPLATE|Neue CONF TEMPLATE| +ADDING NEW CARRIER|Neue CARRIER| +MODIFY CONF TEMPLATE|MODIFY CONF TEMPLATE| +MODIFY CARRIER|MODIFY CARRIER| +DELETE CONF TEMPLATE|DELETE CONF TEMPLATE| +DELETE CARRIER|DELETE CARRIER| +CONF TEMPLATE LIST|CONF Vorlagenliste| +CARRIER LIST|CARRIER LISTE| +Template ID:|Vorlagen-ID:| +Template Name:|Template Name:| +Template Contents:|Template-Inhalt:| +Carrier ID:|Carrier-ID:| +Carrier Name:|Carrier Name:| +Registration String:|Anmeldung String:| +Account Entry:|Account-Eintrag:| +Protocol:|Protokoll:| +Globals String:|Globals String:| +Dialplan Entry:|Dialplan Eintrag:| +CONF TEMPLATE NOT ADDED|CONF-Templates nicht ADDED| +there is already a template in the system with this ID|Es gibt bereits eine Vorlage in das System mit dieser ID| +CONF TEMPLATE ADDED|CONF TEMPLATE ADDED| +CARRIER NOT ADDED|CARRIER NOT ADDED| +there is already a carrier in the system with this ID|Es gibt bereits ein Luftfahrtunternehmen in das System mit dieser ID| +CONF TEMPLATE NOT MODIFIED|CONF-Templates nicht VERÄNDERTE| +CARRIER NOT MODIFIED|CARRIER NICHT MODIFIZIERT| +CARRIER MODIFIED|CARRIER VERÄNDERTE| +CONF TEMPLATE NOT DELETED|CONF TEMPLATE nicht gelöscht| +Template ID be at least 2 characters in length|Vorlagen-ID von mindestens 2 Zeichen lang sein| +CONF TEMPLATE DELETION CONFIRMATION|CONF TEMPLATE STREICHUNG BESTÄTIGUNG| +Click here to delete conf template|Klicken Sie hier, um zu löschen conf Vorlage| +CARRIER NOT DELETED|CARRIER nicht gelöscht| +Carrier ID be at least 2 characters in length|Carrier-ID von mindestens 2 Zeichen lang sein| +CARRIER DELETION CONFIRMATION|CARRIER STREICHUNG BESTÄTIGUNG| +Click here to delete carrier|Klicken Sie hier, um zu löschen Träger| +CONF TEMPLATE DELETION COMPLETED|CONF TEMPLATE STREICHUNG COMPLETED| +CARRIER DELETION COMPLETED|CARRIER STREICHUNG COMPLETED| +MODIFY A CONF TEMPLATE RECORD|MODIFY A CONF TEMPLATE RECORD| +DELETE THIS CONF TEMPLATE|DELETE THIS CONF TEMPLATE| +MODIFY A CARRIER RECORD|MODIFY A RECORD CARRIER| +DELETE THIS CARRIER|DELETE THIS CARRIER| +CARRIERS WITHIN THIS SERVER|CARRIERS IN DIESEM SERVER| +CONF TEMPLATE LISTINGS|CONF TEMPLATE LISTINGS| +CARRIER LISTINGS|CARRIER LISTINGS| +PHONES USING THIS CONF TEMPLATE|PHONES SIE DIESE CONF TEMPLATE| +CARRIERS USING THIS CONF TEMPLATE|CARRIERS SIE DIESE CONF TEMPLATE| +Conf Override:|Conf AllowOverride:| +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|Vorlagen-ID - Dieses Feld muss mindestens 2 Zeichen lang sein und nicht mehr als 15 Zeichen lang sein, kein Leerzeichen. Dies ist die ID, die verwendet werden, um die conf Vorlage des gesamten Systems| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Template Name - Dies ist der beschreibende Name der Conf-Datei-Vorlage Eintrag| +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|Template Inhalt - Dieses Feld ist, wo können Sie in den Einstellungen, die von allen Telefonen und-oder Luftfahrtunternehmen, die für die Verwendung dieser Vorlage conf. Bereiche, die nicht in diesem Feld sind: geheim, accountcode, Konto, Benutzernamen und 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|Carrier ID - Dieses Feld muss mindestens 2 Zeichen lang sein und nicht mehr als 15 Zeichen lang sein, kein Leerzeichen. Dies ist die ID, die verwendet werden, um die Träger für diesen speziellen Eintrag im gesamten System| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Carrier Name - Dies ist der beschreibende Name des Beförderers Eintrag| +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|Anmeldung String - Dieses Feld ist, wo können Sie in die genaue String benötigt, der SIP-oder IAX-Konfigurations-Datei zu registrieren, um den Anbieter. Optional, aber dringend empfohlen, wenn Ihr durch die Registrierung| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|Vorlagen-ID - Dieses optionale Feld ermöglicht es Ihnen, wählen Sie eine conf-Datei-Vorlage für dieses Luftfahrtunternehmen Eintrag| +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|Konto-Eintrag - Dieses Feld wird verwendet, wenn Sie nicht ausgewählt haben eine Vorlage zu verwenden, und es ist, wo können Sie in den spezifischen Einstellungen, die für diesen Träger| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Protokoll - Mit diesem Feld können Sie festlegen, das Protokoll zu verwenden für die Carrier-Eintrag. Derzeit werden nur IAX-und SIP unterstützt werden| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|Global String - Dieses optionale Feld können Sie die Definition einer globalen Variablen, die für die Träger in der dialplan| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Dialplan Eintrag - Dieses optionale Feld können Sie festlegen, eine Reihe von dialplan Einträge, die für diesen Träger| +Server IP -<\/B> This is the server that this specific carrier record is associated with|Server IP - Dies ist der Server, dass dieser besondere Träger wird im Zusammenhang mit| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Active - Diese legt fest, ob der Träger wird in den automatisch generierten conf-Dateien oder nicht| +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|Conf Einstellungen - Wenn besiedelt, und die Template-ID eingestellt ist - KEINE -, dann der Inhalt dieses Feldes werden als die conf-Datei-Einträge für dieses Telefon. generate_vicidial_conf für diese Telefone Server muss so eingestellt werden, dass Y für diese zu arbeiten. Dieses Feld sollte nicht die [Erweiterung] Linie, das wird automatisch generiert| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|Vorlagen-ID - Das ist die conf Datei template-ID, die dieses Telefon-Eintrag wird für die Asterisk-Einstellungen. Standard ist - KEINE --| +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|Wenn Sie sich in eingehenden Anrufen von diesem Luftfahrtunternehmen Stamm möchten Sie vielleicht die context = trunkinbound in diesem Bereich, so dass Sie verwenden können, der DID-Handling innerhalb 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|Es ist ein Standard DID vorbehalten, die Sie verwenden können, die nur das Wort-default-ohne Bindestriche, Allos, die Sie senden jede Aufforderung, die nicht mit einer anderen bestehenden Muster auf den Standard DID| +Campaign VDAD extension|Kampagne VDAD Erweiterung| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Dieses Feld erlaubt eine kundenspezifische Erweiterung VDAD Übertragung. Auf diese Weise können Sie verschiedene Call-Handling-Methoden je nach Ihrer Kampagne.| + - 8364 - same as 8368|- 8364 - wie 8368| + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - wird die Forderung nur einem Agenten auf demselben Server wie der Anruf auf| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Wird für die Presse-1 und Umfrage-Kampagnen| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - wird versuchen, zunächst schicken Sie die Forderung nach einem Agenten auf dem lokalen Server, dann wird es sich auf einem anderen Server| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - Standard? Wird der Anruf an den nächsten verfügbaren Agenten-Server, egal, was sie auf| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Wird für Anrufbeantworter-Erkennung nach, dass ein gleiches Verhalten wie 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Wird für Anrufbeantworter-Erkennung, die nach dem gleichen Verhalten wie 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.|Auch in diesem Abschnitt sind die WEB VARs für jede Kampagne. Diese ermöglichen es jedem Agenten zu haben, eine andere Variable Zeichenfolge, die hinzugefügt werden können, um die Web-Formular oder SCRIPT Registerkarte URLs, indem Sie einfach setzen - A - web_vars - B - wie Sie würde jedem anderen Bereich.| +Group Alias List|Gruppe Alias Liste| +Add A New Group Alias|Eine neue Gruppe hinzuzufügen Alias| +ADD NEW GROUP ALIAS|ADD NEW GROUP ALIAS| +ADDING NEW GROUP ALIAS|Neue GROUP ALIAS| +MODIFY GROUP ALIAS|MODIFY GROUP ALIAS| +DELETE GROUP ALIAS|DELETE GROUP ALIAS| +GROUP ALIAS LIST|GROUP ALIAS LISTE| +GROUP ALIAS LISTINGS|GROUP ALIAS LISTINGS| +MODIFY A GROUP ALIAS RECORD|MODIFY A GROUP ALIAS RECORD| +Group Alias ID|Alias-ID-Gruppe| +Group Alias Name|Gruppe Alias-Name| +CallerID Number|CallerID Anzahl| +CallerID Name|CallerID Name| +DELETE THIS GROUP ALIAS|DELETE Diese Gruppe ALIAS| +GROUP ALIAS NOT MODIFIED|GROUP ALIAS NICHT MODIFIZIERT| +GROUP ALIAS MODIFIED|GROUP ALIAS VERÄNDERTE| +ADD A NEW GROUP ALIAS|Eine neue Gruppe hinzuzufügen ALIAS| +MODIFY A GROUP ALIAS RECORD|MODIFY A GROUP ALIAS RECORD| +GROUP ALIAS NOT ADDED|GROUP ALIAS NOT ADDED| +GROUP ALIAS ADDED|GROUP ALIAS ADDED| +GROUP ALIAS NOT DELETED|GROUP ALIAS nicht gelöscht| +GROUP ALIAS DELETION CONFIRMATION|GROUP ALIAS STREICHUNG BESTÄTIGUNG| +Click here to delete group alias|Klicken Sie hier, um Alias-Gruppe löschen| +GROUP ALIAS DELETION COMPLETED|GROUP ALIAS STREICHUNG COMPLETED| +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|Alias-ID-Gruppe - die ID der Gruppe Alias von Agenten wählen Sie fordert von der VICIDIAL Agent-Schnittstelle mit verschiedenen Caller-IDs. keine Leerzeichen oder andere Sonderzeichen erlaubt. Muss zwischen 2 und 20 Zeichen lang sein| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Alias-Name-Fraktion - Der Name für die Bezeichnung einer Gruppe Alias, muss zwischen 2 und 50 Zeichen lang sein| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Anrufer-ID-Nummer - Die Caller-ID-Nummer, die in dieser Gruppe Alias. Muss nur Ziffern| +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|Anrufer-ID Name - Die Anrufer-ID-Namen ein, können mit dieser Gruppe Alias. Soweit wir wissen, wird dies nur funktionieren, in Kanada über den PRI-Leitungen und mit einer Schleife IAX Stamm durch 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-Gruppe erlaubt - Wenn Sie möchten, dass Ihre Agenten zu verwenden Gruppe Aliase dann müssen Sie diese Gruppe Y. Aliases werden mehr in der Admin-Bereich, sie zuzulassen, um verschiedene callerIDs Handbuch für ausgehende Anrufe dass sie Platz. Der Standardwert ist 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|Standard-Fraktion Alias - Wenn Sie erlaubt Gruppe Aliases, dann ist dies die Gruppe Alias, die zuerst ausgewählten standardmäßig aktiviert, wenn der Agent sich für eine Gruppe Alias für einen ausgehenden Anruf Handbuch. Der Standardwert ist Keine oder leer| +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|Standard-Fraktion Alias - Wenn Sie erlaubt Gruppe Aliases für die Kampagne, dass der Agent angemeldet ist, dann ist dies in der Gruppe ist, dass Alias zuerst ausgewählten standardmäßig auf einen Anruf, die von dieser Gruppe, wenn die Inbound-Agent dafür, Verwendung eines Alias-Fraktion für einen ausgehenden Anruf Handbuch. Der Standardwert ist Keine oder leer| +Group Alias Allowed|Alias-Gruppe erlaubt| +Default Group Alias|Standard-Alias-Gruppe| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE ermöglicht es dem Agenten zu entscheiden, welche CallerID, die für 3-Wege-Anrufe aus einer Liste von Optionen.| +you cannot use reserved words in group aliases|Sie können keine reservierten Wörter in der Gruppe Aliase| +Agent Shift Enforcement Override|Agent Shift Vollstreckung Override| +Manager Shift Enforcement Override|Shift Manager Vollstreckung Override| +Shift Enforcement|Shift Vollstreckung| +Max Calls per Second|Max Calls pro Sekunde| +Max FILL Calls per Second|Max-FILL fordert pro Sekunde| +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.|Diese Einstellung überschreibt, was die Benutzer User Group hat für die Vollstreckung Shift. DEAKTIVIERT wird die Benutzergruppe Einstellung. AUS wird nicht in allen Schichten durchzusetzen. START wird nur die Durchsetzung der Login-Zeit, sondern wirkt sich nicht auf einen Vertreter, der mit über die Verlagerung, wenn sie bereits eingeloggt ALL wird durchzusetzen Verlagerung starten und meldet einen Agenten aus, nachdem sie über das Ende ihrer Schicht Zeit. Option ist standardmäßig deaktiviert.| +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.|Diese Einstellung, wenn auf 1 gesetzt wird ein Manager, um ihre Benutzer und Kennwort für ein Agent-Bildschirm, um die Verlagerung Beschränkungen auf einen Agenten Sitzung, wenn der Agent versucht, sich außerhalb ihrer Schicht. Der Standardwert ist 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.|Diese Einstellung ermöglicht es Ihnen, Agenten-Logins auf der Grundlage der Veränderungen, die ausgewählt werden. AUS wird nicht in allen Schichten durchzusetzen. START wird nur die Durchsetzung der Login-Zeit, sondern wirkt sich nicht auf einen Vertreter, der mit über die Verlagerung, wenn sie bereits eingeloggt ALL wird durchzusetzen Verlagerung starten und meldet einen Agenten aus, nachdem sie über das Ende ihrer Schicht Zeit. Standardeinstellung ist Aus.| +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.|Diese Einstellung bestimmt die maximale Anzahl von Anrufen, die sich durch den Ausgang Auto-Einwahl-Script auf diesem Server pro Sekunde. Muss zwischen 1 und 100. Der Standardwert ist 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.|Diese Einstellung bestimmt die maximale Anzahl von Anrufen, die sich durch den Automobil-füllen Sie Outbound-Dialing-Skript automatisch für alle Server, pro Sekunde. Muss zwischen 1 und 200. Der Standardwert ist 40.| +System Load|System Load| +Live Channels|Live-Channels| +Disk Usage|Disk Usage| +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.|Diese beiden Statistiken zeigen, die loadavg ein System mal 100 und die CPU-Auslastung Anteil des Servers und wird jede Minute aktualisiert. Die loadavg sollte im Durchschnitt unter 100 multipliziert mit der Anzahl der CPU-Kernen Ihr System hat, für eine optimale Leistung zu erzielen. Die CPU-Auslastung Prozentsatz sollte Aufenthalt unter 50 für eine optimale Leistung zu erzielen.| +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.|Dieses Feld zeigt die aktuelle Anzahl der Asterisk-Kanäle, die sich live über das System jetzt. Es ist wichtig zu beachten, dass die Anzahl der Kanäle Asterisk ist in der Regel viel höher als die tatsächliche Zahl der Anrufe auf einem System. Dieses Feld wird einmal pro Minute aktualisiert.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Dieses Feld wird die Nutzung der Festplatte für jede Partition auf diesem Server. Dieses Feld wird einmal pro Minute aktualisiert.| +ADMIN CHANGE LOG|Änderung der Registrierung ADMIN| +USER ADMIN CHANGE LOG|USER ADMIN Änderung der Registrierung| +SECTION ADMIN CHANGE LOG|ABSCHNITT ADMIN Änderung der Registrierung| +DETAIL ADMIN CHANGE LOG|DETAIL ADMIN Änderung der Registrierung| +Last 10000 records|Letzte 10.000 Datensätze| +Changes made by|Änderungen| +Record Detail|Record Detail| +Section Records|Abschnitt Records| +Click here to see Admin chages to this record|Klicken Sie hier, um zu sehen, Admin chages zu diesem Eintrag| +Click here to see Admin chages to this campaign|Klicken Sie hier, um zu sehen, Admin chages zu dieser Kampagne| +Click here to see Admin chages to this list|Klicken Sie hier, um zu sehen, Admin chages zu dieser Liste| +Click here to see Admin chages to this In-Group|Klicken Sie hier, um zu sehen, Admin chages zu dieser In-Group| +Click here to see Admin chages to this DID|Klicken Sie hier, um zu sehen, Admin chages zu dieser DID| +Click here to see Admin chages to this remote agent|Klicken Sie hier, um zu sehen, Admin chages zu dieser Remote Agent| +Click here to see Admin chages to this user group|Klicken Sie hier, um zu sehen, Admin chages zu dieser Benutzergruppe| +Click here to see Admin chages to this script|Klicken Sie hier, um zu sehen, Admin chages zu diesem Skript| +Click here to see Admin chages to this filter|Klicken Sie hier, um zu sehen, Admin chages dieser Filter| +Click here to see Admin chages to this call time|Klicken Sie hier, um zu sehen, Admin chages zu dieser Aufforderung Zeit| +Click here to see Admin chages to this shift|Klicken Sie hier, um zu sehen, Admin chages zu dieser Verschiebung| +Click here to see Admin chages to this phone alias|Klicken Sie hier, um zu sehen, Admin chages zu diesem Telefon Alias| +Click here to see Admin chages to this group alias|Klicken Sie hier, um zu sehen, Admin chages zu dieser Gruppe Alias| +Click here to see Admin chages to this server|Klicken Sie hier, um zu sehen, Admin chages zu diesem Server| +Click here to see Admin chages to this conf template|Klicken Sie hier, um zu sehen, Admin chages zu dieser Vorlage conf| +Click here to see Admin chages to this carrier|Klicken Sie hier, um zu sehen, Admin chages zu diesem Träger| +Click here to see Admin chages to the system settings|Klicken Sie hier, um zu sehen, Admin chages auf die System-Einstellungen| +Export Reports|Exportieren von Berichten| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Diese Einstellung, wenn auf 1 gesetzt wird ein Manager für den Zugriff auf die Ausfuhr rufen Berichte über die Berichte Bildschirm. Der Standardwert ist 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.|Diese Einstellung, wenn auf 1 gesetzt wird ein Manager zu klicken Sie auf den Download-Link-Liste am unteren Rand einer Liste Änderung Bildschirm zu exportieren den gesamten Inhalt eines Verzeichnisses auf eine flache Datei. Der Standardwert ist 0.| +Export Calls Report|Export fordert Bericht| +EXPORT CALLS REPORT|EXPORT ERSUCHT BERICHT| +For the Export Calls Report, the following field order is used for exports|Für die Export-Bericht fordert, um das folgende Feld wird für die Ausfuhr| +Timeclock|Timeclock| +Logout|Logout| +Show Users|Benutzer anzeigen| +Add A New User|Hinzufügen eines neuen Benutzers| +Search For A User|Suche für einen Benutzer| +User Stats|User-Statistiken| +User Status|User Status| +Time Sheet|Time Sheet| +Days Status|Tage Status| +Campaigns Main|Kampagnen Main| +Statuses|Status| +HotKeys|HotKeys| +Lead Recycle|Lead-Recycling| +Auto Alt-Dial|Alt-Auto-Dial| +Auto Alt Dial|Auto Alt Dial| +List Mix|US-Mix| +Pause Codes|Pause Codes| +Basic|Basic| +Detail|Detail| +Survey|Umfrage| +Real-Time|Real-Time| +CAMPAIGN ID|Kampagnen-ID| +DIAL PLAN|DIAL PLAN| +DIAL METHOD|DIAL METHOD| +LEADS COUNT|LEADS COUNT| +LEAD ORDER|BLEI BESTELLUNG| +DIAL STATUSES|DIAL Status| +SCRIPT ID|SCRIPT ID| +SCRIPT NAME|Skriptnamen| +USER GROUP|User Group| +GROUP NAME|Group Name| +PRIORITY|PRIORITY| +FORCE TIMECLOCK|FORCE TIMECLOCK| +CALLTIME ID|CALLTIME ID| +CALLTIME NAME|CALLTIME NAME| +DEFAULT START|DEFAULT START| +DEFAULT STOP|DEFAULT STOP| +SHIFT ID|SHIFT-ID| +SHIFT NAME|UMSCHALT NAME| +SHIFT START|UMSCHALT START| +SHIFT LENGTH|UMSCHALT LÄNGE| +WEEKDAYS|WOCHE| +Template ID|Vorlagen-ID| +Template Name|Template Name| +Carrier ID|Carrier-ID| +Carrier Name|Carrier Name| +Registration|Anmeldung| +Active|Aktive| +USER ID|USER ID| +FULL NAME|FULL NAME| +LEVEL|LEVEL| +LINKS|LINKS| +TRUNKS|Trunks| +HUMAN|HUMAN| +ANSWER|ANTWORT| +CATEGORY|KATEGORIE| +STATUSES IN THIS CATEGORY|Status in dieser Kategorie| +Display|Anzeige| +Dates|Termine| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|Bitte wählen Sie eine Kampagne oder Benutzergruppe und Datum-Zeit oben ein und klicken dann| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|Bitte wählen Sie einen Benutzernamen und Datum-Zeit oben ein und klicken dann| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|Bitte wählen Sie eine Kampagne und Datum-Zeit oben ein und klicken dann| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|Wählen Sie eine IM-Gruppe und Zeitraum oberhalb und klicken Sie auf Senden| +DOWNLOAD|DOWNLOAD| +Users|Benutzer| +User|User| +Reports|Berichte| +OUTBOUND|OUTBOUND| +INBOUND|INBOUND| +Server Stats and Reports|Server-Statistiken und Berichte| +Click here to see a VDAD report for this campaign|Klicken Sie hier, um ein VDAD Bericht für diese Kampagne| +Show DIDs|Show DIDS| +Add A New DID|Hinzufügen einer neuen DID| +Templates|Vorlagen| +Carriers|Träger| +Carrier Name|Carrier Name| +Click here to see all CallBack Holds in this user group|Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Gruppe| +Click here to see all CallBack Holds in this list|Klicken Sie hier, um zu sehen, alle CallBack Platz in dieser Liste| +Click here to see a report for this inbound group|Klicken Sie hier, um zu sehen, einen Bericht für diese Gruppe ein -| +Click here to Synchronize users with Vtiger|Klicken Sie hier, um synchronisieren Sie Benutzer mit vtiger| +Alert Enabled|Alarm aktiv| +Change Date|Datum ändern| +Login Date|Login Datum| +List Last Call Date|US-Last Call Date| +Phone Code Override|Telefon-Nr Override| +GROUP ALIAS ID|GROUP ALIAS ID| +GROUP ALIAS NAME|GROUP Alias-Name| +CID NUMBER|CID NUMBER| +CID NAME|CID NAME| +PHONE ALIAS|TEL ALIAS| +ALIAS ID|ALIAS ID| +ALIAS NAME|Alias-Name| +PHONE LOGINS LIST|TEL Logins LISTE| +Shift Length|Shift Länge| +short description of the shift|Kurze Beschreibung der Verlagerung| +DELETE THIS SERVER|DELETE THIS SERVER| +DELETE THIS CONFERENCE|DELETE Diese Konferenz| +DELETE THIS VICIDIAL CONFERENCE|DELETE THIS VICIDIAL KONFERENZ| +Install Date|Installieren Datum| +Human Answer|Human Antwort| +STATUS CATEGORIES|STATUS KATEGORIEN| +per campaign|pro Kampagne| +all campaigns|Alle Kampagnen| diff --git a/translations/el_language.txt b/translations/el_language.txt index f64f5255..fd56132f 100644 --- a/translations/el_language.txt +++ b/translations/el_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"ΙΑΝ"| @@ -49,8 +49,8 @@ Italian|Ιταλικά| agc_check_voicemail_BLINK.gif|agc_check_voicemail_BLINK_el.gif| agc_check_voicemail_OFF.gif|agc_check_voicemail_OFF_el.gif| agc_check_voicemail_ON.gif|agc_check_voicemail_ON_el.gif| -agc_live_call_OFF.gif|agc_live_call_OFF_el.gif| -agc_live_call_ON.gif|agc_live_call_ON_el.gif| +agc_live_call_OFF.gif|agc_live_call_OFF.gif| +agc_live_call_ON.gif|agc_live_call_ON.gif| agc_tab_active_lines.gif|agc_tab_active_lines_el.gif| agc_tab_conferences.gif|agc_tab_conferences_el.gif| agc_tab_main.gif|agc_tab_main_el.gif| @@ -427,3 +427,43 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|ΠΡΕΠΕΙ ΝΑ ENTER A PAUSE CODE|ΠΛΗΚΤΡΟΛΟΓΕΣΤΕ έναν ΚΩΔΙΚΟ ΜΙΚΡΗΣ ΔΙΑΚΟΠΉΣ| YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|ΠΡΕΠΕΙ ΝΑ ΣΤΑΜΑΤΗΘΕΙΤΕ ΓΙΑ ΝΑ ΠΛΗΚΤΡΟΛΟΓΕΙΤΕ έναν ΚΩΔΙΚΟ ΜΙΚΡΗΣΔΙΑΚΟΠΉΣ στον ΤΡΟΠΟ αυτόματος-ΠΙΝΑΚΩΝ| Your session has been disabled|Η σύνοδός σας έχει τεθεί εκτός λειτουργίας| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Φύλο:| +Date of Birth: |Ημερομηνία Γέννησης:| +YOU MUST BE PAUSED TO CHANGE GROUPS|Πρέπει να είστε Paused TO CHANGE ΟΜΑΔΕΣ| +Calls in Queue:|Ζητεί, στο Queue:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|Ο χρήστη και τον κωδικό πρόσβασης που πληκτρολογήσατε δεν είναι ενεργό στο σύστημα| +Please try again|Παρακαλώ δοκιμάστε ξανά| +You cannot log in or out within 30 seconds of your last login or logout|Δεν μπορείτε να συνδεθείτε ή να αναφέρονται μέσα σε 30 δευτερόλεπτα από την τελευταία σας login ή logout| +You have now logged-out|Έχετε πλέον συνδεθεί-out| +You logged out at |Έχετε αποσυνδεθεί από την| +Amount of time you were logged-in: |Ποσό φορά που ήταν συνδεδεμένος στο:| +ERROR: timeclock log entry already made: |ERROR: timeclock καταχώρηση αρχείου καταγραφής που έχουν ήδη πραγματοποιηθεί:| +BACK to Agent Login Screen|ΕΠΙΣΤΡΟΦΗ στο γραφείο Σύνδεση οθόνης| +BACK to Administration|ΕΠΙΣΤΡΟΦΗ στην Διοίκηση| +BACK to Welcome Screen|ΕΠΙΣΤΡΟΦΗ στην οθόνη υποδοχής| +Time since you were last logged-in: |Ο χρόνος από την τελευταία φορά που είναι συνδεδεμένος στο:| +You last logged-out at: |Μπορείτε τελευταίου συνδεδεμένου αναφέρονται σε:| +Click LOGIN below to log-in|Κάντε κλικ παρακάτω για να ΕΙΣΟΔΟΣ log-in| +Amount of time you have been logged-in: |Χρονικό διάστημα σας έχει συνδεθεί σε:| +You logged-in at:|Μπορείτε συνδεδεμένος στην διεύθυνση:| +Click LOGOUT below to log-out|Κάντε κλικ παρακάτω για να LOGOUT log-out| +Undefined|Undefined| +This phone number is not in the campaign lists|Αυτός ο αριθμός τηλεφώνου δεν είναι στην εκστρατεία καταλόγους| +Unspecified error|Απροσδιόριστο σφάλμα| +Extended Alt Phone Information: |Εκτεταμένη Alt Τηλέφωνο Πληροφοριών:| +ALT DIAL NUMBER:|ALT ΤΗΛΕΦΩΝΕΙΣΤΕ ΑΡΙΘΜΟΣ:| +Phone Code and Number:|Μήκη και Αριθμός:| +Notes: |Σημειώσεις:| +Active: |Active:| +Alt Count: |Alt Count:| +Change this phone number to INACTIVE|Αλλαγή αυτό τον αριθμό τηλεφώνου για να Ανενεργό| +Change this phone number to ACTIVE|Αλλαγή αυτό τον αριθμό τηλεφώνου για να ΔΡΑΣΤΙΚΗΣ| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|Πρέπει να συνδεθείτε ΣΤΗΝ ΠΡΩΤΗ ΤΟΥ TIMECLOCK| +There is a time synchronization problem with your system, please tell your system administrator|Υπάρχει ένα πρόβλημα συγχρονισμού με το χρόνο σας, παρακαλούμε ενημερώστε τον διαχειριστή του συστήματός σας| +Preview Call|Προεπισκόπηση πρόσκλησης| +SELECT A GROUP ALIAS|ΕΠΙΛΕΞΤΕ ΟΜΑΔΑ ALIAS| +Group Alias Selection|Γνωστός Ομάδα Επιλογής| +Click Here to Choose a Group Alias|Κάντε κλικ εδώ για να Επιλέξτε μια ομάδα Γνωστός| +Group Alias|Ομάδα Γνωστός| diff --git a/translations/el_language_admin.txt b/translations/el_language_admin.txt index cd8a3a98..f18ed717 100644 --- a/translations/el_language_admin.txt +++ b/translations/el_language_admin.txt @@ -43,6 +43,27 @@ 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 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| @@ -1426,3 +1447,661 @@ Allowed Transfer Groups: |Ομάδες μεταφοράς:| 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|Ομάδες μεταφοράς - με αυτές τις λίστες τετραγωνιδίου μπορείτε ναεπιλέξετε τις ομάδες ότι οι πράκτορες σε αυτήν την εκστρατείαμπορούν να μεταφέρουν τις κλήσεις. Επιτρέψτε ότι Closersπρέπει να επιτραπεί για αυτήν την επιλογή να παρουσιάσει| 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|Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων 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|Επίσης σε αυτό το τμήμα είναι η δυνατότητα να δοθεί στονπράκτορα μια τάξη για κάθε εισερχόμενη ομάδα. Αυτές οι τάξειςμπορούν να χρησιμοποιηθούν για την προτιμημένη κλήση καθοδηγώνταςόταν επιλέγεται εκείνη η επιλογή στην οθόνη-ΟΜΑΔΑΣ| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|QC Enabled - Η επιλογή αυτή επιτρέπει στο χρήστη να συνδεθείτε με το γραφείο ποιοτικού ελέγχου της οθόνης| +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|QC επίπεδο χρήστη - Αυτή η ρύθμιση ορίζει τι ο πράκτορας Ελέγχου Ποιότητας χρήστη επίπεδο. Αυτό θα υπαγορεύσει το επίπεδο λειτουργικότητας για τον αντιπρόσωπο στο τμήμα QC| +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|QC Εγγραφή Pass - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι μια εγγραφή έχει περάσει από τον πρώτο γύρο, QC, μετά την επανεξέταση των ρεκόρ| +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|QC Εγγραφή Finish - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι μια εγγραφή έχει τελειώσει ο δεύτερος γύρος των QC πέρασε μετά την επανεξέταση των ρεκόρ| +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|QC Αναλήψεις Record - Η επιλογή αυτή επιτρέπει στον πράκτορα να διευκρινιστεί ότι ένα ρεκόρ το οποίο έχει δεσμευθεί στην QC. Αυτό δεν είναι πλέον δυνατό να τροποποιηθεί από κανέναν| +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|QC Επιτρέπονται Καμπάνιες - Αυτό είναι ένα επιλέξιμο κατάλογο των καμπάνιες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-CAMPAIGNS επιλογή επιτρέπει στους χρήστες αυτής της ομάδας να QC οποιαδήποτε εκστρατεία για το σύστημα| +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|QC Επιτρέπονται Inbound Ομάδες - Αυτό είναι ένα επιλέξιμο λίστα των εισερχόμενων ομάδες που τα μέλη αυτής της ομάδας χρηστών θα είναι σε θέση να QC. Η ALL-ΟΜΑΔΕΣ επιλογή επιτρέπει στους χρήστες σε αυτή την ομάδα χρηστών να QC οποιαδήποτε εισερχόμενα ομάδας για το σύστημα| +QC Enabled: |QC Enabled:| +QC User Level: |QC χρήστη Επίπεδο:| +QC Pass: |QC Pass:| +QC Finish: |QC Τελείωμα:| +QC Commit: |Αναλήψεις QC:| +Modify Nothing|Τίποτα δεν Modify| +Modify Nothing Except Status|Τίποτα δεν Modify Εκτός Status| +Modify All Fields|Τροποποιήστε Όλα τα πεδία| +Verify First Round of QC|Βεβαιωθείτε πρώτου γύρου, QC| +View QC Statistics|Δείτε QC Στατιστικά| +Ability to Modify FINISHed records|Ικανότητα Modify ΕΤΟΙΜΑ αρχεία| +Manager Level|Manager Επίπεδο| +USERS CAN VIEW ANY CAMPAIGN|Χρήστες να μπορούν να δουν οποιαδήποτε καμπάνια| +USERS CAN QC ANY CAMPAIGN|Οι χρήστες μπορούν να QC οποιαδήποτε καμπάνια| +USERS CAN QC ANY INBOUND GROUP|Οι χρήστες μπορούν να ANY QC εισερχόμενα ΟΜΑΔΑ| +QC Allowed Campaigns: |QC Επιτρέπονται Καμπάνιες:| +QC Allowed Inbound Groups: |QC Επιτρέπονται Inbound Groups:| +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|Κοτσίδας Προτεραιότητα - Αυτή η ρύθμιση χρησιμοποιείται για να καθορίσει τη σειρά με την οποία οι εξερχόμενες κλήσεις από αυτή την εκστρατεία θα πρέπει να απαντηθούν σε σχέση με τις εισερχόμενες κλήσεις αν η συγκεκριμένη καμπάνια είναι αναμεμειγμένο σε λειτουργία| +Queue Priority: |Κοτσίδας Προτεραιότητα:| +Drop Action: |Drop δράσης:| +Drop Transfer Group: |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|Drop δράσης - Αυτό το μενού σας επιτρέπει να διαλέξετε ό, τι συμβαίνει σε μια κλήση όταν έχει να περιμένει περισσότερο από ό, τι έχει οριστεί στο Drop Call δευτερόλεπτα τομέα. HANGUP απλά θα κλείσεις την κλήση, το μήνυμα θα αποστείλει την πρόσκληση της Drop παράταση που έχετε ορίζονται κατωτέρω, τηλεφωνητή θα απευθύνει την πρόσκληση προς το τηλεφωνητή θέση που έχετε IN_GROUP ορίζονται κατωτέρω, και θα απευθύνει την πρόσκληση στην ομάδα Inbound που καθορίζονται κατωτέρω| +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|Drop παράταση - Αν Drop δράση που να είναι μήνυμα, αυτό είναι η κλήση σχέδιο επέκτασης ότι η πρόσκληση θα σταλεί στο εάν ανέρχεται Drop Call Δευτερόλεπτα| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Drop Call δευτερόλεπτα - Ο αριθμός των δευτερολέπτων σε μια κλήση θα παραμείνουν στην ουρά πριν να θεωρείται 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|Drop Μεταφορά Όμιλος - Αν Drop Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα εάν ανέρχεται Drop Call Δευτερόλεπτα| +QC SETTINGS FOR THIS CAMPAIGN|QC SETTINGS για αυτή την καμπάνια| +QC Enabled: |QC Enabled:| +QC Statuses: |QC καθεστώτα:| +Modify Campaign QC Settings|Τροποποίηση Ρυθμίσεων Καμπάνιας QC| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|QC Enabled - Η ρύθμιση αυτού του τομέα να Y επιτρέπει τον παράγοντα Ποιοτικός Έλεγχος χαρακτηριστικά στην εργασία. Προεπιλεγμένο είναι Ν| +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|QC καθεστώτων - Η περιοχή αυτή είναι που θα επιλέξετε το οποίο οδηγεί των καθεστώτων θα πρέπει να φύγει πάνω από το σύστημα, QC. Τοποθετήστε ένα δίπλα στο ελέγξτε την κατάσταση που θέλετε, QC για την αναθεώρηση| +QC SETTINGS NOT MODIFIED|QC SETTINGS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +QC SETTINGS MODIFIED|QC SETTINGS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +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|QC WebForm Διεύθυνση - Αυτό είναι το ότι μια διεύθυνση ιστοσελίδας, QC, μπορεί να πάει στο γραφείο, όταν κάνετε κλικ στο σύνδεσμο WEBFORM στην οθόνη QC| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|QC Σενάριο - Αυτό είναι το σενάριο που μπορεί να χρησιμοποιηθεί από τους πράκτορες, QC στην SCRIPT καρτέλα στην οθόνη, QC| +QC WebForm: |QC WebForm:| +QC Script|QC Script| +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|-Στην ομάδα Καταγραφή Παράκαμψη - Το πεδίο αυτό επιτρέπει την πρωταρχική της εκστρατείας πρόσκληση εγγραφής ρύθμιση. Η ρύθμιση αυτή μπορεί να παρακαμφθεί από την καταγραφή vicidial_user υπερισχύει ρύθμιση. DISABLED δεν θα υπερισχύσει του εκστρατεία καταγραφής ρύθμιση. ΠΟΤΕ θα απενεργοποιήσει την εγγραφή για τον πελάτη. ONDEMAND είναι η προεπιλεγμένη και επιτρέπει στον αντιπρόσωπο να ξεκινήσετε και να σταματήσετε την εγγραφή, όπως απαιτείται. ALLCALLS θα αρχίσει η εγγραφή του υπολογιστή-πελάτη κάθε φορά που μια κλήση στέλνεται σε έναν πράκτορα. ALLFORCE θα αρχίσει η εγγραφή του υπολογιστή-πελάτη κάθε φορά που μια κλήση στέλνεται σε έναν πράκτορα που ο πράκτορας δεν την επιλογή για να σταματήσει η εγγραφή| +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|-Στην ομάδα αρχείου Καταγραφή - Το πεδίο αυτό θα αντικαταστήσει το Campaign Καταγραφή Filenaming σύστημα εάν δεν έχει οριστεί σε ΚΑΝΕΝΑ. Οι μεταβλητές που επιτρέπονται είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH ΠΡΑΚΤΟΡΑ. Η προεπιλογή είναι FULLDATE_AGENT και θα μοιάζει κάπως έτσι 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει κάπως έτσι TESTCAMP_51020103108_3125551212. 50 char max. Προεπιλεγμένο είναι ΚΑΝΕΝΑ| +In-Group Recording Override: |-Στην ομάδα Καταγραφή Override:| +In-Group Recording Filename: |-Στην ομάδα Καταγραφή αρχείου:| +ADDING VICIDIAL QC STATUS CODE|Adding VICIDIAL QC Κατάσταση ΚΩΔΙΚΟΣ| +MODIFY VICIDIAL QC STATUS CODE|MODIFY VICIDIAL QC Κατάσταση ΚΩΔΙΚΟΣ| +VICIDIAL QC STATUS CODES|QC VICIDIAL κωδικοί| +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.|Ο Ποιοτικός Έλεγχος-QC σύστημα εντός VICIDIAL έχει τους δικούς της κωδικοί χωριστά από εκείνα που, κατά την κλήση των λειτουργιών χειρισμού VICIDIAL. QC statuse κωδικοί πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες και δεν περιέχουν ειδικούς χαρακτήρες όπως ένα χώρο ή παχέος εντέρου. Ο κωδικός QC περιγραφή πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες.| + QC Status Codes |QC κωδικοί| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |QC VICIDIAL κωδικοί στα πλαίσια αυτού του συστήματος:| +ADD NEW QC STATUS CODE|Προσθήκη νέου QC Κατάσταση ΚΩΔΙΚΟΣ| +QC STATUS CODE NOT DELETED|QC Κατάσταση ΚΩΔΙΚΟΣ δεν διαγράφονται| +QC STATUS CODE DELETED: |QC Κατάσταση ΔΙΕΓΡΑΜΜΕΝΩΝ ΚΩΔΙΚΟΣ:| +QC STATUS CODE NOT MODIFIED |QC Κατάσταση ΚΩΔΙΚΟΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +QC STATUS CODE MODIFIED: |QC Κατάσταση ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ ΚΩΔΙΚΟΣ:| +the qc status code needs to be at least 1 characters in length|η qc κωδικός πρέπει να είναι τουλάχιστον 1 χαρακτήρες στο μήκος| +the qc status code name needs to be at least 1 characters in length|qc το κωδικό όνομα πρέπει να είναι τουλάχιστον 1 χαρακτήρες στο μήκος| +QC STATUS CODE NOT ADDED |QC Κατάσταση ΚΩΔΙΚΟΣ δεν προστίθενται| +there is already a qc status code in the system with this name:|υπάρχει ήδη μια qc κωδικό στο σύστημα με αυτό το όνομα:| +QC STATUS CODE ADDED: |QC Κατάσταση ΠΡΟΣΤΙΘΕΝΤΑΙ ΚΩΔΙΚΟΣ:| +code must be between 1 and 8 characters in length|κωδικός πρέπει να είναι μεταξύ 1 και 8 χαρακτήρες| +code name must be between 2 and 30 characters in length|κωδικό όνομα πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες| +CALL HANGUP REASON STATS|CALL HANGUP REASON STATS| +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|Μετά από ώρες δράσης - Η δράση για την εκτέλεση, αν είναι μετά από ώρες, όπως ορίζεται στην πρόσκληση αυτή την φορά για τα εισερχόμενα ομάδα. HANGUP θα hangup αμέσως την πρόσκληση, MESSASGE θα παίξει το αρχείο στο Μετά από ώρες Μήνυμα Filenam τομέα, ΕΠΕΚΤΑΣΗ θα αποστείλει την πρόσκληση για την Μετά από ώρες Παράταση στο dialplan τηλεφωνητή και θα απευθύνει την πρόσκληση προς το τηλεφωνητή κουτί που απαριθμούνται στο Μετά Ώρες Τηλεφωνητής τομέα , IN_GROUP θα αποστείλει την πρόσκληση προς την εισερχόμενη ομάδα επιλεγμένων στο Μετά Ώρες Μεταφορά Ομάδα επιλέξτε λίστα. Προεπιλεγμένο είναι ΜΗΝΥΜΑ| +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|Μετά από ώρες Μεταφορά Όμιλος - Εάν Μετά Ώρες Δράσης έχει οριστεί σε IN_GROUP, η πρόσκληση θα σταλεί σε αυτή την εισερχόμενη ομάδα, αν αυτή τεθεί σε-η ομάδα εκτός από τη διάρκεια των κλήσεων για το καθεστώς που ορίζεται στην ομάδα| +After Hours Transfer Group: |Μετά από ώρες Μεταφορά Ομάδα:| +Total calls taken in to this In-Group:|Σύνολο κλήσεις που λαμβάνονται σε αυτό το In-Group:| +CALL HOLD TIME BREAKDOWN IN SECONDS|ΧΡΟΝΟΣ ΥΠΟΒΟΛΗΣ ΠΑΡΑΔΙΔΟΜΕΝΕΣ ΚΑΤΑΝΟΜΗ ΣΕ SECONDS| +Date Range:|Χρονικό διάστημα:| +ADDING NEW PHONE ALIAS|Την προσθήκη νέων PHONE ALIAS| +ADD NEW PHONE ALIAS|Προσθήκη νέου PHONE ALIAS| +MODIFY PHONE ALIAS|MODIFY PHONE ALIAS| +DELETE PHONE ALIAS|DELETE PHONE ALIAS| +PHONE ALIAS LIST|PHONE ALIAS ΚΑΤΑΛΟΓΟΣ| +Phone Alias List|Τηλέφωνο Γνωστός Κατάλογος| +Add A New Phone Alias|Προστίθεται ένα νέο τηλέφωνο Γνωστός| +ADD A NEW PHONE ALIAS|ADD A NEW PHONE ALIAS| +Alias ID: |Γνωστός ID:| +Alias Name: |Ψευδώνυμο:| +Phone Logins List: |Τηλέφωνο logins List:| +PHONE ALIAS NOT ADDED|PHONE ALIAS δεν προστίθενται| +there is already a Phone Alias in the system with this ID|υπάρχει ήδη ένα τηλέφωνο Γνωστός στο σύστημα με αυτό το ID| +there is already a Phone Login in the system with this ID|υπάρχει ήδη μια Τηλέφωνο Σύνδεση στο σύστημα με αυτό το ID| +PHONE ALIAS ADDED|PHONE ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ| +PHONE ALIAS NOT MODIFIED|PHONE ALIAS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +PHONE ALIAS MODIFIED|PHONE ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +PHONE ALIAS NOT DELETED|PHONE ALIAS δεν διαγράφονται| +PHONE ALIAS DELETION CONFIRMATION|PHONE ALIAS DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ| +Click here to delete phone alias|Κάντε κλικ εδώ για να διαγράψετε τηλέφωνο άλλως| +PHONE ALIAS DELETION COMPLETED|PHONE ALIAS DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ| +PHONE ALIAS LISTINGS|PHONE ALIAS Καταχωρίσεις| +there is already a Phone alias in the system with this login|υπάρχει ήδη ένα τηλέφωνο άλλως στο σύστημα με αυτή τη σύνδεση| +there is already a Phone in the system with this login|υπάρχει ήδη ένα τηλέφωνο στο σύστημα με αυτή τη σύνδεση| +DELETE THIS PHONE ALIAS|DELETE THIS PHONE ALIAS| +MODIFY A PHONE ALIAS RECORD|MODIFY τηλεφώνου ALIAS RECORD| +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 - Η ID του ψευδώνυμο που χρησιμοποιείται για να επιτρέψει συνδέσεις τηλεφώνου φορτίο ισορροπημένη. δεν κενά ή άλλους ειδικούς χαρακτήρες επιτρέπονται. Πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Ψευδώνυμο - Το όνομα που χρησιμοποιείται για την περιγραφή ενός τηλέφωνα άλλως, πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες| +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|Τηλέφωνα logins List - Η comma separated κατάλογο τηλέφωνο συνδέσεις χρησιμοποιούνται όταν ένας πράκτορας συνδέεται στο τηλέφωνο χρησιμοποιώντας φορτίο ισορροπημένη συνδέσεις. Το γραφείο θα βρει εφαρμογή η ενεργός διακομιστής με τις λιγότερες παράγοντες συνδεθεί σε αυτήν και μια κλήση από το διακομιστή στον πράκτορα κατά login| +PHONES WITHIN THIS PHONES ALIAS|Στο πλαίσιο του παρόντος PHONES ΤΗΛΕΦΩΝΑ ALIAS| +Add New Shift|Προσθήκη νέου Shift| +New Shift Addition|Νέα προσθήκη Shift| +Modify Shift|Τροποποιήστε Shift| +Delete Shift|Διαγραφή Shift| +Shifts|Βάρδιες| +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 Shift - Αυτή είναι η σύντομη ονομασία της Vicidial Shift Ορισμός. Αυτό πρέπει να είναι ένα μοναδικό αναγνωριστικό. Μην χρησιμοποιείτε τυχόν διαστήματα ή σημεία στίξης για αυτόν τον τομέα. max 20 χαρακτήρες, τουλάχιστον 2 χαρακτήρες| +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|Shift Όνομα - Αυτό είναι ένα πιο περιγραφικό όνομα του Shift Ορισμός. Αυτή είναι μια σύντομη περίληψη του Shift ορισμό. το πολύ 50 χαρακτήρες, τουλάχιστον 2 χαρακτήρες| +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|Start Time Shift - Αυτή είναι η στιγμή που αρχίζει η εκστρατεία στροφή. Πρέπει να είναι μόνο αριθμοί, 9.30 π.μ. και 0930 θα είναι 5:00 μμ θα είναι 1.700| +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|Shift Μήκος - Αυτό είναι το χρόνο σε ώρες και τα λεπτά που διαρκεί η εκστρατεία στροφή. 8 ώρα θα είναι 08:00 και 7 ώρες και 30 λεπτά θα είναι 07:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Shift Καθημερινά - Στην ενότητα αυτή θα πρέπει να επιλέξετε τις μέρες την εβδομάδα ότι αυτή η στροφή είναι ενεργή| +Show Shifts|Δείτε Βάρδιες| +Add A New Shift|Προστίθεται ένα νέο Shift| +Shift ID: |Shift ID:| +Shift Name: |Shift Όνομα:| +Shift Start Time: |Shift Ώρα έναρξης:| +Shift End Time: |Shift End Time:| +SHIFT DEFINITION NOT ADDED|SHIFT ΟΡΙΣΜΟΣ δεν προστίθενται| +there is already a shift entry with this ID|υπάρχει ήδη μια μετατόπιση προς την παρούσα θέση ID| +Shift ID and name must be at least 2 characters in length|ID Shift και το όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες| +Shift Start Time must be 4 digits in length and be a valid time|Shift ώρα έναρξης πρέπει να είναι 4 ψηφία στο μήκος και να είναι μια έγκυρη ώρα| +Shift Length must be 5 characters in length and be 24 hours or less|Shift Μήκος 5 χαρακτήρες πρέπει να είναι σε μήκος και να είναι 24 ώρες ή λιγότερο| +SHIFT ADDED: |SHIFT ΠΡΟΣΤΙΘΕΜΕΝΗ:| +MODIFY A SHIFT|MODIFY της στροφής| +USER GROUPS USING THIS SHIFT:|ΟΜΑΔΕΣ ΧΡΗΣΤΩΝ ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ SHIFT:| +DELETE THIS SHIFT DEFINITION|Διαγραφή αυτής της SHIFT ΟΡΙΣΜΟΣ| +MODIFY A SHIFT|MODIFY της στροφής| +SHIFT NOT DELETED|SHIFT δεν διαγράφονται| +SHIFT DELETION CONFIRMATION: |SHIFT DELETION CONFIRMATION:| +Click here to delete shift|Κάντε κλικ εδώ για να διαγράψετε στροφή| +SHIFT DELETION COMPLETED:|SHIFT DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ:| +SHIFT MODIFIED|SHIFT ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +SHIFT LISTINGS:|SHIFT Καταχωρίσεις:| +Shift Weekdays: |Shift Καθημερινά:| +Sunday|Κυριακή| +Monday|Δευτέρα| +Tuesday|Τρίτη| +Wednesday|Τετάρτη| +Thursday|Πέμπτη| +Friday|Παρασκευή| +Saturday|Σάββατο| +Group Shifts: |Ομάδα Βάρδιες:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Ομάδα Βάρδιες - Αυτό είναι ένα επιλέξιμο λίστα των βαρδιών που μπορούν να περιορίσουν το χρόνο παράγοντες σύνδεσης, για το σύστημα| + Timeclock|Timeclock| +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|Timeclock Τέλος της ημέρας - Αυτή η ρύθμιση καθορίζει, όταν όλοι οι χρήστες θα πρέπει να συνδεθεί αυτόματα από το σύστημα timeclock. Μόνο εκτελείται μία φορά την ημέρα. πρέπει να είναι μόνο 4 ψηφία ψηφίο 2 ώρες και 2 λεπτά ψηφίο στο 24ωρο διάστημα. Η προεπιλογή είναι 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Τελευταία Timeclock Auto Logout - Αυτό το πεδίο εμφανίζει την ημερομηνία της τελευταίας αυτόματη αποσύνδεση| +Timeclock Last Auto Logout: |Τελευταία Timeclock Αυτόματη Αποσύνδεση:| +Timeclock End Of Day: |Timeclock Τέλος της ημέρας:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|ΕΡΕΥΝΑ SETTINGS για αυτήν την καμπάνια:| +Modify Campaign Survey|Τροποποίηση Καμπάνιας Έρευνα| +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.|Έρευνα Πρώτο αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται από τη στιγμή που ο πελάτης παραλαμβάνει το τηλέφωνο όταν τρέχει μια έρευνα καμπάνια.| +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 |Έρευνα DTMF Digits - Αυτό το πεδίο όπου θα καθοριστούν οι θέσεις ότι ο πελάτης μπορεί να πατήσει ως επιλογή για μια έρευνα της καμπάνιας. ψηφία DTMF είναι έγκυρο| +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Έρευνα δεν ενδιαφέρεται Digit - Αυτό το πεδίο όπου θα καθορίσει ο πελάτης ψηφίο πιεστεί θα δείτε ότι δεν ενδιαφέρονται.| +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 - Το πεδίο αυτό είναι που έχετε επιλέξει το καθεστώς που θα χρησιμοποιηθεί για δεν ενδιαφέρεται. DNC Εάν χρησιμοποιείται και η καμπάνια είναι ρυθμισμένη να χρησιμοποιεί DNC στη συνέχεια τον αριθμό τηλεφώνου, θα προστίθεται αυτόματα στο VICIDIAL εσωτερική DNC λίστα.| +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.|Έρευνα Opt-σε αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται όταν ο πελάτης έχει επιλέξει-in με την έρευνα, δεν επέλεξε-ή που δεν απάντησαν και αν η μη ανταπόκριση ενέργεια έχει οριστεί σε OptOut. Μετά από αυτό το αρχείο ήχου παίζεται, η μέθοδος έρευνας δράση.| +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|Έρευνα δεν ενδιαφέρεται αρχείο ήχου - Αυτό είναι το όνομα αρχείου ήχου που παίζεται όταν ο πελάτης έχει επιλέξει-από την έρευνα, δεν επέλεξε-ή σε περίπτωση που δεν απαντήσει η μη ανταπόκριση ενέργεια έχει οριστεί σε OptIn. Μετά από αυτό το αρχείο ήχου παίζεται, η πρόσκληση θα είναι ανηρτημένα| +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.|Μέθοδος Survey - Αυτή η επιλογή καθορίζει τι θα συμβεί σε μια κλήση μετά ο πελάτης επέλεξε-in. AGENT_XFER θα αποστείλει την πρόσκληση για το επόμενο διαθέσιμο πράκτορα. Τηλεφωνητής θα αποστείλει την πρόσκληση προς το τηλεφωνητή θέση που καθορίζεται στο Τηλεφωνητής τομέα. ΕΠΕΚΤΑΣΗ θα στείλει ο πελάτης με την παράταση που ορίζεται στην έκθεση Xfer Επέκταση τομέα. HANGUP θα κλείσεις τον πελάτη. CAMPREC_60_WAV θα στείλει ο πελάτης να έχουμε μια καταγραφή που γίνεται με τους απάντηση, η καταγραφή αυτή θα πρέπει να τοποθετούνται σε ένα φάκελο με το όνομα, όπως η εκστρατεία στο εσωτερικό της καμπάνιας Έρευνα Καταγραφή Directory.| +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.|Έρευνα της μη αντίδρασης Δράση - Αυτό είναι που σας καθορίζουν τι θα συμβεί αν δεν υπάρχει απάντηση στο ερώτημα της έρευνας. OptIn θα στείλει την πρόσκληση για την Έρευνα για την μέθοδο και αν ο πελάτης θα πατήσει το ψηφίο DTMF. OptOut θα στείλει ο πελάτης για να μέθοδος έρευνας, ακόμα και εάν δεν πιέσετε ένα ψηφίο DTMF.| +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.|Έρευνα Απάντηση Digit Map - Αυτό είναι το σημείο όπου μπορείτε να ορίσετε μια περιγραφή για να πάνε με κάθε ψηφίο DTMF επιλογή που ο πελάτης μπορεί να επιλέξει.| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Έρευνα Xfer Επέκταση - , εάν η έρευνα Μέθοδος ΕΠΕΚΤΑΣΗ είναι επιλεγμένο τότε ο πελάτης θα πρέπει να απευθύνεται έκκληση για την επέκταση αυτής της dialplan| +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.|Έρευνα Καμπάνια Καταγραφή Directory - Εάν η μέθοδος έρευνας της CAMPREC_60_WAV είναι επιλεγμένο, τότε η αντίδραση των πελατών θα πρέπει να καταχωρούνται και να τοποθετούνται σε έναν κατάλογο το όνομα του από την εκστρατεία στο εσωτερικό αυτού του καταλόγου.| +SURVEY SETTINGS NOT MODIFIED|ΕΡΕΥΝΑ SETTINGS ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +SURVEY SETTINGS MODIFIED|ΕΡΕΥΝΑ SETTINGS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +Survey First Audio File|Έρευνα Πρώτο αρχείο ήχου| +Survey DTMF Digits|Έρευνα DTMF Digits| +Survey Not Interested Digit|Έρευνα δεν ενδιαφέρεται Digit| +Survey Not Interested Status|Έρευνα δεν ενδιαφέρεται Status| +Survey Opt-in Audio File|Έρευνα Opt-σε αρχείο ήχου| +Survey Not Interested Audio File|Έρευνα δεν ενδιαφέρεται αρχείο ήχου| +Survey Method|Έρευνα Μέθοδος| +Survey No-Response Action|Έρευνα της μη αντίδρασης δράσης| +Survey Response Digit Map|Έρευνα Απάντηση Digit Χάρτης| +Survey Xfer Extension|Έρευνα Xfer Παράταση| +Survey Campaign Recording Directory|Έρευνα Καμπάνια Καταγραφή Directory| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Προσθήκη Timeclock Εγγραφή Εγγραφή - Η επιλογή αυτή επιτρέπει στο χρήστη να προσθέσετε εγγραφές στο μητρώο timeclock| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Τροποποιήστε Timeclock Εγγραφή Εγγραφή - Η επιλογή αυτή επιτρέπει στο χρήστη να τροποποιήσει τις εγγραφές του timeclock log| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Εγγραφή Διαγραφή Timeclock Record - Η επιλογή αυτή επιτρέπει στο χρήστη να διαγράψει αρχεία στο timeclock log| +Add Timeclock Log Record|Προσθήκη Timeclock Εγγραφή Εγγραφή| +Modify Timeclock Log Record|Τροποποιήστε Timeclock Εγγραφή Εγγραφή| +Delete Timeclock Log Record|Διαγραφή Timeclock Εγγραφή Εγγραφή| +USER GROUP TIMECLOCK STATUS REPORT|Ομάδα χρηστών TIMECLOCK Κατάσταση ΕΚΘΕΣΗ| +Click here to see the Timeclock Status for this user group|Κάντε κλικ εδώ για να δείτε την κατάσταση Timeclock ομάδα για αυτόν τον χρήστη| +ADD NUMBERS TO THE DNC LIST|ADD αριθμούς στην DNC ΚΑΤΑΛΟΓΟΣ| +Phone Numbers: |Τηλέφωνα:| +one phone number per line only|έναν αριθμό τηλεφώνου σε κάθε γραμμή μόνο| +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|Κατάλογος VICIDIAL DNC - Αυτό δεν θέτουν κάθε λίστα περιέχει μόλυβδο που έχει τεθεί σε καθεστώς των DNC στο σύστημα. Μέσω του ΚΑΤΑΛΟΓΟΙ - ADD TO ΑΡΙΘΜΟΣ DNC σελίδα μπορείτε να προσθέσετε τους αριθμούς σε αυτόν τον κατάλογο, έτσι ώστε δεν θα ονομάζεται από καμπάνιες που χρησιμοποιούν την εσωτερική DNC λίστα| + Time Sheet |Ώρα Φύλλο| +Timeclock Record Edit|Timeclock Εγγραφή Επεξεργασία| +Default date format with year month day|Προκαθορισμένος ημερομηνία με τη μορφή έτος μήνας ημέρα| +USA date format with month day year|ΗΠΑ με τη μορφή ημερομηνίας ημέρα του μήνα χρόνου| +European date format with day month year|Ευρωπαϊκή ημέρα με μορφή Ημέρα Μήνας Έτος| +Text date format with abbreviated month day|Κείμενο με συντετμημένη μορφή ημερομηνίας ημέρα του μήνα| +followed by 24 hour time|ακολουθούμενη από 24 ώρες χρόνο| +followed by 12 hour time|ακολουθούμενη από 12 ώρες χρόνο| +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|Agent Screen Επικεφαλίδας Ημερομηνία Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή της ημερομηνίας που εμφανίζεται στο πάνω μέρος της οθόνης VICIDIAL πράκτορα. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι| +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|Agent Screen Πελατών Ημερομηνία Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή των πελατών ζώνη ώρας ημερομηνία που εμφανίζεται στο πάνω μέρος της πληροφόρησης πελατών τμήμα του πράκτορα VICIDIAL οθόνη. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι| +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|Agent Screen Πελατών τηλέφωνο Format - Αυτό το μενού σας επιτρέπει να επιλέξετε τη μορφή του πελάτη τον αριθμό τηλεφώνου που εμφανίζεται στην κατάσταση τμήμα του πράκτορα VICIDIAL οθόνη. Οι επιλογές για τη ρύθμιση αυτή είναι οι εξής: προεπιλογή είναι| +dash separated phone number|παύλα διαχωρίζονται αριθμό τηλεφώνου| +dash separated number with area code in parenthesis|παύλα αριθμός διαχωρίζονται με τον κωδικό περιοχής σε παρένθεση| +No formatting|Δεν μορφοποίησης| +with space after city code|με το διάστημα μετά την πόλη κωδικός| +space separated phone number|χώρος χωρίζεται αριθμό τηλεφώνου| +Agent Screen Header Date Format|Agent Screen Επικεφαλίδας Μορφή Ημερομηνίας| +Agent Screen Customer Date Format|Agent Screen Πελατών Μορφή Ημερομηνίας| +Agent Screen Customer Phone Format|Agent Screen Πελατών τηλέφωνο Μορφοποίηση| +ERROR- There is a problem with the data that you entered, please go back|ERROR-Υπάρχει ένα πρόβλημα με τα δεδομένα που πληκτρολογήσατε, παρακαλώ πηγαίνετε πίσω| +A timeclock session cannot overlap another timeclock session|Μια timeclock συνόδου δεν μπορεί να επικαλύπτονται άλλο timeclock συνόδου| +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|Απενεργοποίηση Alter Πελατών τηλέφωνο - Σε περίπτωση που σε Y, δεν αλλάζει ο πελάτης τον αριθμό τηλεφώνου όταν ένας πράκτορας διαθέσεις την κλήση. Προεπιλεγμένο είναι Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agent API Πρόσβαση - Η επιλογή αυτή επιτρέπει τον λογαριασμό που πρέπει να χρησιμοποιούνται με την vicidial πράκτορας 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|Agent Alter Πελατών τηλέφωνο Παράκαμψη - Η επιλογή αυτή θα υπερισχύσει του όποια κι αν είναι η επιλογή είναι στην εκστρατεία για την τροποποίηση του πελάτη τον αριθμό του τηλεφώνου. NOT_ACTIVE θα χρησιμοποιήσει όποια ρύθμιση είναι παρόντες κατά την εκστρατεία. ALLOW_ALTER θα επιτρέπει πάντα για τον πράκτορα να τροποποιήσει τον αριθμό τηλεφώνου του πελάτη, δεν το θέμα αυτό η εκστρατεία η ρύθμιση. Προεπιλεγμένο είναι NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|Agent API Active - Αν οριστεί σε 1, αυτό θα επιτρέψει τη διασύνδεση API γραφείο να λειτουργεί. Η προεπιλογή είναι 0| +Agent Alter Customer Phone Override: |Agent Alter Πελατών Παράκαμψη Τηλέφωνο:| +Agent API Access: |Agent API Πρόσβαση:| +Disable Alter Customer Phone: |Απενεργοποίηση Alter Πελατών Τηλέφωνο:| +Agent API Active: |Agent API Active:| +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|Εμφάνιση Agent Queue Count - Σε περίπτωση που σε Y, σε περίπτωση που ο πελάτης περιμένει για έναν πράκτορα, ο κοτσίδας ζητεί απεικόνιση στο πάνω μέρος της οθόνης πράκτορας θα γίνονται κόκκινα και δείχνουν τον αριθμό των αναμονής κλήσεων. Προεπιλεγμένο είναι Y| +Agent Display Queue Count: |Εμφάνιση Agent Queue Count:| +agents in dead calls|πράκτορες νεκροί σε κλήσεις| +QC Last Pull Time: |QC Τελευταία Τραβήξτε Ώρα:| +and less than 43200 seconds or 12 hours|και λιγότερο από 43.200 δευτερολέπτων ή 12 ωρών| +LEADS AT LIMIT|LEADS ΣΕ ΟΡΙΑΚΗ| +Lead counts taken from active lists in the campaign only|Μόλυβδος μετράει λαμβάνονται από καταλόγους που δραστηριοποιούνται στην εκστρατεία μόνο| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|QC Get Record Launch- Αυτό επιτρέπει σε μια από τις ακόλουθες δράσεις, το οποίο θα ενεργοποιείται σε ένα QC πράκτορας που λαμβάνει ένα νέο ρεκόρ| +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|QC Δείτε Καταγραφή - Αυτό επιτρέπει την καταγραφή που μπορεί να συνδέεται με την εγγραφή QC να εμφανίζονται στην οθόνη QC πράκτορα| +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|QC Shift - Αυτό είναι το χρονοδιάγραμμα μετάβασης που χρησιμοποιούνται για την έλξη, QC αρχεία για μια καμπάνια. Οι μέρες της εβδομάδας αγνοούνται για αυτές τις λειτουργίες| +QC Get Record Launch|QC Get Record Launch| +QC Show Recording|QC Δείτε Καταγραφή| +QC Shift|QC Shift| +Inbound Group QC Settings|Inbound Ομάδα QC Ρυθμίσεις| +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|QC Shift - Αυτό είναι το χρονοδιάγραμμα μετάβασης που χρησιμοποιούνται για την έλξη, QC αρχεία για μια inbound_group. Οι μέρες της εβδομάδας αγνοούνται για αυτές τις λειτουργίες| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|Η Πώληση Κατηγορία και Dead επικεφαλής της κατηγορίας είναι και οι δύο που χρησιμοποιούνται από το σύστημα όταν Κατάλογος Πρόταση αναλύοντας κατάλογο στατιστικών.| +Sale Category: |Πώληση Κατηγορία:| +Dead Lead Category: |Νεκρά Μόλυβδος Κατηγορία:| +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|Εγχειρίδιο Dial Διηθείται - Αυτό σας επιτρέπει να φιλτράρετε τις κλήσεις που πράκτορες να καλέσετε στο εγχειρίδιο λειτουργίας για την εκστρατεία αυτή με οποιονδήποτε συνδυασμό από τα ακόλουθα: DNC - προβλέπονται για την έναρξη, CAMPAIGNLISTS - ο αριθμός πρέπει να είναι εντός των καταλόγων για την εκστρατεία, ΚΑΝΕΝΑ - δεν υπάρχει φίλτρο για χειροκίνητη κλήση ή γρήγορα dial καταλόγους| +Manual Dial Filter: |Εγχειρίδιο Dial Filter:| +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|Agent Screen Clipboard Αντιγραφή - Αυτή η δυνατότητα είναι ενεργοποιημένη για το παρόν μόνο τον Internet Explorer. Η λειτουργία αυτή σας επιτρέπει να επιλέξετε ένα πεδίο που θα αντιγραφεί στον υπολογιστή πρόχειρο του παράγοντα υπολογιστή σε μια πρόσκληση που απηύθυνε σε έναν πράκτορα. Κοινές χρήσεις για αυτό είναι να καταστεί δυνατή η εύκολη επικόλληση του λογαριασμού αριθμούς ή αριθμούς τηλεφώνου κληρονομιά σε πελάτη σχετικά με τις εφαρμογές πράκτορα υπολογιστή| +Agent Screen Clipboard Copy|Agent Screen Clipboard Αντιγραφή| +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.|EXTENDED αναπληρωματικών αριθμοί είναι αριθμοί που φορτώνονται στο σύστημα εκτός του κανονικού οδηγήσει πληροφορίες οθόνης. Χρησιμοποιώντας EXTENDED σας μπορεί να έχει εκατοντάδες αριθμούς τηλεφώνου για ένα μόνο πελάτη ρεκόρ.| +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|Agent Screen Εκτεταμένη Alt Dial - Αυτό το χαρακτηριστικό επιτρέπει σε υπαλλήλους να επεκταθεί η πρόσβαση των αναπληρωματικών τους αριθμούς τηλεφώνου για οδηγεί πέρα από την κανονική Alt τηλέφωνο και Address3 τομείς που μπορούν να χρησιμοποιηθούν σε VICIDIAL για αριθμούς τηλεφώνου πέραν της κύριας αριθμό τηλεφώνου. Η παράταση μπορεί να είναι αριθμοί τηλεφώνου κλήσης αυτόματα χρησιμοποιώντας το πρόγραμμα Auto-Alt-Dial χαρακτηριστικό στο VICIDIAL ρυθμίσεις της καμπάνιας, αλλά αυτό που επιτρέπει Agent Screen χαρακτηριστικό θα επιτρέψει επίσης τον αντιπρόσωπο για να καλέσετε τους αριθμούς αυτούς από τους πράκτορα οθόνη, καθώς και να επεξεργαστούν τις πληροφορίες| +Agent Screen Extended Alt Dial:|Agent Screen Εκτεταμένη Alt Dial:| +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.|Χρησιμοποίησε Καμπάνια DNC List - Αυτό καθορίζει αν αυτό είναι η εκστρατεία εναντίον ενός φίλτρου οδηγεί DNC λίστα που είναι ειδικά για τη συγκεκριμένη καμπάνια μόνο. Αν είναι να Y, η χοάνη θα εξετάσει, για κάθε αριθμό τηλεφώνου στον αγώνα-ειδικά DNC λίστα πριν από την τοποθέτησή του στην χοάνη. Αν είναι στην εκστρατεία ειδικά DNC λίστα τότε θα αλλάξει το καθεστώς που οδηγούν σε DNCC έτσι δεν μπορεί να εξερχόμενων. Προεπιλεγμένο είναι Ν.| +Use Campaign DNC List|Χρησιμοποίησε Καμπάνια DNC Κατάλογος| +and possibly the campaign-specific DNC list|και πιθανώς η εκστρατεία ειδικά DNC λίστα| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Υπάρχει επίσης η δυνατότητα να προσθέσετε οδηγεί στην καμπάνια-DNC ειδικών καταλόγων για αυτές τις καμπάνιες που έχουν τους| +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|ΣΗΜΕΙΩΣΗ: Η αντιγραφή μιας εκστρατείας θα αντιγράψετε όλες τις ρυθμίσεις από τον πλοίαρχο καμπάνια που θα επιλέξετε, αλλά δεν θα αντιγράψετε μια καμπάνια ειδικά DNC λίστα αν υπήρχε ένα master με την επιλεγμένη καμπάνια| +Add New |Προσθήκη νέου| +Copy |Αντιγραφή| +New DID Addition|Νέα προσθήκη DID| +New Copied DID Addition|Νέα προσθήκη αντιγραφή DID| +Modify |Modify| +Delete |Διαγράφω| +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|Παίξτε στο Τόπος Γραμμή - Αυτό καθορίζει αν ο καλών θα ακούσει τη θέση τους στη γραμμή όταν εισέλθουν στην ουρά, καθώς και όταν ακούν την announcemend. Προεπιλεγμένο είναι Ν| +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|Παίξτε Κρατήστε Εκτιμώμενη ώρα - Αυτό καθορίζει αν ο καλών θα ακούσει τον εκτιμώμενο χρόνο κατέχουν προτού μεταφερθούν σε έναν πράκτορα. Προεπιλεγμένο είναι Ν| +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|Κρατήστε Ώρα Επιλογή - Αυτό σας επιτρέπει να καθορίσετε την δρομολόγηση των κλήσεων, εάν ο εκτιμώμενος χρόνος κατέχουν πάνω από το ποσό των δευτερολέπτων που καθορίζεται παρακάτω. Προεπιλεγμένο είναι ΚΑΝΕΝΑ| +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|Κρατήστε Ώρα Επιλογή δευτερόλεπτα - Αν Κρατήστε Ώρα Επιλογή έχει οριστεί σε οτιδήποτε, αλλά ΚΑΝΕΝΑ, αυτό είναι ο αριθμός των δευτερολέπτων του χρόνου εκτιμάται ότι κατέχουν θα ενεργοποιήσει την αναμονή ώρα της επιλογής. Η προεπιλογή είναι 360 δευτερόλεπτα| +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|Κρατήστε Ώρα Επιλογή Επέκταση - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε ΕΠΕΚΤΑΣΗ, αυτή είναι η επέκταση dialplan ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα| +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|Κρατήστε Ώρα Επιλογή Τηλεφωνητής - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε τηλεφωνητή, αυτή είναι η θέση τηλεφωνητή ότι η πρόσκληση θα σταλεί στο εάν ο εκτιμώμενος χρόνος κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα| +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|Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε IN_GROUP, αυτή είναι η ομάδα που την εισερχόμενη κλήση θα αποσταλεί στο εάν ο εκτιμώμενος χρόνος αναμονή υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα| +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|Κρατήστε Ώρα Επιλογή αρχείου Callback - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε CALLERID_CALLBACK, αυτό είναι το όνομα του αρχείου εντολών που έπαιξε πριν από την κλήση καταγράφεται ως μια νέα πρωτοβουλία στον κατάλογο ID που καθορίζονται κατωτέρω, εάν η εκτιμώμενη κατέχει υπερβαίνει το χρόνο Κρατήστε Ώρα Επιλογή Δευτερόλεπτα| +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|Κρατήστε Ώρα Επιλογή Callback Κατάλογος ID - Αν Κρατήστε Ώρα επιλογή είναι ρυθμισμένη σε CALLERID_CALLBACK, αυτός είναι ο Κατάλογος ID η κλήση προστίθεται ως μια νέα πρωτοβουλία, αν το εκτιμώμενο χρόνο κατέχει υπερβαίνει το Κρατήστε Ώρα Επιλογή Δευτερόλεπτα| +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|Κρατήστε Ανάκληση Μεταφορά σε ομάδα - Σε περίπτωση που ο πελάτης ζητά πίσω σε αυτή την ομάδα-σε περισσότερες από μία φορές και αυτό δεν έχει οριστεί σε ΚΑΝΕΝΑ, τότε η κλήση θα αποστέλλονται αυτόματα στην επιλεγμένη ομάδα σε αυτό το πεδίο . Προεπιλεγμένο είναι ΚΑΝΕΝΑ| +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|Δεν Υστέρηση Call διαδρομή - Η ρύθμιση αυτής να Y θα άρουν όλες τις φορές περιμένουμε και ήχου προτροπές και επιχειρείτε να στείλετε την πρόσκληση δικαίωμα ενός πράκτορα. Δεν υπερισχύει ευπρόσδεκτο μήνυμα ή σε αναμονή εντολών ρυθμίσεις. Προεπιλεγμένο είναι Ν| +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|Παίξτε Καλωσόρισμα - Οι ρυθμίσεις αυτές, όταν επιλέγουν να παίξουν το μήνυμα υποδοχής που ορίζεται, πάντα θα παίζει κάθε φορά, ΠΟΤΕ δεν πρόκειται ποτέ να παίξετε, IF_WAIT_ONLY μόνο θα παίξει το μήνυμα υποδοχής, αν η κλήση δεν πάνε αμέσως σε ένα παράγοντα , και YES_UNLESS_NODELAY θα είναι πάντα ευπρόσδεκτη παίξει το μήνυμα Αν δεν το NO_DELAY η ρύθμιση είναι ενεργοποιημένη. Προεπιλεγμένο είναι πάντα| +Play Place in Line: |Παίξτε στο Line Τόπος:| +Play Estimated Hold Time: |Παίξτε Κρατήστε Εκτιμώμενη Ώρα:| +Hold Time Option: |Κρατήστε την επιλογή Ώρα:| +Hold Time Option Seconds: |Κρατήστε την επιλογή Δευτερόλεπτα Ώρα:| +Hold Time Option Extension: |Κρατήστε Ώρα Επιλογή Παράταση:| +Hold Time Option Voicemail: |Κρατήστε Ώρα Επιλογή Τηλεφωνητής:| +Hold Time Option Transfer In-Group: |Κρατήστε Ώρα Επιλογή Μεταφορά σε ομάδα:| +Hold Time Option Callback Filename: |Κρατήστε Ώρα Επιλογή Callback αρχείου:| +Hold Time Option Callback List ID: |Κρατήστε Ώρα Επιλογή Callback Κατάλογος ID:| +Hold Recall Transfer In-Group: |Κρατήστε Ανάκληση Μεταφορά σε ομάδα:| +No Delay Call Route: |Δεν Υστέρηση Call Διαδρομή:| +Play Welcome Message: |Παίξτε Καλωσόρισμα:| +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|DID Επέκταση - Αυτό είναι το πλήθος, την παράταση ή DID που θα ενεργοποιήσουν την παρούσα θέση και που θα σας διαδρομή, και εντός του συστήματος με τη βοήθεια αυτής της λειτουργίας| +DID Description -<\/B> This is the description of the DID routing entry|DID Περιγραφή - Αυτή είναι η περιγραφή της DID δρομολόγησης εισόδου| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DID Active - Αυτό το πεδίο όπου το σύνολο DID εισόδου σε ενεργό ή μη. Προεπιλεγμένο είναι 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|DID Route - Αυτό το είδος της διαδρομής που μπορείτε να ρυθμίσετε το DID χρήση. Παράταση θα αποστείλει τις κλήσεις προς την επέκταση τέθηκε κάτω, τηλεφωνητή θα αποστείλει κλήσεις απευθείας στον τηλεφωνητή τέθηκε κάτω από το πλαίσιο, ο πράκτορας θα αποστείλει κλήσεις σε VICIDIAL παράγοντα όταν είναι συνδεδεμένοι, τηλέφωνο θα στείλει την κλήση σε τηλέφωνα εισόδου επιλεγεί στη συνέχεια, θα IN_GROUP αποστέλλουν κλήσεις απευθείας από την καθορισμένη εισερχόμενα ομάδα. Προεπιλεγμένο είναι παράταση| +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|Επέκταση - Εάν είναι επιλεγμένο παράταση ως τις DID διαδρομή, τότε αυτή είναι η επέκταση dialplan που ζητά θα αποσταλεί στο. Προεπιλεγμένο είναι 9998811112, της μη παροχής υπηρεσιών| +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|Παράταση Πλαίσιο - Εάν είναι επιλεγμένο παράταση ως τις DID διαδρομή, τότε αυτό είναι το πλαίσιο dialplan ότι οι κλήσεις θα σταλούν σε. Προεπιλογή είναι προεπιλογή| +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|Τηλεφωνητής Πλαίσιο - Τηλεφωνητής Εάν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η θέση τηλεφωνητή ότι οι κλήσεις που θα αποσταλεί στο. Προεπιλεγμένο είναι άδειο| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Τηλέφωνο Επέκταση - ΤΗΛΕΦΩΝΟΥ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το τηλέφωνο που καλεί επέκταση θα αποσταλεί στο.| +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|Τηλέφωνο Server IP - ΤΗΛΕΦΩΝΟΥ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το server IP για το τηλέφωνο που καλεί επέκταση θα σταλεί στο| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|User Agent - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το γραφείο που VICIDIAL κλήσεις θα σταλούν σε| +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|Χρήστης Unavailable Δράση - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομής, και ο χρήστης είναι συνδεδεμένος ή δεν υπάρχουν, τότε αυτή είναι η διαδρομή που θα λάβουν τις προσκλήσεις| +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|Ρυθμίσεις χρήστη Οδός-Στην Ομάδα - ΠΡΑΚΤΟΡΑ Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η ομάδα-Στο ότι θα πρέπει να χρησιμοποιείται για την ουρά ρυθμίσεις του καλούντος είναι σε αναμονή για αποστολή προς τον πράκτορα. Προεπιλεγμένο είναι 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 - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η ομάδα-Στο ότι οι κλήσεις που θα σταλεί στο| +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|Στην Ομάδα-Call Χειριστείτε Μέθοδος - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η πρόσκληση χειρισμό μέθοδος που χρησιμοποιείται για αυτές τις κλήσεις. CID θα προσθέσετε ένα νέο ρεκόρ οδηγήσει με κάθε κλήση χρησιμοποιώντας το CallerID όπως τον αριθμό τηλεφώνου, θα προσπαθήσει να CIDLOOKUP lookup τον αριθμό τηλεφώνου από το CallerID σε ολόκληρο το σύστημα, θα attampt να CIDLOOKUPRL lookup τον αριθμό τηλεφώνου από το CallerID ορίζεται σε ένα μόνο κατάλογο , CIDLOOKUPRC θα attampt να lookup τον αριθμό τηλεφώνου από το CallerID σε όλες τις λίστες που ανήκουν στην καθορίζονται εκστρατεία, ΣΤΕΝΟΤΕΡΗΣ καθορίζεται για VICIDIAL Στενότερος κλήσεις, ANI θα προσθέσει ένα νέο ρεκόρ οδηγήσει με κάθε κλήση χρησιμοποιώντας την ANI όπως ο αριθμός τηλεφώνου, ANILOOKUP θα προσπαθήσει να lookup τον αριθμό τηλεφώνου από το ANI σε ολόκληρο το σύστημα, ANILOOKUPRL θα attampt να lookup τον αριθμό τηλεφώνου από το ANI ορίζεται σε ένα μόνο κατάλογο, θα XDIGITID εντολών του καλούντος για μια Χ ψήφιο κωδικό πριν από την πρόσκληση θα τεθούν σε την ουρά. Προεπιλεγμένο είναι 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|Στην Ομάδα-Agent Search Μέθοδος - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτή είναι η μέθοδος αναζήτησης παράγοντας που πρέπει να χρησιμοποιούνται από τα εισερχόμενα ομάδα, LO είναι Load-Balanced-Υπερχείλιση και θα προσπαθήσει να στείλει την πρόσκληση σε έναν πράκτορα για τον τοπικό διακομιστή πριν δοκιμάσετε να το στείλετε σε έναν πράκτορα σε άλλο διακομιστή, LB Load είναι ισορροπημένη και θα προσπαθήσει να στείλει την πρόσκληση για την επόμενη πράκτορα θέμα αυτό δεν είναι για server, SO-Server είναι το μόνο και θα μόνο να προσπαθήσουμε να στείλουμε τις κλήσεις σε παράγοντες σχετικά με το διακομιστή ότι η πρόσκληση ήταν για. Προεπιλεγμένο είναι 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 - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτός είναι ο Κατάλογος ID που οδηγεί μπορεί να ερευνάται και ότι οδηγεί θα προστεθούν στο αν χρειάζεται| +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 - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το Campaign ID που οδηγεί μπορεί να αναζητήσει σε περίπτωση που η πρόσκληση χειριστεί μέθοδος 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|-Στην ομάδα Τηλέφωνο κώδικα - IN_GROUP Αν έχει επιλεγεί ως η DID διαδρομή, τότε αυτό είναι το τηλέφωνο κώδικα που χρησιμοποιείται εάν μια νέα πρωτοβουλία δημιουργείται| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Τηλέφωνα Email - Η διεύθυνση ηλεκτρονικού ταχυδρομείου που σχετίζονται με αυτό το τηλέφωνο εισόδου. Αυτό χρησιμοποιείται για τηλεφωνητή ρυθμίσεις| +ADD A NEW DID|ADD A NEW DID| +DID Extension: |DID Επέκταση:| +DID Description: |DID Περιγραφή:| +COPY DID|ΑΝΤΙΤΥΠΟ DID| +Source DID: |DID Πηγή:| +DID NOT ADDED|Δέν ΠΡΟΣΤΙΘΕΜΕΝΗ| +there is already a DID in the system with this ID|υπάρχει ήδη μια DID στο σύστημα με αυτό το ID| +there is already a DID in the system with this extension|υπάρχει ήδη μια DID στο σύστημα με την παράταση αυτή| +DID NOT MODIFIED|Δέν ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +DID MODIFIED|DID ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +MODIFY A DID RECORD: |MODIFY A DID RECORD:| +DID Route: |DID Οδός:| +Extension: |Παράταση:| +Extension Context: |Παράταση Πλαίσιο:| +Voicemail Box: |Τηλεφωνητής Box:| +Phone Extension: |Παράταση Τηλέφωνο:| +User Agent: |User Agent:| +User Unavailable Action: |Χρήστης Unavailable δράσης:| +User Route Settings In-Group: |Ρυθμίσεις χρήστη Οδός-Στην ομάδα:| +In-Group ID: |Στην Ομάδα-ID:| +In-Group Call Handle Method: |Στην Ομάδα-Call Χειροκίνητος Τρόπος:| +In-Group Agent Search Method: |Στην Ομάδα-Agent Search Μέθοδος:| +In-Group List ID: |Στην ομάδα Κατάλογος-ID:| +In-Group Campaign ID: |Στην ομάδα της εκστρατείας-ID:| +In-Group Phone Code: |Στην Ομάδα-τηλέφωνο Κωδικός:| +DELETE THIS DID|Διαγραφή αυτής της DID| +Email: |Email:| +DID NOT DELETED|ΔΕΝ ΚΑΤΑΡΓΗΘΗΚΕ| +DID DELETION CONFIRMATION|DID DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ| +Click here to delete |Κάντε κλικ εδώ για να διαγράψετε| +DID DELETION COMPLETED|DID DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ| +Delete DIDs: |Διαγραφή DIDs:| +Modify DIDs: |Τροποποιήστε DIDs:| +To disable the On Hold Prompt, set the interval to 0|Για να απενεργοποιήσετε την Προτροπή σε αναμονή, που το χρονικό διάστημα έως 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|3-Way Outbound Call CallerID - Αυτό ορίζει τι έστειλε ως εξερχόμενο callerID σειρά από 3 δρόμων κλήσεις που διατίθενται από το γραφείο, η καμπάνια χρησιμοποιεί το έθιμο εκστρατεία callerID, ΠΕΛΑΤΗ χρησιμοποιεί τον αριθμό των πελατών που είναι ενεργή παράγοντες για την οθόνη και AGENT_PHONE χρησιμοποιεί το callerID για το τηλέφωνο ότι ο παράγοντας που είναι συνδεδεμένοι στο| +3-Way Call Outbound CallerID:|3-Way Outbound Call CallerID:| +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 επιτρέπει στον αντιπρόσωπο να πραγματοποιηθεί χειροκίνητη κλήση κλήσεις από μια εκστρατεία λίστα, ενώ είναι σε θέση να λάβει εισερχόμενη κλήση κλήσεις μεταξύ εγχειρίδιο κλήσεις| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|ΙΣΧΥΟΝΤΑ θα ισχύουν οι παράγοντες να επιλέγουν μια παύση κωδικό αν κάντε κλικ στο κουμπί PAUSE| +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|3-Way Call Dial Prefix - Αυτό ορίζει τι είναι χρησιμοποιείται ως πρόθεμα κλήσης για 3-way κλήσεις, προεπιλογή είναι άδειο, ώστε η εκστρατεία dial πρόθεμα χρησιμοποιείται, passthru έτσι ώστε να μπορείτε να ακούτε τους ήχους είναι 88| +3-Way Call Dial Prefix|3-Way Call Dial Prefix| +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|Δύναμη Timeclock Είσοδος - Αυτή η επιλογή σας επιτρέπει να μην επιτρέπει να συνδεθείτε με έναν πράκτορα στην VICIDIAL διεπαφή πράκτορα, εάν δεν έχουν συνδεθεί στο timeclock. Προεπιλεγμένο είναι Ν. Υπάρχει η δυνατότητα να εξαιρούν admin χρήστες, 8 και 9 επίπεδα| +Force Timeclock Login|Δύναμη Timeclock Σύνδεση| +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|Στατιστικά Ποσοστό ζητεί απάντηση εντός Χ δευτερόλεπτα - Αυτό το πεδίο σας επιτρέπει να ορίσετε τον αριθμό των δευτερολέπτων που κατέχουν την απεικόνιση σε πραγματικό χρόνο stats θα χρησιμοποιήσουν για να υπολογίσουν το ποσοστό των κλήσεων απαντά ότι απαντήθηκαν εντός Χ αριθμό των δευτερολέπτων σε αναμονή| +Stats Percent of Calls Answered Within X seconds|Στατιστικά Ποσοστό ζητεί απάντηση εντός δευτερολέπτων X| +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.|Web Μορφή Target- Αυτό είναι όπου μπορείτε να ρυθμίσετε το έθιμο ιστοσελίδα πλαίσιο ότι η ηλεκτρονική φόρμα θα ανοίξει όταν ο χρήστης κάνει κλικ στην ηλεκτρονική φόρμα κουμπί. Προεπιλεγμένο είναι _blank.| +Web Form Target|Web Μορφή Target| +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|Για να προσαρμόσετε το ερώτημα string μετά την ηλεκτρονική φόρμα, απλά αρχίζει την ηλεκτρονική φόρμα με VAR και στη συνέχεια τη διεύθυνση URL που θέλετε να χρησιμοποιήσετε, σε αντικατάσταση των μεταβλητών με τις ονομασίες των μεταβλητών που θέλετε να χρησιμοποιήσετε - Α - phone_number - Β -- όπως ακριβώς και στην καρτέλα 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|Καταγραφή Σύνδεσμος - Η ρύθμιση αυτή σας επιτρέπει να παρακάμπτουν την προεπιλογή της οθόνης του συνδέσμου εγγραφή στο admin ιστοσελίδες. Προεπιλεγμένο είναι 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|Αναπληρωματικό Καταγραφή Server IP - Αυτή η ρύθμιση είναι όπου μπορείτε να βάλετε ένα διακομιστή IP ή άλλο μηχάνημα το όνομα που μπορεί να χρησιμοποιηθεί στη θέση του server_ip στις συνδέσεις με ηχογραφήσεις εντός του admin ιστοσελίδες. Προεπιλεγμένο είναι άδειο| +Recording Web Link|Καταγραφή Σύνδεσμος| +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|Ενεργοποίηση Vtiger Ένταξη - Η ρύθμιση αυτή σας δίνει τη δυνατότητα να επιτρέψει την ένταξη Vtiger με VICIDIAL. Σήμερα Vtiger συνδέσμους προς admin και αναζήτησης του χρήστη, καθώς και την αντιγραφή είναι τα μόνα διαθέσιμα στοιχεία ολοκλήρωσης. Η προεπιλογή είναι 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|Vtiger ΣΠ Server IP - Αυτή είναι η διεύθυνση IP της βάσης δεδομένων για την εγκατάσταση Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Vtiger Database Name - Αυτό είναι το όνομα της βάσης δεδομένων για την βάση δεδομένων σας Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Σύνδεση Vtiger Database - Αυτό είναι το όνομα χρήστη που χρησιμοποιείται για να συνδεθείτε στο λογαριασμό σας Vtiger βάση δεδομένων| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Vtiger Database Password - Αυτό είναι το κωδικό πρόσβασης που χρησιμοποιείται για να συνδεθείτε στο λογαριασμό σας Vtiger βάση δεδομένων| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|Vtiger URL - Αυτό είναι το URL ή διεύθυνση web site που χρησιμοποιείται για να σας Vtiger εγκατάσταση| +Enable Vtiger Integration:|Ενεργοποίηση Vtiger Ένταξη:| +Vtiger DB Server IP|Vtiger ΣΠ Server IP| +Vtiger Database Name|Vtiger Database Name| +Vtiger Database Login|Vtiger Database Σύνδεση| +Vtiger Database Password|Vtiger Database Password| +Vtiger URL|Vtiger URL| +VTIGER HOME|VTIGER ΑΡΧΙΚΗ| +Active -<\/B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y|Ενεργή - Το πεδίο αυτό καθορίζει αν ο χρήστης είναι ενεργός στο σύστημα και μπορεί να χρησιμοποιήσει VICIDIAL πόρων. Προεπιλεγμένο είναι Y| +show only active users|Εμφάνιση μόνο των ενεργών χρηστών| +show all users|δείτε όλους τους χρήστες| +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|Αναζήτηση Vtiger Κατηγορία - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεων στη συνέχεια τη ρύθμιση αυτή θα καθορίσει εάν η σελίδα vtiger_search.php θα αναζητήσετε τον αριθμό τηλεφώνου που είχε εγγραφεί. Υπάρχουν 4 επιλογές που μπορεί να χρησιμοποιηθεί στον τομέα αυτό: ΜΟΛΥΒΔΟΥ-Η επιλογή αυτή θα αναζητήσει μέσω του Vtiger οδηγεί μόνο, ΛΟΓΑΡΙΑΣΜΟΥ-Η επιλογή αυτή θα ψάξει μέσω των λογαριασμών Vtiger και όλες τις επαφές και επιμέρους επαφές για τον αριθμό τηλεφώνου, VENDOR-Αυτή η επιλογή μόνο μέσω της αναζήτησης Vtiger πωλητές, ACCTID-Η επιλογή αυτή λειτουργεί μόνο για τους λογαριασμούς και θα λάβει τα vicidial vendor_lead_code τομέα και προσπαθήστε να αναζητήσετε το αναγνωριστικό λογαριασμού Vtiger. Αν ανεπιτυχή θα προσπαθήσουμε τυχόν άλλες μεθόδους που αναφέρονται που έχετε επιλέξει. Πολλαπλές επιλογές μπορούν να χρησιμοποιηθούν για κάθε αναζήτηση, αλλά σε μεγάλες βάσεις δεδομένων που αυτό δεν συνιστάται. Προεπιλεγμένο είναι ΜΟΛΥΒΔΟΥ| +Vtiger Search Category:|Αναζήτηση Vtiger Κατηγορία:| +ACTIVE LISTS CHANGED|ΔΡΑΣΤΙΚΗΣ ΚΑΤΑΛΟΓΟΙ ΜΕΤΑΒΑΛΛΟΜΕΝΩΝ| +SUBMIT ACTIVE LIST CHANGES|ΕΠΙΣΥΝΑΠΤΩ ΚΑΤΑΣΤΑΣΗ ΜΕΤΑΒΟΛΩΝ ΔΡΑΣΤΙΚΗΣ| +LAST CALL DATE|ΤΕΛΕΥΤΑΙΑ ΗΜΕΡΟΜΗΝΙΑ ΥΠΟΒΟΛΗΣ| +User Group Bulk Change|User Group Μαζική Αλλαγή| +Bulk Group Change|Μαζική Αλλαγή ομάδας| +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 Call Record - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεις τότε αυτή η ρύθμιση θα καθορίσει κατά πόσο ένα νέο ρεκόρ Vtiger δραστηριότητα δημιουργείται για την πρόσκληση, όταν ο αντιπρόσωπος πηγαίνει στο vtiger_search σελίδα. Προεπιλεγμένο είναι Y| +Vtiger Create Call Record:|Δημιουργία Vtiger Call Record:| +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|Δημιουργία Vtiger Μόλυβδος Record - Εάν είναι ενεργοποιημένη Vtiger ενσωμάτωση στο σύστημα και τις ρυθμίσεις Vtiger Αναζήτηση ΜΟΛΥΒΔΟ τότε η κατηγορία περιλαμβάνει τη ρύθμιση αυτή θα καθορίσει κατά πόσο ένα νέο ρεκόρ Vtiger οδηγήσει δημιουργείται όταν ο πράκτορας πηγαίνει στη σελίδα vtiger_search και δεν είναι βρέθηκαν να έχουν την κλήση του αριθμού τηλεφώνου. Προεπιλεγμένο είναι Y| +Vtiger Create Lead Record:|Δημιουργία 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|Vtiger Screen Είσοδος - Εάν είναι ενεργοποιημένη Vtiger ένταξη στο σύστημα ρυθμίσεις τότε αυτή η ρύθμιση θα καθορίσει κατά πόσο ο χρήστης είναι συνδεδεμένος στο Vtiger διεπαφής αυτόματα όταν συνδεθείτε στο VICIDIAL. Προεπιλεγμένο είναι Y| +Vtiger Screen Login:|Vtiger Screen Είσοδος:| +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|Alert Enabled - Το πεδίο αυτό δείχνει κατά πόσο ο μεσάζων έχει τη δυνατότητα web browser ειδοποιήσεις για κλήσεις όταν έρθουν σε vicidial.php συνόδου τους. Η προεπιλογή είναι 0 για τα NO| +Alert Enabled:|Alert Enabled:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|QC Χαρακτηριστικά Active - Αυτή η επιλογή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε τη QC ή Ποιοτικός Έλεγχος χαρακτηριστικά. Η προεπιλογή είναι 0 για το ανενεργό| +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|Εξερχόμενο Auto-Dial Active - Αυτή η επιλογή σας επιτρέπει να ενεργοποιήσετε ή να απενεργοποιήσετε τον εξερχόμενο αυτόματης κλήσης εντός VICIDIAL, θέτοντας σε αυτόν τον τομέα θα 0 αφαίρεση των καταλόγων και ΦΙΛΤΡΑ πολλά τμήματα και τομείς από το Campaign Τροποποίηση οθόνες. Εγχειρίδιο εισόδου κλήσης θα εξακολουθεί να είναι εντός των επιτρεπομένων από τον αντιπρόσωπο της οθόνης, αλλά δεν κατάλογο κλήσης θα είναι δυνατή. Η προεπιλογή είναι 1 για ενεργή| +QC Features Active:|QC Χαρακτηριστικά Active:| +Outbound Auto-Dial Active:|Εξερχόμενο Auto-Dial Active:| +Close Panel|Κλείστε Panel| +Choose Report Display Options|Επιλογές εμφάνισης Επιλέξτε Έκθεση| +To select more than 1 campaign, hold down the Ctrl key and click|Για να επιλέξετε περισσότερα από 1 εκστρατείας, κρατήστε πατημένο το πλήκτρο Ctrl και κάντε κλικ| +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|CPD AMD Δράση - Αν χρησιμοποιείτε τον Sangoma ParaXip Πρόσκληση πρόοδος Ανίχνευση λογισμικό και στη συνέχεια θα θέλετε να ενεργοποιήσετε αυτή τη ρύθμιση, είτε να DISPO που θα διαθέσεις την πρόσκληση ως AA και να κολλήσει το πάνω αν η πρόσκληση είναι υπό επεξεργασία και δεν έχει σταλεί σε έναν πράκτορα ή ακόμη μήνυμα που θα αποστείλει την πρόσκληση προς το τηλεφωνητή Μήνυμα ορίζεται για αυτή την καμπάνια. Προεπιλεγμένο είναι DISABLED| +CPD AMD Action:|CPD AMD δράσης:| +Click here for user multiple day status detail report|Κάντε κλικ εδώ για το χρήστη πολλαπλών ημέρες καθεστώς λεπτομερώς την έκθεση| +Click here to download this list|Κάντε κλικ εδώ για να κατεβάσετε τον κατάλογο αυτό| +Download Lists:|Κατεβάστε Λίστες:| +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|Asterisk Active Server - Αν Asterisk δεν εκτελείται σε αυτόν το διακομιστή ή αν VICIDIAL δεν θα πρέπει να χρησιμοποιούν αυτό το διακομιστή ή αν είναι μόνο με τη χρήση αυτού του διακομιστή για άλλα σενάρια, όπως η χοάνη φόρτωσης script που θέλετε να ρυθμίσετε αυτή να Ν. Προεπιλ είναι 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|Δημιουργήστε conf αρχεία - Αν θα θέλατε το σύστημα auto-δημιουργούν αστερίσκο conf αρχεία με βάση τις ενδείξεις τηλεφώνων, την εξισορρόπηση φορτίου εγγραφές και εγκατάσταση εντός VICIDIAL τότε που αυτό να είναι Προεπιλ Y. 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|Αναδημιουργία conf αρχεία - Αν θέλετε να αναγκάσετε μια ανακατασκευή του Asterisk conf αρχεία ή αν κάποιο από τα τηλέφωνα ή μεταφορέα εγγραφές έχουν αλλάξει, τότε αυτό θα πρέπει να ρυθμιστεί σε Υ. Μετά την conf αρχεία που έχουν δημιουργηθεί και έχει Asterisk φορτώθηκε στη συνέχεια, αυτό θα αλλάξει σε Ν. Προεπιλεγμένο είναι Y| +Active Asterisk Server:|Asterisk Active Server:| +Generate conf files:|Δημιουργήστε conf αρχεία:| +Rebuild conf files:|Αναδημιουργία conf αρχεία:| +Show Templates|Δείτε Templates| +Add A New Template|Προσθέστε ένα νέο πρότυπο| +ADD NEW CONF TEMPLATE|Προσθήκη νέου ΠΙΣΤ TEMPLATE| +ADD NEW CARRIER|Προσθήκη νέου ΘΑΛΑΜΙΣΚΟ| +ADDING NEW CONF TEMPLATE|Την προσθήκη νέων ΠΙΣΤ TEMPLATE| +ADDING NEW CARRIER|Την προσθήκη νέων ΘΑΛΑΜΙΣΚΟ| +MODIFY CONF TEMPLATE|MODIFY ΠΙΣΤ TEMPLATE| +MODIFY CARRIER|MODIFY ΘΑΛΑΜΙΣΚΟ| +DELETE CONF TEMPLATE|DELETE ΠΙΣΤ TEMPLATE| +DELETE CARRIER|DELETE ΘΑΛΑΜΙΣΚΟ| +CONF TEMPLATE LIST|ΠΙΣΤ TEMPLATE ΚΑΤΑΛΟΓΟΣ| +CARRIER LIST|ΘΑΛΑΜΙΣΚΟ ΚΑΤΑΛΟΓΟΣ| +Template ID:|Αναγνωριστικό:| +Template Name:|Όνομα:| +Template Contents:|Template Περιεχόμενα:| +Carrier ID:|Θαλαμίσκος ID:| +Carrier Name:|Φέρον Όνομα:| +Registration String:|Εγγραφή String:| +Account Entry:|Λογαριασμός Είσοδος:| +Protocol:|Πρωτόκολλο:| +Globals String:|Globals String:| +Dialplan Entry:|Dialplan Είσοδος:| +CONF TEMPLATE NOT ADDED|ΠΙΣΤ TEMPLATE δεν προστίθενται| +there is already a template in the system with this ID|υπάρχει ήδη ένα πρότυπο σε αυτό το σύστημα, με αυτό το ID| +CONF TEMPLATE ADDED|ΠΙΣΤ TEMPLATE ΠΡΟΣΤΙΘΕΜΕΝΗ| +CARRIER NOT ADDED|ΘΑΛΑΜΙΣΚΟ δεν προστίθενται| +there is already a carrier in the system with this ID|υπάρχει ήδη ένα μεταφορέα στο σύστημα με αυτό το ID| +CONF TEMPLATE NOT MODIFIED|ΠΙΣΤ TEMPLATE ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +CARRIER NOT MODIFIED|ΔΕΝ ΘΑΛΑΜΙΣΚΟ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +CARRIER MODIFIED|ΘΑΛΑΜΙΣΚΟ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +CONF TEMPLATE NOT DELETED|ΠΙΣΤ TEMPLATE δεν διαγράφονται| +Template ID be at least 2 characters in length|Πρότυπο ID να είναι τουλάχιστον 2 χαρακτήρες| +CONF TEMPLATE DELETION CONFIRMATION|ΠΙΣΤ TEMPLATE DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ| +Click here to delete conf template|Κάντε κλικ εδώ για να διαγράψετε το πρότυπο conf| +CARRIER NOT DELETED|ΘΑΛΑΜΙΣΚΟ δεν διαγράφονται| +Carrier ID be at least 2 characters in length|Θαλαμίσκος ID να είναι τουλάχιστον 2 χαρακτήρες| +CARRIER DELETION CONFIRMATION|ΘΑΛΑΜΙΣΚΟ DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ| +Click here to delete carrier|Κάντε κλικ εδώ για να διαγράψετε μεταφορέα| +CONF TEMPLATE DELETION COMPLETED|ΠΙΣΤ TEMPLATE DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ| +CARRIER DELETION COMPLETED|ΘΑΛΑΜΙΣΚΟ DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ| +MODIFY A CONF TEMPLATE RECORD|MODIFY Α ΠΙΣΤ TEMPLATE RECORD| +DELETE THIS CONF TEMPLATE|Διαγραφή αυτής της ΠΙΣΤ TEMPLATE| +MODIFY A CARRIER RECORD|MODIFY Α ΘΑΛΑΜΙΣΚΟ RECORD| +DELETE THIS CARRIER|Διαγραφή αυτής της CARRIER| +CARRIERS WITHIN THIS SERVER|ΜΕΤΑΦΟΡΕΙΣ WITHIN THIS SERVER| +CONF TEMPLATE LISTINGS|ΠΙΣΤ TEMPLATE Καταχωρίσεις| +CARRIER LISTINGS|ΘΑΛΑΜΙΣΚΟ Καταχωρίσεις| +PHONES USING THIS CONF TEMPLATE|PHONES ΧΡΗΣΙΜΟΠΟΙΩΝΤΑΣ ΤΗΝ ΠΑΡΟΥΣΑ ΠΙΣΤ TEMPLATE| +CARRIERS USING THIS CONF TEMPLATE|Που χρησιμοποιούν ΠΑΡΟΝΤΑ ΠΙΣΤ TEMPLATE| +Conf Override:|Επιβ Override:| +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 Template - Το πεδίο αυτό πρέπει να είναι τουλάχιστον 2 χαρακτήρες και δεν υπερβαίνει τους 15 χαρακτήρες σε μήκος, δεν χώρους. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για τον προσδιορισμό της conf πρότυπο σε ολόκληρο το σύστημα| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Όνομα - Αυτό είναι το όνομα του αρχείου conf πρότυπο εισόδου| +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|Περιεχόμενα Template - Το πεδίο αυτό είναι όπου μπορείτε να εισάγετε τις ειδικές ρυθμίσεις στο να χρησιμοποιηθούν από όλα τα τηλέφωνα και-ή αερομεταφορέων που έχουν ρυθμιστεί να χρησιμοποιούν αυτό το πρότυπο conf. Τα πεδία που δεν θα πρέπει να περιλαμβάνονται στη θέση αυτή είναι: μυστικό, accountcode, υπόψη, username και το γραμματοκιβώτιο| +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 Carrier - Το πεδίο αυτό πρέπει να είναι τουλάχιστον 2 χαρακτήρες και δεν υπερβαίνει τους 15 χαρακτήρες σε μήκος, δεν χώρους. Αυτό είναι το αναγνωριστικό που θα χρησιμοποιείται για τον προσδιορισμό του αερομεταφορέα για τη συγκεκριμένη θέση σε όλο το σύστημα| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Όνομα Carrier - Αυτό είναι το όνομα του μεταφορέα εισόδου| +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 - Το πεδίο αυτό είναι όπου μπορείτε να εισαγάγετε στον ακριβή συμβολοσειρά που απαιτούνται στο SIP IAX ή αρχείο διαμόρφωσης για να εγγραφείτε στο φορέα παροχής υπηρεσιών. Προαιρετικό αλλά συνιστάται ιδιαίτερα αν ο φορέας σας επιτρέπει την καταχώριση| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|ID Template - Αυτό το προαιρετικό πεδίο σας επιτρέπει να επιλέξετε ένα πρότυπο conf αρχείο για τον εν λόγω αερομεταφορέα εισόδου| +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|Λογαριασμός Θέση - Το πεδίο αυτό χρησιμοποιείται αν δεν έχετε επιλέξει να χρησιμοποιήσετε ένα πρότυπο, και είναι όπου μπορείτε να εισαγάγετε στον ειδικό λογαριασμό ρυθμίσεις που πρέπει να χρησιμοποιείται για τον εν λόγω αερομεταφορέα| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Πρωτόκολλο - Αυτό το πεδίο σας επιτρέπει να ορίσετε το πρωτόκολλο να χρησιμοποιήσετε για την είσοδο του μεταφορέα. Επί του παρόντος μόνο SIP IAX και υποστηρίζονται| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|Globals String - Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε μια global μεταβλητή που θα χρησιμοποιηθεί για τον μεταφορέα στο dialplan| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Dialplan Είσοδος - Αυτό το προαιρετικό πεδίο σας επιτρέπει να ορίσετε ένα σύνολο dialplan καταχωρήσεις να χρησιμοποιήσετε για τον εν λόγω αερομεταφορέα| +Server IP -<\/B> This is the server that this specific carrier record is associated with|Server IP - Αυτό είναι το διακομιστή ότι αυτό το συγκεκριμένο μεταφορέα εγγραφή είναι συνδεδεμένες με| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Ενεργή - Αυτό καθορίζει εάν ο μεταφορέας θα συμπεριληφθούν στα auto-conf αρχεία που δημιουργούνται ή δεν| +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|Επιβ Παράκαμψη Ρυθμίσεις - Αν πληθυσμό, και το πρότυπο που να είναι ID - ΚΑΝΕΝΑ - τότε το περιεχόμενο της εν λόγω τομέα χρησιμοποιούνται ως conf αρχείο καταχωρήσεις για αυτό το τηλέφωνο. generate_vicidial_conf τηλέφωνα server για αυτό πρέπει να ρυθμιστεί σε αυτό το Y για να εργαστούν. Το πεδίο αυτό δεν θα πρέπει να περιλαμβάνει το [επέκταση] γραμμή, που θα είναι αυτόματα| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|ID Template - Αυτό είναι το πρότυπο αρχείο conf ID εισόδου ότι αυτό το τηλέφωνο θα χρησιμοποιήσει για την Asterisk ρυθμίσεις. Προεπιλεγμένο είναι - ΚΑΝΕΝΑ --| +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|Αν πρόκειται να λαμβάνουν σε εισερχόμενα κλήσεις από τον εν λόγω αερομεταφορέα κορμού μπορεί να θέλετε να ρυθμίσετε το πλαίσιο = trunkinbound σε αυτό τον τομέα, ώστε να μπορείτε να χρησιμοποιήσετε τη διαδικασία χειρισμού DID εντός 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|Υπάρχει reserved προεπιλογή DID που μπορείτε να χρησιμοποιήσετε το οποίο είναι μόνο η λέξη-default-χωρίς παύλες, ότι θα μπορείτε να στείλετε ΑΛΛΟΣ κάθε κλήση που δεν ταιριάζει με οποιαδήποτε άλλα υφιστάμενα πρότυπα στην προεπιλεγμένη DID| +Campaign VDAD extension|Καμπάνια VDAD επέκταση| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Το πεδίο αυτό επιτρέπει για μια προσαρμοσμένη VDAD μεταφορά επέκταση. Αυτό σας επιτρέπει να χρησιμοποιήσετε διάφορες μεθόδους χειρισμού κλήσεων, ανάλογα με την καμπάνια σας.| + - 8364 - same as 8368|- 8364 - 8368 ως ίδια| + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Θα στείλετε την πρόσκληση σε ένα μόνο παράγοντα στον ίδιο διακομιστή, όπως είναι η πρόσκληση για| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Χρησιμοποιείται για Τύπο-1 εκστρατείες και έρευνα| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - Θα προσπαθήσουμε πρώτα να στείλετε την πρόσκληση σε έναν πράκτορα για τον τοπικό διακομιστή, τότε θα ψάξει για άλλους servers| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - DEFAULT; Θα στείλετε την πρόσκληση για το επόμενο διαθέσιμο πράκτορα θέμα αυτό δεν είναι για server| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση ότι μετά, ίδια συμπεριφορά ως 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Χρησιμοποιείται για τηλεφωνητή Ανίχνευση μετά την ίδια συμπεριφορά ως 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.|Επίσης σε αυτό το τμήμα της WEB VARs για κάθε καμπάνια. Αυτά επιτρέπουν κάθε παράγοντα να έχει μια διαφορετική μεταβλητή συμβολοσειρά που μπορεί να προστεθεί στην ηλεκτρονική φόρμα ή SCRIPT καρτέλα URLs από απλά θέτοντας - Α - web_vars - Β - όπως θα την κάθε άλλο τομέα.| +Group Alias List|Ομάδα Γνωστός Κατάλογος| +Add A New Group Alias|Προσθέστε μια νέα ομάδα Γνωστός| +ADD NEW GROUP ALIAS|Προσθήκη νέου GROUP ALIAS| +ADDING NEW GROUP ALIAS|Την προσθήκη νέων GROUP ALIAS| +MODIFY GROUP ALIAS|MODIFY GROUP ALIAS| +DELETE GROUP ALIAS|Διαγραφή ομάδας ALIAS| +GROUP ALIAS LIST|ΟΜΑΔΑ ALIAS ΚΑΤΑΛΟΓΟΣ| +GROUP ALIAS LISTINGS|ΟΜΑΔΑ ALIAS Καταχωρίσεις| +MODIFY A GROUP ALIAS RECORD|MODIFY Α ΟΜΙΛΟΣ ALIAS RECORD| +Group Alias ID|Ομάδα Γνωστός ID| +Group Alias Name|Ομάδα ψευδώνυμο| +CallerID Number|CallerID Αριθμός| +CallerID Name|CallerID Όνομα| +DELETE THIS GROUP ALIAS|Διαγράψετε αυτή την ομάδα ALIAS| +GROUP ALIAS NOT MODIFIED|ALIAS ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +GROUP ALIAS MODIFIED|ΟΜΑΔΑ ALIAS ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ| +ADD A NEW GROUP ALIAS|ADD μια νέα ομάδα ALIAS| +MODIFY A GROUP ALIAS RECORD|MODIFY Α ΟΜΙΛΟΣ ALIAS RECORD| +GROUP ALIAS NOT ADDED|ΟΜΑΔΑ ALIAS δεν προστίθενται| +GROUP ALIAS ADDED|ΟΜΑΔΑ ALIAS ΠΡΟΣΤΙΘΕΜΕΝΗ| +GROUP ALIAS NOT DELETED|ΟΜΑΔΑ ALIAS δεν διαγράφονται| +GROUP ALIAS DELETION CONFIRMATION|ΟΜΑΔΑ ALIAS DELETION ΕΠΙΒΕΒΑΙΩΣΗΣ| +Click here to delete group alias|Κάντε κλικ εδώ για να διαγράψετε ομάδα άλλως| +GROUP ALIAS DELETION COMPLETED|ΟΜΑΔΑ ALIAS DELETION ΣΥΜΠΛΗΡΩΜΕΝΟ| +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 - Η ID της ομάδας άλλως χρησιμοποιείται από τους αντιπροσώπους που ορίζονται για να καλέσετε τις κλήσεις από το VICIDIAL πράκτορα διεπαφής με διαφορετικές ταυτότητες καλούντος. δεν κενά ή άλλους ειδικούς χαρακτήρες επιτρέπονται. Πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Ομάδα ψευδώνυμο - Το όνομα που χρησιμοποιείται για να περιγράψει μια ομάδα άλλως, πρέπει να είναι μεταξύ 2 και 50 χαρακτήρες| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Αριθμός Ταυτότητας καλούντος - Η καλούντος αριθμό ταυτότητας που χρησιμοποιούνται σε αυτή την ομάδα Γνωστός. Πρέπει να είναι μόνο ψηφία| +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|Όνομα καλούντος ID - Το όνομα του καλούντος ID που μπορούν να αποσταλούν με αυτή την ομάδα Γνωστός. Από όσο γνωρίζουμε αυτό θα λειτουργήσει μόνο στον Καναδά και στις PRI κυκλωμάτων χρησιμοποιώντας IAX βρόχο κορμού μέσω 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|Ομάδα Γνωστός Επιτρέπεται - Αν θέλετε να σας επιτρέψει πράκτορες να χρησιμοποιούν ψευδώνυμα ομάδα τότε πρέπει να ορίσετε αυτή την ομάδα να Y. Γνωστός εξηγούνται περισσότερο στο τμήμα Διοίκησης, που επιτρέπει στους εκπροσώπους να επιλέξετε διαφορετικό callerIDs εγχειρίδιο για εξερχόμενες κλήσεις ότι μπορεί να πραγματοποιηθεί. Προεπιλεγμένο είναι Ν| +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|Προεπιλεγμένη ομάδα Γνωστός - Αν έχετε επιτρέπεται Γνωστός ομάδα, τότε αυτό είναι γνωστός και ότι η ομάδα έχει επιλεγεί από προεπιλογή κατά την πρώτη του πράκτορα επιλέγει να χρησιμοποιήσει μια ομάδα Γνωστός για εξερχόμενες κλήσης εγχειρίδιο. Προεπιλεγμένο είναι ΚΑΝΕΝΑ ή κενό| +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|Προεπιλεγμένη ομάδα Γνωστός - Αν έχετε τη δυνατότητα Ομάδα Γνωστός για την εκστρατεία ότι ο αντιπρόσωπος είναι συνδεδεμένοι στο τότε αυτή είναι η ομάδα που έχει επιλεγεί άλλως πρώτα από προεπιλογή για μια κλήση που προέρχεται από αυτή την ομάδα, όταν ο εισερχόμενος πράκτορας επιλέγει να χρησιμοποιήσετε μια ομάδα Γνωστός για εξερχόμενες κλήσης εγχειρίδιο. Προεπιλεγμένο είναι ΚΑΝΕΝΑ ή κενό| +Group Alias Allowed|Ομάδα Γνωστός Επιτρέπεται| +Default Group Alias|Προεπιλεγμένη ομάδα Γνωστός| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE επιτρέπει να επιλέγουν τον πράκτορα που callerID να χρησιμοποιήσετε για την 3-way ζητεί από μια λίστα επιλογών.| +you cannot use reserved words in group aliases|δεν μπορείτε να χρησιμοποιήσετε τις δεσμευμένες λέξεις της ομάδας ψευδώνυμα| +Agent Shift Enforcement Override|Agent Shift Επιβολή Override| +Manager Shift Enforcement Override|Manager Shift Επιβολή Override| +Shift Enforcement|Shift εκτέλεση| +Max Calls per Second|Max ζητεί ανά Δεύτερη| +Max FILL Calls per Second|Max ΣΥΜΠΛΗΡΩΣΤΕ ζητεί ανά Δεύτερη| +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.|Η ρύθμιση αυτή θα αντικαταστήσει τους χρήστες ανεξάρτητα από την ομάδα χρηστών που έχει για την εκτέλεση Shift. DISABLED θα χρησιμοποιήσει ο χρήστης ομάδα ρύθμιση. OFF δεν θα επιβάλει σε όλες τις βάρδιες. START θα επιβάλει μόνο το χρόνο σύνδεσης, αλλά δεν θα επηρεάσει έναν πράκτορα που εκτελεί τους πάνω μετατόπιση του χρόνου και αν είναι ήδη συνδεδεμένος in. ALL θα επιβάλλει μετατόπιση χρόνος έναρξης και θα συνδεθείτε ορίζονται μετά από έναν πράκτορα που τρέχουν πάνω από το τέλος του χρόνου τους βάρδια. Η προεπιλογή είναι άτομα με ειδικές ανάγκες.| +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.|Η ρύθμιση αυτή ορίζεται σε 1, αν θα επιτρέψει ο διαχειριστής του να εισέλθει στα χρήστη και κωδικό πρόσβασης σε έναν πράκτορα της οθόνης για να παρακάμψετε τους περιορισμούς σχετικά με τη μετατόπιση ενός πράκτορα συνόδου εάν ο πράκτορας προσπαθεί να συνδεθείτε με τους εκτός της βάρδιας. Η προεπιλογή είναι 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.|Η ρύθμιση αυτή σας επιτρέπει να περιορίσετε πράκτορα συνδέσεις με βάση τις αλλαγές που έχουν επιλεγεί. OFF δεν θα επιβάλει σε όλες τις βάρδιες. START θα επιβάλει μόνο το χρόνο σύνδεσης, αλλά δεν θα επηρεάσει έναν πράκτορα που εκτελεί τους πάνω μετατόπιση του χρόνου και αν είναι ήδη συνδεδεμένος in. ALL θα επιβάλλει μετατόπιση χρόνος έναρξης και θα συνδεθείτε ορίζονται μετά από έναν πράκτορα που τρέχουν πάνω από το τέλος του χρόνου τους βάρδια. Προεπιλεγμένο είναι 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.|Αυτή η ρύθμιση καθορίζει το μέγιστο αριθμό των κλήσεων που μπορούν να διατεθούν από το εξερχόμενο αυτόματη κλήση δέσμης ενεργειών σε αυτόν το διακομιστή ανά δευτερόλεπτο. Πρέπει να είναι από 1 έως 100. Η προεπιλογή είναι 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.|Αυτή η ρύθμιση καθορίζει το μέγιστο αριθμό των κλήσεων που μπορούν να διατεθούν από το auto-ΣΥΜΠΛΗΡΩΣΤΕ εξερχό auto-κλήση δέσμης ενεργειών για όλους τους διακομιστές, ανά δευτερόλεπτο. Πρέπει να είναι από 1 έως 200. Η προεπιλογή είναι 40.| +System Load|System Load| +Live Channels|Live Channels| +Disk Usage|Disk Usage| +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.|Τα δύο αυτά στατιστικά στοιχεία δείχνουν την loadavg ενός συστήματος φορές 100 και το ποσοστό χρήσης της CPU του διακομιστή και ενημερώνεται ανά λεπτό. Η loadavg θα πρέπει να είναι κατά μέσο όρο κάτω των 100 πολλαπλασιάζεται με τον αριθμό των πυρήνων της CPU σας σύστημα, για τη βέλτιστη απόδοση. Η χρήση της CPU ποσοστό θα πρέπει να παραμείνει κάτω από 50 για τη βέλτιστη απόδοση.| +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.|Αυτό το πεδίο δείχνει τον τρέχοντα αριθμό των σταθμών Asterisk που ζουν με το σύστημα τώρα. Είναι σημαντικό να σημειωθεί ότι ο αριθμός των καναλιών Asterisk είναι συνήθως πολύ υψηλότερη από τον πραγματικό αριθμό των κλήσεων σε ένα σύστημα. Το πεδίο αυτό ενημερώνεται μία φορά ανά λεπτό.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Το πεδίο αυτό θα δείξει το δίσκο χρήσης για κάθε διαμέρισμα σε αυτόν το διακομιστή. Το πεδίο αυτό ενημερώνεται μία φορά ανά λεπτό.| +ADMIN CHANGE LOG|ADMIN CHANGE LOG| +USER ADMIN CHANGE LOG|ΧΡΗΣΤΗΣ ΔΙΟΙΚΗΣΗΣ CHANGE LOG| +SECTION ADMIN CHANGE LOG|ΤΜΗΜΑ ΔΙΟΙΚΗΣΗΣ CHANGE LOG| +DETAIL ADMIN CHANGE LOG|ΛΕΠΤΟΜΕΡΕΙΑ ADMIN CHANGE LOG| +Last 10000 records|Τελευταία 10.000 εγγραφές| +Changes made by|Οι αλλαγές που έγιναν από| +Record Detail|Εγγραφή Λεπτομέρειες| +Section Records|Τμήμα Εγγραφές| +Click here to see Admin chages to this record|Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το αρχείο| +Click here to see Admin chages to this campaign|Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την εκστρατεία| +Click here to see Admin chages to this list|Κάντε κλικ εδώ για να δείτε chages Διαχειριστής σε αυτήν την λίστα| +Click here to see Admin chages to this In-Group|Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages In-Group| +Click here to see Admin chages to this DID|Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages DID| +Click here to see Admin chages to this remote agent|Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το απομακρυσμένο πράκτορα| +Click here to see Admin chages to this user group|Κάντε κλικ εδώ για να δείτε σε αυτό το Admin chages ομάδα χρηστών| +Click here to see Admin chages to this script|Κάντε κλικ εδώ για να δείτε Admin chages σε αυτό το σενάριο| +Click here to see Admin chages to this filter|Κάντε κλικ εδώ για να δείτε Admin chages για αυτό το φίλτρο| +Click here to see Admin chages to this call time|Κάντε κλικ εδώ για να δείτε Admin chages φορά σε αυτή την έκκληση| +Click here to see Admin chages to this shift|Κάντε κλικ εδώ για να δείτε Admin chages την εξέλιξη αυτή| +Click here to see Admin chages to this phone alias|Κάντε κλικ εδώ για να δείτε Admin chages να άλλως αυτό το τηλέφωνο| +Click here to see Admin chages to this group alias|Κάντε κλικ εδώ για να δείτε Admin chages άλλως σε αυτή την ομάδα| +Click here to see Admin chages to this server|Κάντε κλικ εδώ για να δείτε Admin chages σε αυτόν τον διακομιστή| +Click here to see Admin chages to this conf template|Κάντε κλικ εδώ για να δείτε Admin chages conf σε αυτό το πρότυπο| +Click here to see Admin chages to this carrier|Κάντε κλικ εδώ για να δείτε Admin chages για τον εν λόγω αερομεταφορέα| +Click here to see Admin chages to the system settings|Κάντε κλικ εδώ για να δείτε Admin chages για τις ρυθμίσεις του συστήματος| +Export Reports|Εξαγωγή Εκθέσεις| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει την πρόσβαση του διευθυντή της εξαγωγής κλήση εκθέσεις σχετικά με τις εκθέσεις της οθόνης. Η προεπιλογή είναι 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.|Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει τη Διαχείριση κλικ για να κατεβάσετε την λίστα σύνδεσμο στο κάτω μέρος της οθόνης μια λίστα τροποποίηση για την εξαγωγή του συνόλου του περιεχομένου του καταλόγου σε μια επίπεδη αρχείο δεδομένων. Η προεπιλογή είναι 0.| +Export Calls Report|Εξαγωγή ζητεί έκθεση| +EXPORT CALLS REPORT|ΕΚΘΕΣΗ ΕΞΑΓΩΓΗΣ CALLS| +For the Export Calls Report, the following field order is used for exports|Για την εξαγωγή ζητεί έκθεση, ώστε τα ακόλουθα τομέα χρησιμοποιείται για τις εξαγωγές| +Timeclock|Ώρα ρολόι| +Logout|Αποσύνδεση| +Show Users|Δείτε Χρήστες| +Add A New User|Προσθήκη νέου χρήστη| +Search For A User|Αναζήτηση ενός χρήστη| +User Stats|Στατιστικά Χρήστη| +User Status|Κατάσταση χρήστη| +Time Sheet|Ώρα Φύλλο| +Days Status|Ημέρες Status| +Campaigns Main|Κύρια Καμπάνιες| +Statuses|Καθεστώτων| +HotKeys|HotKeys| +Lead Recycle|Μόλυβδος Ανακύκλωσης| +Auto Alt-Dial|Auto Alt-Dial| +Auto Alt Dial|Alt Auto Dial| +List Mix|Κατάλογος Mix| +Pause Codes|Παύση Κώδικες| +Basic|Βασική| +Detail|Λεπτομέρειες| +Survey|Έρευνα| +Real-Time|Real-Time| +CAMPAIGN ID|CAMPAIGN ID| +DIAL PLAN|DIAL PLAN| +DIAL METHOD|ΤΗΛΕΦΩΝΕΙΣΤΕ ΜΕΘΟΔΟΣ| +LEADS COUNT|LEADS COUNT| +LEAD ORDER|ΜΟΛΥΒΔΟΥ ORDER| +DIAL STATUSES|ΤΗΛΕΦΩΝΕΙΣΤΕ καθεστώτων| +SCRIPT ID|SCRIPT ID| +SCRIPT NAME|SCRIPT ΟΝΟΜΑ| +USER GROUP|ΟΜΑΔΑ ΧΡΗΣΤΩΝ| +GROUP NAME|Όνομα Ομάδας| +PRIORITY|ΠΡΟΤΕΡΑΙΟΤΗΤΑΣ| +FORCE TIMECLOCK|ΙΣΧΥΟΝΤΑ TIMECLOCK| +CALLTIME ID|CALLTIME ID| +CALLTIME NAME|CALLTIME ΟΝΟΜΑ| +DEFAULT START|DEFAULT START| +DEFAULT STOP|DEFAULT STOP| +SHIFT ID|SHIFT ID| +SHIFT NAME|SHIFT ΟΝΟΜΑ| +SHIFT START|SHIFT START| +SHIFT LENGTH|SHIFT ΜΗΚΟΣ| +WEEKDAYS|Καθημερινά| +Template ID|Πρότυπο ID| +Template Name|Όνομα| +Carrier ID|Θαλαμίσκος ID| +Carrier Name|Φέρον Όνομα| +Registration|Εγγραφή| +Active|Ενεργό| +USER ID|ID ΧΡΗΣΤΗ| +FULL NAME|ΟΝΟΜΑΤΕΠΩΝΥΜΟ| +LEVEL|ΕΠΙΠΕΔΟ| +LINKS|ΣΥΝΔΕΣΜΟΙ| +TRUNKS|Μπαούλα| +HUMAN|ΑΝΘΡΩΠΙΝΗ| +ANSWER|ΑΠΑΝΤΗΣΗ| +CATEGORY|ΚΑΤΗΓΟΡΙΑ| +STATUSES IN THIS CATEGORY|Καθεστώτων σε αυτήν την κατηγορία| +Display|Εμφάνιση| +Dates|Ημερομηνίες| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|Επιλέξτε μια καμπάνια ή ομάδα χρηστών ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|ΠΑΡΑΚΑΛΟΥΜΕ ΕΠΙΛΕΞΤΕ ΧΡΗΣΤΗ ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ-ΩΡΑ ΚΑΙ ΑΝΩ ΚΛΙΚ| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|Επιλέξτε μια καμπάνια ΗΜΕΡΟΜΗΝΙΑ ΚΑΙ ΩΡΑ-ΑΝΩ ΚΑΙ CLICK| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|Επιλέξτε μια Ενδοομιλικών ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ άνω ΚΛΙΚ ΚΑΙ ΑΠΟΣΤΟΛΗ| +DOWNLOAD|ΛΗΨΗ| +Users|Χρήστες| +User|Χρήστης| +Reports|Εκθέσεις| +OUTBOUND|ΕΞΕΡΧΟΜΕΝΟ| +INBOUND|Εισερχόμενα| +Server Stats and Reports|Στατιστικά Server και Εκθέσεις| +Click here to see a VDAD report for this campaign|Κάντε κλικ εδώ για να δείτε μια VDAD έκθεση για αυτή την καμπάνια| +Show DIDs|Δείτε DIDs| +Add A New DID|Προστίθεται ένα νέο DID| +Templates|Πρότυπα| +Carriers|Carriers| +Carrier Name|Φέρον Όνομα| +Click here to see all CallBack Holds in this user group|Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος σε αυτή την ομάδα χρηστών| +Click here to see all CallBack Holds in this list|Κάντε κλικ εδώ για να δείτε όλες τις Callback Κύτος στον κατάλογο αυτό| +Click here to see a report for this inbound group|Κάντε κλικ εδώ για να δείτε μια έκθεση για αυτό το εισερχόμενο ομάδα| +Click here to Synchronize users with Vtiger|Κάντε κλικ εδώ για να Συγχρονίστε χρήστες με Vtiger| +Alert Enabled|Alert Enabled| +Change Date|Αλλαγή Ημερομηνία| +Login Date|Σύνδεση Ημερομηνία| +List Last Call Date|Κατάλογος Last Call Ημερομηνία| +Phone Code Override|Μήκη Override| +GROUP ALIAS ID|ΟΜΑΔΑ ALIAS ID| +GROUP ALIAS NAME|ΟΜΑΔΑ ψευδώνυμο| +CID NUMBER|ΑΡΙΘΜΟΣ CID| +CID NAME|CID ΟΝΟΜΑ| +PHONE ALIAS|PHONE ALIAS| +ALIAS ID|ALIAS ID| +ALIAS NAME|Ψευδώνυμο| +PHONE LOGINS LIST|ΤΗΛ. ΚΑΤΑΛΟΓΟΣ συνδέσεις| +Shift Length|Shift Μήκος| +short description of the shift|σύντομη περιγραφή της μετατόπισης| +DELETE THIS SERVER|DELETE THIS SERVER| +DELETE THIS CONFERENCE|Διαγραφή αυτής της ΣΥΝΕΔΡΙΟ| +DELETE THIS VICIDIAL CONFERENCE|Διαγραφή αυτής της VICIDIAL ΣΥΝΕΔΡΙΟ| +Install Date|Εγκαταστήστε Ημερομηνία| +Human Answer|Ανθρώπινα Απάντηση| +STATUS CATEGORIES|Κατάσταση ΚΑΤΗΓΟΡΙΕΣ| +per campaign|ανά εκστρατεία| +all campaigns|όλες τις καμπάνιες| diff --git a/translations/es_language.txt b/translations/es_language.txt index df493891..6e470d0c 100644 --- a/translations/es_language.txt +++ b/translations/es_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"ENE"| @@ -373,9 +373,9 @@ Last|Último| Address|Dirección| City|Ciudad| State|Estado| -PostCode|Código Postal| +PostCode|CódigoPostal| Province|Provincia| -Vendor ID|Vendedor ID| +Vendor ID|VendedorID| DialCode|Código Del Dial| Alt. Phone|Teléfono Alt| Show|Demostración| @@ -429,3 +429,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|USTED DEBE INTRODUC ENTER A PAUSE CODE|INTRODUZCA Un CÓDIGO De la PAUSA| YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|USTED DEBE SER DETENIDO BREVEMENTE PARA INTRODUCIR Un CÓDIGO De la PAUSA EN AUTO-DIAL MODE| Your session has been disabled|Se ha inhabilitado su sesión| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Género:| +Date of Birth: |Fecha de nacimiento:| +YOU MUST BE PAUSED TO CHANGE GROUPS|USTED DEBE CAMBIAR pausa GRUPOS| +Calls in Queue:|Pide, en la cola:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|El usuario y la contraseña que ha introducido no son activos en el sistema| +Please try again|Por favor, inténtelo de nuevo| +You cannot log in or out within 30 seconds of your last login or logout|No puede iniciar sesión o en un plazo de 30 segundos de su última conexión o desconexión| +You have now logged-out|Ya ha iniciado la sesión en| +You logged out at |Que en la sesión| +Amount of time you were logged-in: |Cantidad de tiempo que se han registrado en:| +ERROR: timeclock log entry already made: |ERROR: timeclock entrada de registro ya realizados:| +BACK to Agent Login Screen|VOLVER a la pantalla de Inicio| +BACK to Administration|VOLVER a la Administración| +BACK to Welcome Screen|VOLVER a la pantalla de bienvenida| +Time since you were last logged-in: |Vez desde que se conectó por última vez en:| +You last logged-out at: |-Usted se conectó por última vez en:| +Click LOGIN below to log-in|Haga clic en Conectarse a continuación para acceder al sistema| +Amount of time you have been logged-in: |Cantidad de tiempo que se han registrado en:| +You logged-in at:|Iniciado la sesión en que usted en:| +Click LOGOUT below to log-out|Haga clic a continuación para acceder LOGOUT-out| +Undefined|Indefinido| +This phone number is not in the campaign lists|Este número de teléfono no está en la campaña de las listas| +Unspecified error|Error no especificado| +Extended Alt Phone Information: |Teléfono de Información ampliado Alt:| +ALT DIAL NUMBER:|ALT DIAL NÚMERO:| +Phone Code and Number:|Código y número de teléfono:| +Notes: |Notas:| +Active: |Activo:| +Alt Count: |Alt Cuenta:| +Change this phone number to INACTIVE|Cambiar este número de teléfono a INACTIVAS| +Change this phone number to ACTIVE|Cambiar este número de teléfono a ACTIVO| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|USTED DEBE ENTRAR A LA PRIMERA TIMECLOCK| +There is a time synchronization problem with your system, please tell your system administrator|Hay un problema de sincronización de tiempo con su sistema, por favor, dígale a su administrador del sistema| +Preview Call|Vista previa de llamada| +SELECT A GROUP ALIAS|SELECCIONAR UN GRUPO DE ALIAS| +Group Alias Selection|Grupo de Selección de Alias| +Click Here to Choose a Group Alias|Haga clic aquí para escoger un grupo de alias| +Group Alias|Grupo de Alias| +ERROR: There are no Shifts enabled for your user group|ERROR: No hay cambios habilitado para su grupo de usuarios| +ERROR: You are not allowed to log in outside of your shift|ERROR: No se le permite acceder fuera de su turno| +MANAGER OVERRIDE|GERENTE DE TRANSFERENCIA| +Your Shift is over or has changed, you have been logged out of your session|Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones| diff --git a/translations/es_language_admin.txt b/translations/es_language_admin.txt index b7dd46c0..8aef9e2d 100644 --- a/translations/es_language_admin.txt +++ b/translations/es_language_admin.txt @@ -43,6 +43,27 @@ 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 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|Border| @@ -1422,3 +1443,661 @@ Allowed Transfer Groups: |Grupos Permitidos De la Transferencia:| 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 permitidos de la transferencia - con estos listados delcheckbox usted puede seleccionar a los grupos a quienes los agentes enesta campaña pueden transferir llamadas. Permita Closers debe serpermitido para que esta opción demuestre para arriba| 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|La campaña alinea - en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_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|También en esta sección está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opción seselecciona en la pantalla del en-grupo| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|CC Activado - Esta opción permite al usuario acceder a la pantalla de control de calidad de agente| +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|Nivel de Usuario de CC - Este ajuste define lo que el agente de control de calidad de nivel de usuario es. Este dictará el nivel de funcionalidad para el agente en la sección de CC| +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|CC Actas Pass - Esta opción permite al agente para especificar que un registro ha pasado la primera ronda de control de calidad después de examinar el expediente| +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|Registro de control de calidad en Finalizar - Esta opción permite al agente para especificar que un registro ha terminado la segunda ronda de control de calidad después de revisar el pasado 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|Registro de control de calidad Compro - Esta opción permite al agente para especificar que un registro se ha cometido en el control de la calidad. Ya no puede ser modificado por cualquiera| +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|CC permitidas Campañas - Esta es una lista de seleccionables Campañas que los miembros de este grupo de usuarios podrá CC. El ALL-CAMPAÑAS opción permite a los usuarios en este grupo para cualquier campaña de control de la calidad en el 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|CC permitidas entrantes Grupos - Esta es una lista de seleccionables de entrada que los miembros de grupos de este grupo de usuarios podrá CC. TODOS LOS GRUPOS-La opción permite a los usuarios en este grupo de usuarios a cualquier entrada del grupo de CC en el sistema| +QC Enabled: |CC Activado:| +QC User Level: |CC Nivel de Usuario:| +QC Pass: |QC Pass:| +QC Finish: |CC Acabado:| +QC Commit: |CC Compro:| +Modify Nothing|Modificar Nada| +Modify Nothing Except Status|Modificar Nada Salvo Estado| +Modify All Fields|Modificar todos los campos| +Verify First Round of QC|Compruebe la primera ronda de CC| +View QC Statistics|Ver estadísticas de CC| +Ability to Modify FINISHed records|Capacidad para modificar los registros acabado| +Manager Level|Gestor de Nivel| +USERS CAN VIEW ANY CAMPAIGN|Los usuarios pueden ver cualquier campaña| +USERS CAN QC ANY CAMPAIGN|USUARIOS PUEDEN CC CUALQUIER CAMPAÑA| +USERS CAN QC ANY INBOUND GROUP|USUARIOS PUEDEN CC entrantes CUALQUIER GRUPO| +QC Allowed Campaigns: |CC permitidas Campañas:| +QC Allowed Inbound Groups: |CC permitidas entrantes Grupos:| +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|Cola de prioridad - Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla| +Queue Priority: |Cola de prioridad:| +Drop Action: |Caída de Acción:| +Drop Transfer Group: |Grupo de Transferencia de caída:| +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|Acción gota - Este menú le permite elegir lo que le sucede a una llamada cuando se ha estado esperando durante más de lo establecido en la Convocatoria de caída Segundos campo. Colgar simplemente colgar la llamada, enviar el mensaje de llamar a la Extensión de caída que ha definido a continuación, Buzón de voz se envía la llamada a la casilla de voz que ha definido a continuación y IN_GROUP enviará la convocatoria a la entrada del Grupo que se define a continuación| +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|Caída Extensión - En caso de caída de acción se fija a un mensaje, este es el dial plan de ampliación que la convocatoria se enviará a si llega a soltar Convocatoria Segundos| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Llame a gota Segundos - el número de segundos de una llamada se quedará en la cola antes de ser considerado uno de 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 Transferencia de gota - En caso de caída de Acción se establece en IN_GROUP, la llamada será enviada a este grupo entrantes si llega a soltar Convocatoria Segundos| +QC SETTINGS FOR THIS CAMPAIGN|AJUSTES CC para esta campaña| +QC Enabled: |CC Activado:| +QC Statuses: |CC estados:| +Modify Campaign QC Settings|Modificar la campaña de CC Configuración| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|CC Activado - Configuración Y a este campo permite que el agente de control de calidad de elementos de trabajo. El valor predeterminado es 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|CC estados - Esta zona es donde se selecciona el que lleva de estados debe ser pasado por el sistema de CC. Coloque una marca de verificación junto a la situación que desea revisar CC| +QC SETTINGS NOT MODIFIED|AJUSTES CC NO MODIFICADA| +QC SETTINGS MODIFIED|AJUSTES CC MODIFICADOS| +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|CC Webform Dirección - Esta es la dirección del sitio web que un agente de control de calidad puede ir a al hacer clic en el enlace Formulario de Asistencia en la pantalla de control de calidad| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|CC Escritura - Este es el script que puede ser utilizada por agentes de control de la calidad en la secuencia de comandos en la ficha de CC pantalla| +QC WebForm: |Formulario de Asistencia CC:| +QC Script|Control de calidad de secuencias de comandos| +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|En el Grupo de grabación Sobreescribe - Este campo permite la superposición de la campaña llamada de ajuste de grabación. Este ajuste puede ser anulado por la grabación vicidial_user sobre el establecimiento. MINUSVALIDOS no anular la campaña de ajuste de grabación. NUNCA deshabilitará la grabación en el cliente. OnDemand es el valor por defecto y permite que el agente para iniciar y detener la grabación cuando sea necesario. ALLCALLS empezará a grabar en el cliente cuando se envía una llamada a un agente. ALLFORCE empezará a grabar en el cliente cuando se envía una llamada a un agente que el agente de ninguna opción para detener la grabación| +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|En Nombre de archivo del grupo de grabación - Este campo sobre la Campaña de grabación régimen de nombramiento de ficheros si no está definido en ninguno. La variables son permitidos CAMPAÑA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. El valor por defecto es FULLDATE_AGENT y se vería así 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así TESTCAMP_51020103108_3125551212. 50 caracteres máx. El valor predeterminado es NINGUNA| +In-Group Recording Override: |-Grupo de grabación en Sobrescribir:| +In-Group Recording Filename: |En el Grupo de grabación de archivo:| +ADDING VICIDIAL QC STATUS CODE|AGREGANDO VICIDIAL QC ESTADO CÓDIGO| +MODIFY VICIDIAL QC STATUS CODE|MODIFICAR VICIDIAL CC ESTADO CÓDIGO| +VICIDIAL QC STATUS CODES|CÓDIGOS DE ESTADO VICIDIAL CC| +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.|El Control de Calidad, sistema de control de calidad dentro de VICIDIAL tiene su propio conjunto de códigos de estado separados de los de la gestión de llamadas de funciones VICIDIAL. CC statuse códigos debe estar entre 2 y 8 caracteres de longitud y no contienen caracteres especiales, como un espacio o de colon. El código de estado de CC descripción debe estar entre 2 y 30 caracteres de longitud.| + QC Status Codes |Códigos de estado de CC| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |CC CÓDIGOS VICIDIAL ESTADO DENTRO DE ESTE SISTEMA:| +ADD NEW QC STATUS CODE|Añadir CC NUEVO CÓDIGO ESTADO| +QC STATUS CODE NOT DELETED|CC Código del Estatuto no se eliminan| +QC STATUS CODE DELETED: |CC Código SUPRIMIDO:| +QC STATUS CODE NOT MODIFIED |CC ESTADO CÓDIGO NO MODIFICADA| +QC STATUS CODE MODIFIED: |CC Código MODIFICADOS:| +the qc status code needs to be at least 1 characters in length|la qc código de estado debe ser por lo menos 1 caracteres de longitud| +the qc status code name needs to be at least 1 characters in length|el código de estado qc nombre debe ser por lo menos 1 caracteres de longitud| +QC STATUS CODE NOT ADDED |CC Código de estado no se añade| +there is already a qc status code in the system with this name:|ya hay una qc código de estado en el sistema con el nombre:| +QC STATUS CODE ADDED: |CC Código AÑADIDO:| +code must be between 1 and 8 characters in length|código debe estar entre 1 y 8 caracteres de longitud| +code name must be between 2 and 30 characters in length|nombre de código debe estar entre 2 y 30 caracteres de longitud| +CALL HANGUP REASON STATS|CONVOCATORIA colgar RAZÓN ESTADÍSTICAS| +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|Horas después de Acción - La acción para llevar a cabo si es después de horas, tal como se definen en el tiempo de atención para este grupo entrante. Colgar inmediatamente colgar la llamada, MESSASGE de reproducir el archivo en el mensaje después de las horas Filenam campo, EXTENSIÓN enviará la llamada a la extensión del horario en el dialplan de voz y se envía la llamada al buzón de voz que figuran en el cuadro Después de horas de voz sobre el terreno , IN_GROUP enviará la convocatoria a la entrada seleccionada en el grupo después de las horas Grupo de Transferencia de seleccionar la lista. El valor predeterminado es MENSAJE| +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|Horas después de la transferencia Grupo - Si después de las horas de Acción se establece en IN_GROUP, la llamada será enviada a este grupo de entrada si ésta entra en el grupo de fuera de la convocatoria régimen de tiempo definido para el grupo en -| +After Hours Transfer Group: |Horas después de la transferencia del Grupo:| +Total calls taken in to this In-Group:|Total de llamadas a adoptarse en este In-Grupo:| +CALL HOLD TIME BREAKDOWN IN SECONDS|LLAMADA EN ESPERA TEMNE DE SEGUNDOS| +Date Range:|Rango de Fecha:| +ADDING NEW PHONE ALIAS|AGREGAR NUEVO TELÉFONO ALIAS| +ADD NEW PHONE ALIAS|Añadir nuevo teléfono ALIAS| +MODIFY PHONE ALIAS|MODIFICAR TELÉFONO ALIAS| +DELETE PHONE ALIAS|ELIMINAR TELÉFONO ALIAS| +PHONE ALIAS LIST|TELÉFONO ALIAS LISTA| +Phone Alias List|Teléfono Alias Lista| +Add A New Phone Alias|Añadir un nuevo teléfono Alias| +ADD A NEW PHONE ALIAS|AGREGAR UN NUEVO TELÉFONO ALIAS| +Alias ID: |Alias ID:| +Alias Name: |Alias Nombre:| +Phone Logins List: |Teléfono Logins Lista:| +PHONE ALIAS NOT ADDED|TELÉFONO ALIAS NO AÑADIDO| +there is already a Phone Alias in the system with this ID|ya existe un alias de teléfono en el sistema con este ID| +there is already a Phone Login in the system with this ID|ya existe un Teléfono de inicio de sesión en el sistema con este ID| +PHONE ALIAS ADDED|TELÉFONO ALIAS AÑADIDO| +PHONE ALIAS NOT MODIFIED|TELÉFONO ALIAS NO MODIFICADA| +PHONE ALIAS MODIFIED|TELÉFONO ALIAS MODIFICADOS| +PHONE ALIAS NOT DELETED|TELÉFONO ALIAS no se eliminan| +PHONE ALIAS DELETION CONFIRMATION|TELÉFONO ALIAS SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete phone alias|Haga clic aquí para eliminar alias teléfono| +PHONE ALIAS DELETION COMPLETED|TELÉFONO ALIAS SUPRESIÓN RELLENARSE| +PHONE ALIAS LISTINGS|TELÉFONO ALIAS LISTADOS| +there is already a Phone alias in the system with this login|ya existe un Teléfono de alias en el sistema con esta información de acceso| +there is already a Phone in the system with this login|ya hay un teléfono en el sistema con esta información de acceso| +DELETE THIS PHONE ALIAS|ELIMINAR ESTE TELÉFONO ALIAS| +MODIFY A PHONE ALIAS RECORD|MODIFICAR UN TELÉFONO ALIAS REGISTRO| +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|Alias ID - el ID de los alias utilizados para permitir el balanceo de carga de teléfono de acceso. sin espacios ni otros caracteres especiales permitidos. Debe estar entre 2 y 20 caracteres de longitud| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Alias Nombre - El nombre utilizado para describir un alias de teléfonos, debe ser entre 2 y 50 caracteres de longitud| +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 teléfonos Logins - La lista separada por comas de teléfono de acceso utilizado cuando un agente en la utilización de registros de teléfono de acceso equilibrado de carga. El agente de aplicación se encuentra el servidor activo con el menor número de agentes registrados en él y hacer una llamada de ese servidor con el agente al inicio de sesión| +PHONES WITHIN THIS PHONES ALIAS|TELÉFONOS DENTRO DE ESTE PHONES ALIAS| +Add New Shift|Añadir nuevo Mayúsculas| +New Shift Addition|Nueva Mayús adjunta| +Modify Shift|Modificar Mayúsculas| +Delete Shift|Eliminar Mayúsculas| +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|Cambio de ID - Este es el nombre corto de un Vicidial Mayús Definición. Este debe ser un identificador único. No utilice espacios ni puntuacion para este campo. 20 caracteres como máximo, 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|Cambio de nombre - Este es un nombre más descriptivo de la Definición Mayúsculas. Este es un breve resumen de la definición Mayús. 50 caracteres como máximo, 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|Hora de inicio cambio - Este es el momento en que comienza la campaña por turnos. Sólo deben ser números, serían las 9:30 AM y 5:00 AM 0930 sería 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|Longitud cambio - Este es el tiempo en horas y minutos que dura la campaña por turnos. 8 horas sería 08:00 y 7 horas y 30 minutos sería 07:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Cambio semana - En esta sección usted debe elegir los días de la semana que este cambio está activo| +Show Shifts|Mostrar cambios| +Add A New Shift|Añadir un nuevo cambio| +Shift ID: |Cambio ID:| +Shift Name: |Cambio de nombre:| +Shift Start Time: |Cambio Hora de inicio:| +Shift End Time: |Cambio Hora de finalización:| +SHIFT DEFINITION NOT ADDED|MAYÚS DEFINICIÓN NO AÑADIDO| +there is already a shift entry with this ID|ya hay un cambio de entrada con este ID| +Shift ID and name must be at least 2 characters in length|Identificación y cambio de nombre debe ser al menos de 2 caracteres de longitud| +Shift Start Time must be 4 digits in length and be a valid time|Hora de inicio cambio debe ser de 4 dígitos de longitud y una hora válida| +Shift Length must be 5 characters in length and be 24 hours or less|Longitud cambio debe ser de 5 caracteres de longitud y 24 horas o menos| +SHIFT ADDED: |MAYÚS AÑADIDO:| +MODIFY A SHIFT|MODIFICAR UN CAMBIO| +USER GROUPS USING THIS SHIFT:|GRUPOS DE USUARIOS DE UTILIZAR ESTE CAMBIO:| +DELETE THIS SHIFT DEFINITION|ELIMINAR ESTA MAYÚS DEFINICIÓN| +MODIFY A SHIFT|MODIFICAR UN CAMBIO| +SHIFT NOT DELETED|SHIFT no se eliminan| +SHIFT DELETION CONFIRMATION: |MAYÚS SUPRESIÓN DE CONFIRMACIÓN:| +Click here to delete shift|Haga clic aquí para suprimir el cambio| +SHIFT DELETION COMPLETED:|MAYÚS SUPRESIÓN RELLENARSE:| +SHIFT MODIFIED|MAYÚS MODIFICADOS| +SHIFT LISTINGS:|MAYÚS LISTADOS:| +Shift Weekdays: |Cambio semana:| +Sunday|Domingo| +Monday|Lunes| +Tuesday|Martes| +Wednesday|Miércoles| +Thursday|Jueves| +Friday|Viernes| +Saturday|Sábado| +Group Shifts: |Grupo de cambios:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Grupo de cambios - Esta es una lista de cambios seleccionables que pueden limitar el tiempo de acceso de agentes en el sistema| + Timeclock|Timeclock| +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|Timeclock Fin de Día - Este ajuste define cuando todos los usuarios se van a auto cerrado la sesión de la timeclock sistema. Sólo se ejecuta una vez al día. debe ser sólo el 4 dígitos dígitos 2 horas y 2 minutos en cifras de 24 horas. Por defecto es 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Última sesión Timeclock Auto - Este campo muestra la fecha de la última sesión de auto -| +Timeclock Last Auto Logout: |Última Timeclock Auto Desconexión:| +Timeclock End Of Day: |Timeclock Fin de Día:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|ENCUESTA SOBRE AJUSTES EN ESTA CAMPAÑA:| +Modify Campaign Survey|Modificar la campaña Encuesta| +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.|Primera encuesta de archivo de audio - Este es el nombre de archivo de audio que se reproduce en cuanto el cliente coge el teléfono cuando se ejecuta una campaña de estudio.| +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 |Encuesta dígitos DTMF - Este campo es donde se define los dígitos que un cliente puede pulsar como una opción en una encuesta sobre la campaña. válidos son los dígitos DTMF| +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|No encuesta interesadas dígitos - Este campo es donde se define el cliente presiona dígitos que indican que no están interesados.| +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.|Estudio de estado no le interesa - Este es un campo en el que seleccione el estado que debe utilizarse para no estoy interesado. Si se utiliza DNC y la campaña está configurada para utilizar DNC entonces el número de teléfono se añade automáticamente a la lista VICIDIAL interior DNC.| +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.|Encuesta de Opt-in de archivos de audio - Este es el nombre de archivo de audio que se reproduce cuando el cliente ha decidido participar en la encuesta, no esta opción, o no respondió si la respuesta no-acción se establece a OptOut. Después de este archivo de audio se reproduce, el método de encuesta se toman medidas.| +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|No encuesta interesadas archivo de audio - Este es el nombre de archivo de audio que se reproduce cuando el cliente ha optado-de la encuesta, no ha optado-o no respondió si la respuesta no-acción se establece en OptIn. Después de este archivo de audio se reproduce, la llamada se colgó| +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 encuesta - Esta opción se define lo que sucede a una convocatoria después de que el cliente ha optado-en. AGENT_XFER enviará la convocatoria a la siguiente agente disponible. Buzón de voz se envía la llamada al buzón de voz de la caja que se especifica en el campo de voz. EXTENSIÓN enviará al cliente a la extensión se define en la Encuesta Xfer campo Extensión. Colgar se cuelgue el cliente. CAMPREC_60_WAV enviará al cliente a tener una grabación con su respuesta, esta grabación se coloca en una carpeta con el nombre de la campaña dentro de la Campaña de Estudio de grabación Directorio.| +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.|Estudio n-Respuesta Acción - Este es donde se define lo que ocurrirá si no hay respuesta a la pregunta de la encuesta. OptIn sólo enviar la llamada al método de encuesta si el cliente pulsa una dígitos DTMF. OptOut enviará al cliente en el método de encuesta, aun cuando no presiona una dígitos DTMF.| +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.|Respuesta encuesta dígitos Mapa - Esta es la sección donde usted puede definir una descripción para ir dígitos DTMF con cada opción que el cliente puede seleccionar.| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Encuesta Xfer Extensión - Si el método de encuesta de EXTENSIÓN se selecciona entonces la llamada de cliente se dirige a esta extensión dialplan| +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.|Estudio de grabación Campaña Directorio - Si el método de encuesta de CAMPREC_60_WAV luego se selecciona la respuesta de los clientes se registran y se coloca en un directorio llamado después de la campaña dentro de este directorio.| +SURVEY SETTINGS NOT MODIFIED|ENCUESTA DE VALORES NO MODIFICADA| +SURVEY SETTINGS MODIFIED|ENCUESTA DE AJUSTES MODIFICADOS| +Survey First Audio File|Primera encuesta de archivo de audio| +Survey DTMF Digits|Encuesta dígitos DTMF| +Survey Not Interested Digit|No encuesta interesadas dígitos| +Survey Not Interested Status|Estudio de estado no le interesa| +Survey Opt-in Audio File|Encuesta de Opt-in de archivos de audio| +Survey Not Interested Audio File|No encuesta interesadas archivo de audio| +Survey Method|Método de estudio| +Survey No-Response Action|Estudio n-Respuesta de acción| +Survey Response Digit Map|Respuesta encuesta dígitos Mapa| +Survey Xfer Extension|Encuesta Xfer Extensión| +Survey Campaign Recording Directory|Estudio de grabación Campaña Directorio| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Añadir Timeclock Registrarse Expediente - Esta opción permite al usuario añadir registros a la timeclock registro| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Modificar Timeclock Registrarse Expediente - Esta opción permite al usuario modificar los registros en el registro timeclock| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Eliminar Timeclock Registrarse Expediente - Esta opción permite al usuario borrar los registros en el registro timeclock| +Add Timeclock Log Record|Añadir Timeclock Registrarse Registro| +Modify Timeclock Log Record|Modificar Timeclock Registrarse Registro| +Delete Timeclock Log Record|Eliminar Timeclock Registrarse Registro| +USER GROUP TIMECLOCK STATUS REPORT|Grupo de Usuarios de TIMECLOCK INFORME SOBRE LA SITUACIÓN| +Click here to see the Timeclock Status for this user group|Haga clic aquí para ver el Timeclock Estado para este grupo de usuarios| +ADD NUMBERS TO THE DNC LIST|Añadir números a la DNC LISTA| +Phone Numbers: |Números de teléfono:| +one phone number per line only|un número de teléfono por línea sólo| +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 DNC VICIDIAL - Esta lista de No Llamar contiene cada lugar que se ha establecido en un estado de la DNC en el sistema. A través de la LISTAS - AÑADIR AL NÚMERO DNC página usted puede agregar manualmente los números de esta lista a fin de que no van a ser llamados por las campañas que utilizan la lista interna DNC| + Time Sheet |Hoja de tiempo| +Timeclock Record Edit|Timeclock Record Edit| +Default date format with year month day|Por defecto el formato de fecha con el año mes día| +USA date format with month day year|EE.UU. fecha con el formato mes día año| +European date format with day month year|Europea con el formato de fecha día mes año| +Text date format with abbreviated month day|Texto con formato de fecha abreviado mes día| +followed by 24 hour time|seguido por 24 horas| +followed by 12 hour time|seguido por 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|Agente de la pantalla de encabezado Formato de fecha - Este menú le permite elegir el formato de la fecha que aparece en la parte superior de la pantalla VICIDIAL agente. Las opciones para este ajuste son los siguientes: el valor predeterminado es| +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|Agente del cliente Fecha Formato de pantalla - Este menú le permite elegir el formato de la fecha los clientes de zona horaria que aparece en la parte superior de la sección de información al cliente de la agencia de VICIDIAL pantalla. Las opciones para este ajuste son los siguientes: el valor predeterminado es| +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|Agente Cliente Teléfono Formato de pantalla - Este menú le permite elegir el formato del cliente el número de teléfono que aparece en el estado de la agente VICIDIAL pantalla. Las opciones para este ajuste son los siguientes: el valor predeterminado es| +dash separated phone number|guión separado el número de teléfono| +dash separated number with area code in parenthesis|guión separados número con código de área entre paréntesis| +No formatting|N de formato| +with space after city code|con el espacio después del código de ciudad| +space separated phone number|espacio separado el número de teléfono| +Agent Screen Header Date Format|Agente de la pantalla de encabezado Formato de fecha| +Agent Screen Customer Date Format|Agente del cliente Fecha Formato de pantalla| +Agent Screen Customer Phone Format|Agente Cliente Teléfono Formato de pantalla| +ERROR- There is a problem with the data that you entered, please go back|ERROR-Hay un problema con los datos que ha introducido, por favor, volver| +A timeclock session cannot overlap another timeclock session|Un período de sesiones timeclock no puede superponerse timeclock otro período de sesiones| +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|Deshabilitar Modificar Cliente Teléfono - Si se pone a Y, no cambia el número de teléfono del cliente, cuando un agente disposiciones de la llamada. Y es por defecto| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agente de acceso a la API - Esta opción permite que la cuenta que se utilizará con el agente de la API de comandos vicidial| +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|Modificar Agente Cliente Teléfono Sobreescribe - Esta opción será el que la opción está en la campaña para modificar el número de teléfono del cliente. NOT_ACTIVE utilizará cualquier ajuste es para la presente campaña. ALLOW_ALTER siempre permiten el agente de alterar el número de teléfono del cliente, no importa lo que la campaña de ajuste. El valor predeterminado es NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|Agente de la API de Active - Si se pone a 1, esto permitirá a la interfaz API de agente para su funcionamiento. Por defecto es 0| +Agent Alter Customer Phone Override: |Modificar Agente Cliente Sobreescribe Teléfono:| +Agent API Access: |Agente de acceso a la API:| +Disable Alter Customer Phone: |Deshabilitar Modificar Cliente Teléfono:| +Agent API Active: |Agente activo de API:| +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|Agente Mostrar cola Conde - Si se establece a Y, cuando un cliente está a la espera de un agente, la cola de llamadas en la pantalla superior de la pantalla agente se iluminará en rojo y muestran el número de llamadas en espera. Y es por defecto| +Agent Display Queue Count: |Agente Mostrar cola Cuenta:| +agents in dead calls|agentes muertos en las llamadas| +QC Last Pull Time: |Tire de CC Última Hora:| +and less than 43200 seconds or 12 hours|y menos de 43.200 segundos o 12 horas| +LEADS AT LIMIT|LLEVA EN EL LÍMITE| +Lead counts taken from active lists in the campaign only|Llevar cuenta de activos adoptadas listas sólo en la campaña| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|CC Obtener Registro de lanzamiento- Esto permite que una de las siguientes acciones, que se activará en un agente de control de la calidad de recibir un nuevo registro| +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 control de la calidad de grabación - , lo que permite una grabación que puede estar vinculado con el control de la calidad de registro que se mostrará en pantalla el agente de control de calidad| +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|CC Mayúsculas - Este es el paso de tiempo utilizado para tirar de registros de control de calidad para una campaña. Los días de la semana no se tienen en cuenta para estas funciones| +QC Get Record Launch|CC Obtener Registro de lanzamiento| +QC Show Recording|Mostrar control de la calidad de grabación| +QC Shift|CC Mayúsculas| +Inbound Group QC Settings|Grupo de Ajustes de entrada de CC| +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|CC Mayúsculas - Este es el paso de tiempo utilizado para tirar de un control de calidad para los registros inbound_group. Los días de la semana no se tienen en cuenta para estas funciones| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|La venta y Categoría Categoría Principal Muerto son utilizados tanto por el sistema de lista de sugerencias en el análisis de estadísticas de la lista.| +Sale Category: |Categoría de venta:| +Dead Lead Category: |Muerto líder Categoría:| +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|Manual de Acceso telefónico Filtro - Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas| +Manual Dial Filter: |Manual de Acceso telefónico Filtro:| +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|Agente de pantalla Portapapeles Copiar - esta función por el momento sólo se han permitido para Internet Explorer. Esta característica le permite seleccionar un campo que será copiado al portapapeles el equipo del agente ordenador a una llamada que se envían a un agente. Usos comunes para ello son para permitir la fácil pegar los números de cuenta o números de teléfono en el legado de las aplicaciones cliente en el equipo agente| +Agent Screen Clipboard Copy|Agente de pantalla Portapapeles Copiar| +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.|PRORROGADO suplentes números son números cargados en el sistema fuera de la pantalla de información estándar. PRORROGADO utilizando usted puede tener cientos de números de teléfono de un solo 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|Agente de pantalla ampliada Alt Dial - Esta característica permite a los agentes el acceso ampliado a los números de teléfono de suplentes lleva más allá de la norma Alt Teléfono y Address3 campos que pueden ser utilizados en VICIDIAL más allá de los números de teléfono de los principales número de teléfono. La extensión números de teléfono se puede marcar automáticamente utilizando la auto-Alt-función Marcación VICIDIAL en la configuración de la campaña, pero activar esta función de agente de pantalla también permitirá que el agente a llamar a estos números de la pantalla de su mandatario, así como editar su información| +Agent Screen Extended Alt Dial:|Agente de pantalla ampliada Alt telefónico:| +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.|Campaña de uso Lista DNC - Este define si esta campaña es un filtro contra el DNC lleva lista que es específico de la campaña únicamente. Si se configura a Y, la tolva se verá para cada número de teléfono en la campaña específica de DNC lista antes de colocarla en la tolva. Si es en la campaña específica de DNC se lista a continuación, cambiar de estado que llevan a DNCC por lo que no pueden ser marcados. El valor por defecto es N.| +Use Campaign DNC List|Campaña de uso Lista DNC| +and possibly the campaign-specific DNC list|y, posiblemente, la campaña específica de DNC lista| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|También existe la opción de añadir conduce a la campaña específica de DNC listas para esas campañas que les han| +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|NOTA: Copia de una campaña de copiar todos los ajustes del maestro campaña que seleccione, pero no va a copiar una campaña específica de DNC lista si hay un maestro seleccionado en la campaña| +Add New |Agregar nuevo| +Copy |Copiar| +New DID Addition|Nueva DID adjunta| +New Copied DID Addition|Nueva copiado DID adjunta| +Modify |Modificar| +Delete |Borrar| +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|Lugar jugar en línea - Este define si la persona que llama escuchará su lugar en la línea cuando entran en la cola, así como cuando escuchan la announcemend. El valor predeterminado es 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|Juega Mantenga Tiempo estimado - Este define si la persona que llama escuchará la estimación de tiempo de espera antes de ser transferido a un agente. El valor predeterminado es 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|Mantenga la opción Tiempo - Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA| +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|Mantenga la opción Tiempo Segundos - Si el tiempo de la opción se establece en algo, pero ninguno, este es el número de segundos de tiempo de espera estimado que el tiempo de activar la opción. El valor por defecto es 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|Mantenga la opción Tiempo de Extensión - Si el tiempo de la opción se fija a la extensión, esta es la extensión dialplan que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos| +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|Mantenga la opción Tiempo de voz - Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos| +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|Opción de Transferencia de celebrar Tiempo-Grupo A - Si el tiempo de la opción está establecida en IN_GROUP, este es el grupo de entrada que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos| +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|Mantenga la opción Tiempo de llamada de archivo - Si el tiempo de la opción está establecida en CALLERID_CALLBACK, este es el símbolo del nombre de archivo que se juega antes de la llamada se registra como un nuevo lugar a la lista de identificación se especifican a continuación si el tiempo de espera estimado es superior a la Mantenga la opción Tiempo Segundos| +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|Mantenga la opción Tiempo de llamada Lista ID - Si el tiempo de la opción está establecida en CALLERID_CALLBACK, esta es la lista de ID de la llamada, se añadirá como un nuevo lugar si el tiempo de espera estimado es superior a la opción Tiempo de Espera Segundos| +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|Recordatorio de Transferencia de celebrar en Grupo - Si un cliente pide de nuevo a este grupo en más de una vez y esto no está establecido en NINGUNO, entonces la llamada será automáticamente enviado al Grupo de In-seleccionado en este campo . El valor predeterminado es NINGUNA| +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|N Retraso de llamada Ruta - Configuración Y esto eliminará todos los tiempos de espera y anuncios de audio y tratar de enviar la llamada a un agente de la derecha. No anula el mensaje de bienvenida o celebrar la configuración rápida. El valor predeterminado es 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|Reproducir Mensaje de Bienvenida - Esta configuración seleccione para jugar cuando se define el mensaje de bienvenida, SIEMPRE desempeñará cada vez, NUNCA nunca jugar, IF_WAIT_ONLY sólo reproducirá el mensaje de bienvenida si la llamada no ir inmediatamente a un agente , y siempre YES_UNLESS_NODELAY reproducir el mensaje de bienvenida NO_DELAY menos que el ajuste está activado. El valor predeterminado es SIEMPRE| +Play Place in Line: |Lugar jugar en línea:| +Play Estimated Hold Time: |Juega Mantenga Tiempo estimado:| +Hold Time Option: |Mantenga la opción Hora:| +Hold Time Option Seconds: |Mantenga la opción Segundos Hora:| +Hold Time Option Extension: |Mantenga Tiempo Opción Extensión:| +Hold Time Option Voicemail: |Mantenga la opción Tiempo de voz:| +Hold Time Option Transfer In-Group: |Opción de Transferencia de celebrar Tiempo-Grupo A:| +Hold Time Option Callback Filename: |Mantenga la opción Tiempo de llamada de archivo:| +Hold Time Option Callback List ID: |Mantenga la opción Tiempo de llamada Lista ID:| +Hold Recall Transfer In-Group: |Recordatorio de Transferencia de celebrar en Grupo:| +No Delay Call Route: |N Retraso de llamada Ruta:| +Play Welcome Message: |Reproducir Mensaje de Bienvenida:| +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|Extensión DID - Este es el número, extensión o DID que hará que esta entrada y que va a la ruta en el sistema que utiliza esta función| +DID Description -<\/B> This is the description of the DID routing entry|Descripción DID - Esta es la descripción de la entrada de rutas DID| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DID activa - Este es el campo en el que configurar la entrada a DID activa o no. Y es por defecto| +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|Ruta DID - Este es el tipo de ruta que establezca el uso de DID. EXTEN enviará las llamadas a la extensión entró a continuación, enviará las llamadas de voz directamente a la caja de voz entró a continuación, AGENTE enviará las llamadas a un agente VICIDIAL si está conectado, TELÉFONO enviará la llamada a un teléfono de entrada, seleccione a continuación, se IN_GROUP enviar las llamadas directamente a la entrada del grupo especificado. El valor predeterminado es 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|Extensión - Si se ha seleccionado como EXTEN DID la ruta, entonces esta es la extensión que llama dialplan se enviará a. El valor predeterminado es 9998811112, no hay servicio| +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|Extensión Contexto - Si se ha seleccionado como EXTEN DID la Ruta, este es el contexto en el que pide dialplan se enviará a. El valor por defecto es por defecto| +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|Buzón de voz Caja - Si se ha seleccionado como voz de la DID de carreteras, este es el buzón de voz que llama a la casilla se enviará a. Por defecto está vacío| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Teléfono Extensión - TELÉFONO Si está seleccionado como la Ruta de DID, entonces esta es la extensión del teléfono que las llamadas se enviarán a.| +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|Teléfono IP del servidor - TELÉFONO Si está seleccionado como la Ruta de DID, entonces esta es la IP del servidor para la extensión del teléfono que las llamadas se enviarán a| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|Agente de usuario - Si se ha seleccionado como Agente de la DID de carreteras, este es el Agente VICIDIAL pide que se enviará a| +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|Usuario no disponible Acción - Si se ha seleccionado como Agente de la Ruta de DID, y el usuario no está conectado o disponible, entonces este es el camino que las convocatorias se| +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|En Configuración de usuario Ruta-Grupo - Si se ha seleccionado como Agente de la DID de carreteras, este es el grupo en que se utilizará para la configuración de la cola como la persona que llama está a la espera de ser enviado a la agente. El valor predeterminado es 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|En el Grupo-ID - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el grupo en que las llamadas se enviarán a| +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|En llamada de grupo Manipule Método - Si se ha seleccionado como IN_GROUP DID la ruta, entonces este es el llamado método utilizado para la manipulación de estas llamadas. CID se añada un nuevo registro de conducir en cada llamada mediante la CallerID como el número de teléfono, CIDLOOKUP tratará de buscar el número de teléfono por el CallerID en todo el sistema, CIDLOOKUPRL se attampt a buscar el número de teléfono por el CallerID en una sola lista especificada , CIDLOOKUPRC se attampt a buscar el número de teléfono por el CallerID en las listas de todos los que pertenecen a la campaña se especifica, más cerca se especifica para VICIDIAL pide más estrecha, ANI se añada un nuevo registro de conducir en cada llamada mediante la ANI como el número de teléfono, ANILOOKUP tratará de buscar el número de teléfono de la ANI en todo el sistema, ANILOOKUPRL se attampt a buscar el número de teléfono de la ANI en una sola lista especificada, XDIGITID impulsará la persona que llama para una X dígitos antes de la llamada se pondrá en la cola. El valor predeterminado es 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|En Grupo Agente Método de búsqueda - Si se ha seleccionado como IN_GROUP la ruta DID, este agente es el método de búsqueda para ser utilizado por el grupo de entrada, la LO es equilibrado de carga-y-Rebose intentará enviar la convocatoria a un agente en el servidor local antes de intentar enviar a un agente en otro servidor, LB es equilibrado de carga-y se trata de enviar la convocatoria a la siguiente agente, sin importar lo que ellos están en el servidor, el SO es el servidor y sólo se sólo intenta enviar las llamadas a los agentes en el servidor que la llamada se produjo en el. El valor predeterminado es 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|-En la lista Grupo de Identificación - Si se ha seleccionado como IN_GROUP DID la ruta, entonces esta es la lista de ID que lleva puede ser buscado a través de y que se lleva inserta en caso necesario| +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|En el Grupo-ID de campaña - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el ID de campaña que lleva pueden ser buscadas en si la llamada es manejar método 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|En el Grupo-Teléfono Código - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el Teléfono Código utilizarse si el plomo es un nuevo creado| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Teléfonos E-mail - La dirección de correo electrónico asociada con la entrada de este teléfono. Esto se utiliza para configuraciones de buzón de voz| +ADD A NEW DID|AGREGAR UN NUEVO DID| +DID Extension: |DID Extensión:| +DID Description: |DID Descripción:| +COPY DID|COPIA DID| +Source DID: |Fuente DID:| +DID NOT ADDED|DIDNOT AÑADIDO| +there is already a DID in the system with this ID|ya hay un DID en el sistema con este ID| +there is already a DID in the system with this extension|ya hay un DID en el sistema con esta extensión| +DID NOT MODIFIED|NO MODIFICADA| +DID MODIFIED|DID MODIFICADOS| +MODIFY A DID RECORD: |MODIFICAR UN REGISTRO DID:| +DID Route: |DID Ruta:| +Extension: |Extensión:| +Extension Context: |Extensión Contexto:| +Voicemail Box: |Caja de voz:| +Phone Extension: |Teléfono Extensión:| +User Agent: |Agente de usuario:| +User Unavailable Action: |Usuario no disponible Acción:| +User Route Settings In-Group: |En Configuración de usuario Ruta-Grupo:| +In-Group ID: |En el Grupo-ID:| +In-Group Call Handle Method: |En llamada de grupo Manipule Método:| +In-Group Agent Search Method: |En Grupo Agente Método de búsqueda:| +In-Group List ID: |-En la lista Grupo de Identificación:| +In-Group Campaign ID: |En el Grupo de Campaña-ID:| +In-Group Phone Code: |En el Grupo-Teléfono Código:| +DELETE THIS DID|ELIMINAR ESTA DID| +Email: |Correo electrónico:| +DID NOT DELETED|DIDNOT SUPRIMIDO| +DID DELETION CONFIRMATION|DID SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete |Haga clic aquí para eliminar| +DID DELETION COMPLETED|DID SUPRESIÓN RELLENARSE| +Delete DIDs: |Eliminar DIDs:| +Modify DIDs: |Modificar DIDs:| +To disable the On Hold Prompt, set the interval to 0|Para desactivar la espera El símbolo, definir el intervalo a 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|3-Vías de salida de llamadas CallerID - Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en| +3-Way Call Outbound CallerID:|3-Vías de salida de llamadas CallerID:| +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 que el agente de marcación manual de lugar a las llamadas de una campaña de la lista, mientras que ser capaz de tomar las llamadas entrantes entre marcación manual de llamadas| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|Fuerza de la fuerza de los agentes para elegir un código PAUSA si hacen clic en el botón 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|3-Vías de llamadas Prefijo telefónico - Esto define lo que se utiliza como prefijo de marcación para las llamadas de 3 vías, por defecto está vacío por lo que la campaña se utiliza el prefijo de marcación, por lo que puede passthru oye un pitido es de 88| +3-Way Call Dial Prefix|3-Vías de llamadas Prefijo telefónico| +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|Fuerza Timeclock Login - Esta opción le permite no dejar que un agente acceder a la interfaz de agente VICIDIAL si no han iniciado sesión en el timeclock. El valor por defecto es N. Hay una opción para eximir a los usuarios de administración, los niveles 8 y 9| +Force Timeclock Login|Fuerza Timeclock inicio de sesión| +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|Estadísticas Porcentaje de llamadas respondidas dentro de X segundos - Este campo le permite ajustar el número de segundos que tienen las estadísticas en tiempo real de la pantalla se utiliza para calcular el porcentaje de llamadas que fueron contestadas respuesta en el plazo de X número de segundos en espera| +Stats Percent of Calls Answered Within X seconds|Estadísticas Porcentaje de llamadas respondidas dentro de X segundos| +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.|Web Forms Meta- Este es donde usted puede establecer el marco de página web personalizada de la web de forma que se abrirá cuando el usuario hace clic en el botón formulario Web. El valor predeterminado es _blank.| +Web Form Target|Formulario web de destino| +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 la cadena de la consulta después de que el formulario web, basta con iniciar el formulario web con VAR y, a continuación, la URL que desee utilizar, en sustitución de las variables con el nombre de las variables que desee utilizar - A - phone_number - B -- al igual que en la pestaña de la sección 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|Grabación Web Link - Esta opción le permite ignorar el valor por defecto de la pantalla de la grabación enlace en la página web de administración. El valor predeterminado es 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|Grabación de IP del servidor alternativo - Este valor es donde usted puede poner un servidor IP o nombre de otra máquina que se puede utilizar en lugar de la server_ip en los enlaces a las grabaciones en el administrador de páginas web. Por defecto está vacío| +Recording Web Link|Grabación de Enlace Web| +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 Vtiger Integración - Este ajuste le permite activar Vtiger integración con VICIDIAL. Actualmente enlaces a Vtiger administración y búsqueda de usuarios, así como la reproducción son las únicas características disponibles integración. Por defecto es 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|PP Vtiger IP del servidor - Este es la dirección IP de la base de datos para su instalación Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Vtiger nombre de base de datos - Este es el nombre de base de datos para su base de datos Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Base de datos de inicio de sesión Vtiger - Este es el nombre de usuario utilizado para acceder a su base de datos Vtiger| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Base de datos Vtiger Contraseña - Esta es la contraseña utilizada para acceder a su base de datos Vtiger| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|Vtiger URL - Este es el URL o dirección del sitio web utilizado para acceder a tu Vtiger instalación| +Enable Vtiger Integration:|Habilitar Vtiger Integración:| +Vtiger DB Server IP|PP Vtiger IP del servidor| +Vtiger Database Name|Vtiger nombre de base de datos| +Vtiger Database Login|Base de datos de inicio de sesión Vtiger| +Vtiger Database Password|Base de datos Vtiger Contraseña| +Vtiger URL|Vtiger URL| +VTIGER HOME|VTIGER INICIO| +Active -<\/B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y|Activo - Este campo define si el usuario está activo en el sistema y puede utilizar VICIDIAL recursos. Y es por defecto| +show only active users|mostrar sólo los usuarios activos| +show all users|mostrar todos los usuarios| +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|Buscar Vtiger Categoría - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si vtiger_search.php la página de búsqueda para el número de teléfono que se inscribió. Hay 4 opciones que pueden utilizarse en este campo: LEAD-Esta opción de búsqueda a través de la Vtiger sólo conduce, CUENTA-Esta opción de búsqueda a través de las cuentas y Vtiger todos los contactos y sub-contactos para el número de teléfono, VENDEDOR-Esta opción sólo a través de la búsqueda Vtiger vendedores, ACCTID-Esta opción sólo funciona para las cuentas y que se llevará a vicidial vendor_lead_code el campo y tratar de buscar el ID de cuenta Vtiger. Si se intenta sin éxito que cualquier otro método que la lista que ha seleccionado. Múltiples opciones pueden ser utilizados para cada búsqueda, pero en grandes bases de datos no es recomendable. El valor predeterminado es PLOMO| +Vtiger Search Category:|Vtiger Búsqueda Categoría:| +ACTIVE LISTS CHANGED|LISTAS DE CAMBIO DE ACTIVO| +SUBMIT ACTIVE LIST CHANGES|ENVIAR LISTA DE CAMBIOS ACTIVO| +LAST CALL DATE|ÚLTIMA FECHA DE CONVOCATORIA| +User Group Bulk Change|Grupo de Usuarios de Basura Cambio| +Bulk Group Change|Basura Grupo Cambio| +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|Crear Vtiger Registro de llamadas - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si la nueva actividad Vtiger registro se crea para la llamada cuando el agente va a la página vtiger_search. Y es por defecto| +Vtiger Create Call Record:|Crear Vtiger Registro de llamadas:| +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|Crear Vtiger plomo Expediente - Si está habilitado Vtiger integración en la configuración del sistema y Vtiger Búsqueda Categoría incluye PLOMO entonces esta configuración definirá si un nuevo registro de conducir Vtiger es creada cuando el agente va a la página vtiger_search y no se registro determinó que la llamada número de teléfono. Y es por defecto| +Vtiger Create Lead Record:|Crear Vtiger plomo Record:| +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|Pantalla de inicio de sesión Vtiger - Si está habilitado Vtiger integración en la configuración del sistema, esta configuración definirá si el usuario está conectado a la interfaz automáticamente Vtiger los usuarios cuando ingresan a VICIDIAL. Y es por defecto| +Vtiger Screen Login:|Vtiger pantalla inicio de sesión:| +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 Activado - Este campo muestra si el agente tiene el navegador web habilitado para alertas cuando pide entrar en su período de sesiones vicidial.php. Por defecto es 0 para el NO| +Alert Enabled:|Alerta Activado:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|Características de Active CC - Esta opción le permite activar o desactivar el control de la calidad o las características de Control de Calidad. El valor por defecto es 0 para inactivos| +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|Salida de marcación automática de Active - Esta opción le permite activar o desactivar la marcación automática de salida dentro de VICIDIAL, en este campo a 0 se eliminará de las listas y FILTROS secciones y muchos campos de la Campaña Modificación pantallas. Manual de entrada de marcación seguirá siendo permitida dentro de la agente de la pantalla, lista de marcación, pero no será posible. El valor predeterminado es 1 para los activos| +QC Features Active:|CC Características Activo:| +Outbound Auto-Dial Active:|Salida activa de marcación automática:| +Close Panel|Panel de Cierre| +Choose Report Display Options|Elija Opciones de Informe| +To select more than 1 campaign, hold down the Ctrl key and click|Para seleccionar más de 1 campaña, mantenga pulsada la tecla Ctrl y haga clic en| +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|CPD AMD Acción - Si está utilizando el Sangoma ParaXip software de detección de llamadas Progreso entonces usted desea habilitar esta configuración, o bien se DISPO a que la llamada disposición como AA y colgar la llamada si se está procesando y no se ha enviado aún a un agente o un mensaje que envía la llamada al contestador automático de mensajes definidos para esta campaña. Desactivado por defecto| +CPD AMD Action:|CPD AMD Acción:| +Click here for user multiple day status detail report|Haga clic aquí para varios días de estado de usuario detalle informe| +Click here to download this list|Haga clic aquí para descargar esta lista| +Download Lists:|Descargar 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|Activa del servidor de Asterisk - de Asterisk Si no se está ejecutando en este servidor, o si VICIDIAL no deberían usar este servidor, o si sólo se utiliza este servidor para otros scripts como script de la tolva de carga que usted quiere hacer esto para N. El valor por defecto es 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|Generar los archivos de configuración - Si desea que el sistema de auto-generar conf asterisco archivos sobre la base de los teléfonos entradas, las entradas de transportista y balanceo de carga dentro de la configuración VICIDIAL luego a este valor por defecto es Y. 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 los archivos de configuración - Si desea forzar una reconstrucción de los archivos de configuración de Asterisk o si alguno de los teléfonos o transportista entradas han cambiado esto debe establecerse en Y. Después de la configuración de archivos se han generado y se ha de Asterisk luego se vuelve a cargar esta será cambiado a N. El valor por defecto es Y| +Active Asterisk Server:|Activa del servidor de Asterisk:| +Generate conf files:|Generar los archivos de configuración:| +Rebuild conf files:|Reconstruir los archivos de configuración:| +Show Templates|Mostrar plantillas| +Add A New Template|Añadir una nueva plantilla| +ADD NEW CONF TEMPLATE|Añadir CONF NUEVA PLANTILLA| +ADD NEW CARRIER|Añadir nueva compañía| +ADDING NEW CONF TEMPLATE|AGREGAR NUEVO CONF PLANTILLA| +ADDING NEW CARRIER|AGREGAR NUEVOS SOPORTES| +MODIFY CONF TEMPLATE|MODIFICAR CONF PLANTILLA| +MODIFY CARRIER|MODIFICAR PORTEADOR| +DELETE CONF TEMPLATE|ELIMINAR CONF PLANTILLA| +DELETE CARRIER|ELIMINAR PORTEADOR| +CONF TEMPLATE LIST|CONF lista de plantillas| +CARRIER LIST|LISTA DE TRANSPORTISTA| +Template ID:|Plantilla ID:| +Template Name:|Nombre de plantilla:| +Template Contents:|Plantilla de contenidos:| +Carrier ID:|Portador de Identificación:| +Carrier Name:|Transportista Nombre:| +Registration String:|Cadena de registro:| +Account Entry:|Cuenta Entrada:| +Protocol:|Protocolo:| +Globals String:|Globals Serie de caracteres:| +Dialplan Entry:|Dialplan Entrada:| +CONF TEMPLATE NOT ADDED|CONF PLANTILLA NO AÑADIDO| +there is already a template in the system with this ID|ya hay una plantilla en el sistema con este ID| +CONF TEMPLATE ADDED|CONF PLANTILLA AÑADIDO| +CARRIER NOT ADDED|TRANSPORTISTA NO AÑADIDO| +there is already a carrier in the system with this ID|ya existe un soporte en el sistema con este ID| +CONF TEMPLATE NOT MODIFIED|CONF PLANTILLA NO MODIFICADA| +CARRIER NOT MODIFIED|TRANSPORTISTA NO MODIFICADA| +CARRIER MODIFIED|PORTEADOR MODIFICADOS| +CONF TEMPLATE NOT DELETED|CONF PLANTILLA NO SUPRIMIDO| +Template ID be at least 2 characters in length|Plantilla de Identificación ser al menos de 2 caracteres de longitud| +CONF TEMPLATE DELETION CONFIRMATION|CONF PLANTILLA SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete conf template|Haga clic aquí para eliminar conf plantilla| +CARRIER NOT DELETED|TRANSPORTISTA NO SUPRIMIDO| +Carrier ID be at least 2 characters in length|Portador de Identificación ser al menos de 2 caracteres de longitud| +CARRIER DELETION CONFIRMATION|PORTEADOR SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete carrier|Haga clic aquí para suprimir el transportista| +CONF TEMPLATE DELETION COMPLETED|CONF PLANTILLA SUPRESIÓN RELLENARSE| +CARRIER DELETION COMPLETED|SUPRESIÓN RELLENARSE PORTEADOR| +MODIFY A CONF TEMPLATE RECORD|MODIFICAR UN REGISTRO CONF PLANTILLA| +DELETE THIS CONF TEMPLATE|CONF ELIMINAR ESTA PLANTILLA| +MODIFY A CARRIER RECORD|MODIFICAR UN REGISTRO DE TRANSPORTISTA| +DELETE THIS CARRIER|ELIMINAR ESTA PORTEADOR| +CARRIERS WITHIN THIS SERVER|TRANSPORTISTAS EN ESTE SERVIDOR| +CONF TEMPLATE LISTINGS|CONF PLANTILLA LISTADOS| +CARRIER LISTINGS|LISTAS DE TRANSPORTISTA| +PHONES USING THIS CONF TEMPLATE|TELÉFONOS DE UTILIZAR ESTE CONF PLANTILLA| +CARRIERS USING THIS CONF TEMPLATE|TRANSPORTISTAS DE UTILIZAR ESTE CONF PLANTILLA| +Conf Override:|Conf. Sobrescribir:| +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 de la plantilla - Este campo tiene que ser al menos de 2 caracteres de longitud y no más de 15 caracteres, sin espacios. Esta es la identificación que se utilizará para identificar la configuración de plantillas en todo el sistema| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Nombre de la plantilla - Este es el nombre descriptivo de la plantilla de archivo de configuración de entrada| +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|Plantilla de Contenido - Este campo es donde usted puede entrar en la configuración específica para ser utilizado por todos los teléfonos o los transportistas y que están configurados para utilizar esta plantilla conf. Campos que no deben incluirse en este cuadro son: secreto, accountcode, cuenta, el nombre de usuario y buzón de correo| +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|Portador de Identificación - Este campo tiene que ser al menos de 2 caracteres de longitud y no más de 15 caracteres, sin espacios. Esta es la identificación que se utilizará para identificar el soporte de esta entrada a través del sistema| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Nombre del transportista - Este es el nombre descriptivo de la compañía entrada| +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|Registro de cadena - Este campo es donde usted puede entrar en la cadena exacta necesaria en el SIP o IAX archivo de configuración de registro para el proveedor. Opcional, pero altamente recomendable si tu proveedor permite el registro| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|Plantilla ID - Este campo opcional permite elegir un archivo de configuración de plantilla para esta compañía aérea de entrada| +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|Cuenta Entrar - Este campo se usa si no ha seleccionado una plantilla de usar, y es donde puede entrar en la configuración de la cuenta específica que se utilizará para esta compañía aérea| +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 le permite definir el protocolo a utilizar para el transportista entrada. Actualmente, sólo IAX y SIP son compatibles| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|Globals String - Este campo opcional le permite definir una variable global a utilizar para el transportista en el dialplan| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Entrada Dialplan - Este campo opcional le permite definir un conjunto de entradas dialplan a usar para esta compañía aérea| +Server IP -<\/B> This is the server that this specific carrier record is associated with|IP del servidor - Este es el servidor que soporte este registro está asociado con| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Activo - Esto define si el transportista se incluirán en la auto-generado o no los archivos de conf| +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|Ajustes conf Sobreescribe - Si pobladas, y la plantilla está configurada para ID - Inexistencia - entonces el contenido de este campo se utilizan como entradas del archivo de configuración para este teléfono. generate_vicidial_conf teléfonos para este servidor debe ser fijado a Y para que esto funcione. Este campo no debe contener la [extensión] línea, que se genera automáticamente| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|ID de la plantilla - Este es el archivo de configuración de plantilla ID que este teléfono va a utilizar para la entrada de su configuración de Asterisk. El valor por defecto es - Inexistencia --| +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|Si va a tomar en las llamadas entrantes de esta compañía aérea tronco es posible que desee establecer el contexto = trunkinbound dentro de este ámbito de modo que usted puede usar el proceso de tramitación de DID en 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|Hay un DID reservados por defecto que puede utilizar que es sólo la palabra-por defecto-, sin los guiones, que permiten el envío de cualquier llamada que no coincida con cualquier otro de los modelos existentes por defecto DID| +Campaign VDAD extension|Campaña de extensión VDAD| +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 una transferencia personalizada VDAD extensión. Esto le permite utilizar diferentes métodos de gestión de llamadas en función de su campaña.| + - 8364 - same as 8368|- 8364 - 8368 misma que| + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Se envía la llamada a un sólo agente en el mismo servidor que la llamada está en| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Utilizado para la prensa-1 y las campañas de estudio| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - ¿Se tratará de enviar la primera llamada a un agente en el servidor local, entonces se verá en otros servidores| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - PREDETERMINADO? Enviará la petición a la siguiente agente disponible independientemente de lo que están en el servidor| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Se utiliza para Contestador automático de detección después de que, el mismo comportamiento como 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Se utiliza para Contestador automático de detección después de que el mismo comportamiento de 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.|También en esta sección son la WEB VARs para cada campaña. Estas permiten a cada agente tiene una cadena de la variable que se puede agregar a la WEB DE GUIÓN ficha URL o simplemente poniendo - A - web_vars - B - como le pondría en cualquier otra esfera.| +Group Alias List|Grupo Alias Lista| +Add A New Group Alias|Añadir un nuevo grupo de alias| +ADD NEW GROUP ALIAS|Añadir NUEVO GRUPO DE ALIAS| +ADDING NEW GROUP ALIAS|AGREGAR NUEVO GRUPO DE ALIAS| +MODIFY GROUP ALIAS|MODIFICAR GRUPO ALIAS| +DELETE GROUP ALIAS|Eliminar grupo ALIAS| +GROUP ALIAS LIST|GRUPO DE ALIAS LISTA| +GROUP ALIAS LISTINGS|GRUPO DE ALIAS LISTADOS| +MODIFY A GROUP ALIAS RECORD|ALIAS MODIFICAR UN GRUPO DE REGISTRO| +Group Alias ID|Alias ID Grupo| +Group Alias Name|Grupo Alias Nombre| +CallerID Number|Número CallerID| +CallerID Name|Nombre CallerID| +DELETE THIS GROUP ALIAS|ELIMINAR ESTE GRUPO DE ALIAS| +GROUP ALIAS NOT MODIFIED|ALIAS GRUPO NO MODIFICADA| +GROUP ALIAS MODIFIED|GRUPO DE ALIAS MODIFICADOS| +ADD A NEW GROUP ALIAS|AGREGAR UN NUEVO GRUPO DE ALIAS| +MODIFY A GROUP ALIAS RECORD|ALIAS MODIFICAR UN GRUPO DE REGISTRO| +GROUP ALIAS NOT ADDED|ALIAS GRUPO NO AÑADIDO| +GROUP ALIAS ADDED|GRUPO DE ALIAS AÑADIDO| +GROUP ALIAS NOT DELETED|GRUPO DE ALIAS no se eliminan| +GROUP ALIAS DELETION CONFIRMATION|ALIAS GRUPO DE SUPRESIÓN DE CONFIRMACIÓN| +Click here to delete group alias|Haga clic aquí para suprimir el grupo de alias| +GROUP ALIAS DELETION COMPLETED|GRUPO DE SUPRESIÓN RELLENARSE ALIAS| +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|Grupo Alias ID - el ID del grupo de alias utilizado por los agentes a marcar llamadas desde la interfaz de agente VICIDIAL con diferentes números de identificación de llamadas. sin espacios ni otros caracteres especiales permitidos. Debe estar entre 2 y 20 caracteres de longitud| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Grupo Alias Nombre - El nombre utilizado para describir un grupo de alias, debe ser entre 2 y 50 caracteres de longitud| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Número de identificación de llamadas - el número de identificación de llamadas se utilizan en este Grupo de Alias. Debe ser sólo cifras| +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|Nombre de identificación de llamadas - El nombre de identificación de llamadas que se pueden enviar a cabo con este grupo de alias. Por lo que sabemos esto sólo funcionará en Canadá en los circuitos del PRI y la utilización de un bucle troncal IAX de Asterisk a través de| +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|Grupo Alias permitidas - Si desea permitir que su grupo de agentes a utilizar alias, entonces necesita hacer esto a Y. Grupo Alias se explican más en la sección de administración, permiten a los agentes para seleccionar diferentes callerIDs para llamadas salientes manual que se puede colocar. El valor predeterminado es 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|Grupo Alias predeterminado - Si han permitido Grupo Alias este es el grupo de alias que se ha seleccionado en primer lugar, por defecto cuando el agente decide usar un alias para un grupo de salida manual de llamada. El valor por defecto es vacío o NINGUNA| +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|Grupo Alias predeterminado - Si han permitido Alias Grupo para la campaña de que el agente se registra en este grupo es el alias que se ha seleccionado en primer lugar por incumplimiento de una llamada procedente de este grupo entrante cuando el agente decide usar un alias para un grupo de salida manual de llamada. El valor por defecto es vacío o NINGUNA| +Group Alias Allowed|Grupo Alias permitidas| +Default Group Alias|Alias predeterminado Grupo| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones.| +you cannot use reserved words in group aliases|no puede usar palabras reservadas en el grupo de alias| +Agent Shift Enforcement Override|Agente de Cambio observancia Sobrescribir| +Manager Shift Enforcement Override|Gerente de Turno observancia Sobrescribir| +Shift Enforcement|Cambio de título ejecutivo| +Max Calls per Second|Pide máximo por segundo| +Max FILL Calls per Second|Max LLENAR Pide 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 configuración anular cualquiera que sea el grupo de usuarios de los usuarios se ha fijado para Mayús Observancia. MINUSVALIDOS utilizará el grupo de usuarios de configuración. NO no aplicará en todos los turnos. PRINCIPIO sólo hacer cumplir el tiempo de inicio de sesión, pero no afectará a un agente que se está ejecutando en su momento, si en cambio ya están conectado TODOS hará cumplir turnos hora de inicio y de registro de un agente a cabo después de que ellos tienen sobre el final de su cambio de tiempo. Desactivado por defecto.| +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.|Este ajuste, si se pone a 1 permitirá que un administrador de entrar en su usuario y contraseña en una pantalla de agente para anular las restricciones sobre el desplazamiento de un agente período de sesiones si el agente está intentando iniciar sesión fuera de su turno. El valor predeterminado es 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 opción le permite restringir el acceso basado en agente de los cambios que se seleccione a continuación. NO no aplicará en todos los turnos. PRINCIPIO sólo hacer cumplir el tiempo de inicio de sesión, pero no afectará a un agente que se está ejecutando en su momento, si en cambio ya están conectado TODOS hará cumplir turnos hora de inicio y de registro de un agente a cabo después de que ellos tienen sobre el final de su cambio de tiempo. El valor predeterminado es desactivado.| +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 configuración determina el número máximo de llamadas que pueden ser colocados por la salida de marcación automática de secuencia de comandos en este servidor por segundo. Debe ser de 1 a 100. El valor predeterminado es 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 configuración determina el número máximo de llamadas que pueden ser colocados por la auto-LLENAR salida de marcación automática de secuencia de comandos de todos los servidores, por segundo. Debe ser de 1 a 200. El valor predeterminado es 40.| +System Load|Sistema de carga| +Live Channels|Canales en vivo| +Disk Usage|Uso del disco| +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 dos estadísticas muestran la loadavg veces de un sistema 100 y el porcentaje de uso de la CPU del servidor y se actualiza cada minuto. El loadavg debería ser en promedio por debajo de los 100 multiplicado por el número de núcleos de CPU de su sistema, para un rendimiento óptimo. El porcentaje de uso de la CPU debería permanecer por debajo de 50 para un rendimiento óptimo.| +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 muestra el número actual de canales que son de Asterisk en vivo en el sistema ahora. Es importante señalar que el número de canales de Asterisk es generalmente mucho mayor que el número de llamadas en un sistema. Este campo se actualiza una vez cada minuto.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Este campo mostrará el uso del disco para cada partición en este servidor. Este campo se actualiza una vez cada minuto.| +ADMIN CHANGE LOG|ADMIN Change Log| +USER ADMIN CHANGE LOG|USUARIO ADMIN Change Log| +SECTION ADMIN CHANGE LOG|SECCIÓN ADMIN Change Log| +DETAIL ADMIN CHANGE LOG|Detalle de registro de cambio ADMIN| +Last 10000 records|Última 10.000 registros| +Changes made by|Los cambios efectuados por| +Record Detail|Detalle de registro| +Section Records|Sección de Documentos| +Click here to see Admin chages to this record|Haga clic aquí para ver Admin chages a la presente acta| +Click here to see Admin chages to this campaign|Haga clic aquí para ver Admin chages a esta campaña| +Click here to see Admin chages to this list|Haga clic aquí para ver Admin chages a esta lista| +Click here to see Admin chages to this In-Group|Haga clic aquí para ver a esta Administración chages en Grupo| +Click here to see Admin chages to this DID|Haga clic aquí para ver a esta Administración chages DID| +Click here to see Admin chages to this remote agent|Haga clic aquí para ver a esta Administración chages agente remoto| +Click here to see Admin chages to this user group|Haga clic aquí para ver Admin chages a este grupo de usuarios| +Click here to see Admin chages to this script|Haga clic aquí para ver Admin chages a este script| +Click here to see Admin chages to this filter|Haga clic aquí para ver chages al administrador de este filtro| +Click here to see Admin chages to this call time|Haga clic aquí para ver Admin chages a este tiempo de atención| +Click here to see Admin chages to this shift|Haga clic aquí para ver Admin chages a este cambio| +Click here to see Admin chages to this phone alias|Haga clic aquí para ver Admin chages alias para este teléfono| +Click here to see Admin chages to this group alias|Haga clic aquí para ver Admin chages a este grupo, alias| +Click here to see Admin chages to this server|Haga clic aquí para ver Admin chages a este servidor| +Click here to see Admin chages to this conf template|Haga clic aquí para ver a esta Administración chages conf plantilla| +Click here to see Admin chages to this carrier|Haga clic aquí para ver Admin chages a esta compañía aérea| +Click here to see Admin chages to the system settings|Haga clic aquí para ver chages a la administración de la configuración del sistema| +Export Reports|Informes de exportación| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Este ajuste, si se pone a 1 permitirá un gerente de exportación para acceder a la llamada de los informes sobre la INFORMES pantalla. El valor predeterminado es 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.|Este ajuste, si se establece en 1 para permitir que un administrador haga clic en la lista de descargas en la parte inferior de la pantalla una lista de modificaciones a la exportación de todo el contenido de una lista a un archivo de datos plana. El valor predeterminado es 0.| +Export Calls Report|Pide Informe exportación| +EXPORT CALLS REPORT|PIDE INFORME DE EXPORTACIÓN| +For the Export Calls Report, the following field order is used for exports|Pide para el Informe de Exportación, para el siguiente campo se utiliza para las exportaciones| +Timeclock|Reloj de tiempo| +Logout|Cerrar sesión| +Show Users|Mostrar Usuarios| +Add A New User|Añadir un nuevo usuario| +Search For A User|Búsqueda de un usuario| +User Stats|Estadísticas de usuario| +User Status|Condición de Usuario| +Time Sheet|Hoja de tiempo| +Days Status|Situación días| +Campaigns Main|Principales Campañas| +Statuses|Estados| +HotKeys|Teclas rápidas| +Lead Recycle|Plomo Reciclado| +Auto Alt-Dial|Marcación automática Alt -| +Auto Alt Dial|Auto Alt telefónico| +List Mix|Mezcla lista| +Pause Codes|Pausa Códigos| +Basic|Básico| +Detail|Detalle| +Survey|Encuesta| +Real-Time|Tiempo Real| +CAMPAIGN ID|ID de campaña| +DIAL PLAN|PLAN DE DIAL| +DIAL METHOD|DIAL MÉTODO| +LEADS COUNT|ENCABEZA COUNT| +LEAD ORDER|ORDEN DE PLOMO| +DIAL STATUSES|DIAL ESTATUTOS| +SCRIPT ID|GUIÓN ID| +SCRIPT NAME|GUIÓN NOMBRE| +USER GROUP|GRUPO DE USUARIOS| +GROUP NAME|NOMBRE DEL GRUPO| +PRIORITY|PRIORIDAD| +FORCE TIMECLOCK|FUERZA TIMECLOCK| +CALLTIME ID|CALLTIME ID| +CALLTIME NAME|CALLTIME NOMBRE| +DEFAULT START|PREDETERM PRINCIPIO| +DEFAULT STOP|PREDETERM STOP| +SHIFT ID|MAYÚS ID| +SHIFT NAME|MAYÚS NOMBRE| +SHIFT START|MAYÚS PRINCIPIO| +SHIFT LENGTH|DURACIÓN SHIFT| +WEEKDAYS|SEMANAL| +Template ID|ID de plantilla| +Template Name|Nombre de plantilla| +Carrier ID|Portador de Identificación| +Carrier Name|Nombre del transportista| +Registration|Registro| +Active|Activo| +USER ID|ID USUARIO| +FULL NAME|NOMBRE COMPLETO| +LEVEL|NIVEL| +LINKS|ENLACES| +TRUNKS|TRONCOS| +HUMAN|HUMANOS| +ANSWER|RESPUESTA| +CATEGORY|CATEGORÍA| +STATUSES IN THIS CATEGORY|ESTATUTOS EN ESTA CATEGORÍA| +Display|Exponer| +Dates|Fechas| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECCIONE UNA CAMPAÑA O GRUPO DE USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECCIONE UN USUARIO Y FECHA-TEMNE ARRIBA Y HAGA CLICK| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|POR FAVOR SELECCIONE UNA CAMPAÑA Y FECHA-TEMNE ANTERIOR Y HAGA CLICK| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar| +DOWNLOAD|DESCARGAR| +Users|Usuarios| +User|Usuario| +Reports|Informes| +OUTBOUND|SALIENTE| +INBOUND|Entrantes| +Server Stats and Reports|Estadísticas e Informes servidor| +Click here to see a VDAD report for this campaign|Haga clic aquí para ver un informe VDAD para esta campaña| +Show DIDs|Mostrar DIDs| +Add A New DID|Añadir un nuevo DID| +Templates|Plantillas| +Carriers|Transportistas| +Carrier Name|Nombre del transportista| +Click here to see all CallBack Holds in this user group|Haga clic aquí para ver todas las CallBack Posee en este grupo de usuarios| +Click here to see all CallBack Holds in this list|Haga clic aquí para ver todas las CallBack mantiene en esta lista| +Click here to see a report for this inbound group|Haga clic aquí para ver un informe de este grupo entrante| +Click here to Synchronize users with Vtiger|Haga clic aquí para sincronizar los usuarios con Vtiger| +Alert Enabled|Alerta Activado| +Change Date|Fecha de cambio| +Login Date|Fecha de inicio de sesión| +List Last Call Date|Última Fecha de lista de llamadas| +Phone Code Override|Teléfono Código Sobrescribir| +GROUP ALIAS ID|GRUPO DE ALIAS ID| +GROUP ALIAS NAME|ALIAS GRUPO NOMBRE| +CID NUMBER|CID NÚMERO| +CID NAME|NOMBRE DEL CID| +PHONE ALIAS|TELÉFONO ALIAS| +ALIAS ID|ALIAS ID| +ALIAS NAME|NOMBRE ALIAS| +PHONE LOGINS LIST|TELÉFONO LISTA Logins| +Shift Length|Longitud cambio| +short description of the shift|breve descripción del cambio| +DELETE THIS SERVER|ELIMINAR ESTE SERVIDOR| +DELETE THIS CONFERENCE|ELIMINAR ESTA CONFERENCIA| +DELETE THIS VICIDIAL CONFERENCE|ELIMINAR ESTA CONFERENCIA VICIDIAL| +Install Date|Fecha de instalación| +Human Answer|Respuesta humana| +STATUS CATEGORIES|ESTADO DE LAS CATEGORÍAS| +per campaign|por campaña| +all campaigns|todas las campañas| diff --git a/translations/fr_language.txt b/translations/fr_language.txt index ec5407c2..ea26614a 100644 --- a/translations/fr_language.txt +++ b/translations/fr_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"JAN"| @@ -373,9 +373,9 @@ Last|Nom| Address|Adresse| City|Ville| State|État| -PostCode|Code postal| +PostCode|CodePostal| Province|Province| -Vendor ID|Code Vendeur| +Vendor ID|CodeVendeur| DialCode|DialCode| Alt. Phone|Tel. 2nd| Show|Visualiser| @@ -429,3 +429,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOUS DEVEZ ÉCRIRE ENTER A PAUSE CODE|ÉCRIVEZ Un CODE De PAUSE| YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|VOUS DEVEZ ÊTRE FAIT UNE PAUSE POUR ÉCRIRE Un CODE De PAUSE DANS LeMODE D'AUTO-DIAL| Your session has been disabled|Votre session a été neutralisée| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Sexe:| +Date of Birth: |Date de naissance:| +YOU MUST BE PAUSED TO CHANGE GROUPS|VOUS DEVEZ ÊTRE pause pour changer de groupe| +Calls in Queue:|Appels dans la file d'attente:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|L'utilisateur et le mot de passe que vous avez entrés ne sont pas actifs dans le système| +Please try again|S'il vous plaît essayez de nouveau| +You cannot log in or out within 30 seconds of your last login or logout|Vous ne pouvez pas vous connecter ou dans un délai de 30 secondes de votre dernière connexion ou déconnexion| +You have now logged-out|Vous avez maintenant connecté à| +You logged out at |Vous vous êtes connecté à| +Amount of time you were logged-in: |Montant de temps vous avez été enregistrés dans:| +ERROR: timeclock log entry already made: |ERREUR: timeclock entrée de journal déjà fait:| +BACK to Agent Login Screen|RETOUR à l'Agent Login Screen| +BACK to Administration|RETOUR à l'administration| +BACK to Welcome Screen|RETOUR à l'écran de bienvenue| +Time since you were last logged-in: |Temps écoulé depuis la dernière session ont été vous-en:| +You last logged-out at: |Vous dernière connecté à:| +Click LOGIN below to log-in|Cliquez ci-dessous pour LOGIN log-in| +Amount of time you have been logged-in: |Montant de temps vous avez été enregistrés dans:| +You logged-in at:|Vous vous êtes inscrit en ligne à:| +Click LOGOUT below to log-out|Cliquez ci-dessous pour vous connecter LOGOUT-out| +Undefined|Undefined| +This phone number is not in the campaign lists|Ce numéro de téléphone n'est pas dans la campagne des listes| +Unspecified error|Erreur non spécifiée| +Extended Alt Phone Information: |Extended Information Alt Téléphone:| +ALT DIAL NUMBER:|ALT numéro:| +Phone Code and Number:|Code et numéro de téléphone:| +Notes: |Notes:| +Active: |Active:| +Alt Count: |Alt Count:| +Change this phone number to INACTIVE|Modifiez ce numéro de téléphone à INACTIVE| +Change this phone number to ACTIVE|Modifiez ce numéro de téléphone à ACTIVE| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|Vous devez vous connecter pour timeclock LE PREMIER| +There is a time synchronization problem with your system, please tell your system administrator|Il ya un problème de synchronisation avec votre système, s'il vous plaît dites-le à votre administrateur système| +Preview Call|Preview Call| +SELECT A GROUP ALIAS|CHOISIR UN GROUPE ALIAS| +Group Alias Selection|Groupe de sélection Alias| +Click Here to Choose a Group Alias|Cliquez ici pour choisir un groupe Alias| +Group Alias|Groupe Alias| +ERROR: There are no Shifts enabled for your user group|ERREUR: Il n'y a pas de changements activée pour votre groupe d'utilisateurs| +ERROR: You are not allowed to log in outside of your shift|ERREUR: Vous n'êtes pas autorisés à se connecter à l'extérieur de votre quart de travail| +MANAGER OVERRIDE|MANAGER OVERRIDE| +Your Shift is over or has changed, you have been logged out of your session|Votre Shift est au dessus ou a changé, vous avez été déconnecté de votre session| diff --git a/translations/fr_language_admin.txt b/translations/fr_language_admin.txt index 1a1ac6b9..2abdf4e6 100644 --- a/translations/fr_language_admin.txt +++ b/translations/fr_language_admin.txt @@ -43,6 +43,27 @@ 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 ***TRANSLATIONS***|||| ### special translations that should stay at the top of the file ### BORDER|BORDER| @@ -1422,3 +1443,661 @@ Allowed Transfer Groups: |Groupes Laissés De Transfert :| 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|Groupes laissés de transfert - avec ces listes de checkbox vouspouvez choisir les groupes aux lesquels les agents dans cette campagnepeuvent transférer des appels. Permettez Closers doit être permispour que cette option révèle| 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|La campagne se range - dans cette section vous pouvez définir le rangque un agent aura pour chaque campagne. Ces rangs peuvent êtreemployés pour tenir compte du cheminement préféré d'appel quand leprochain appel d'agent est placé au 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|En outre dans cette section est la capacité de donner à l'agent unrang pour chaque groupe d'arrivée. Ces rangs peuvent être employéspour le cheminement préféré d'appel quand cette option est choisiedans l'écran de dans-groupe| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|QC Activé - Cette option permet à l'utilisateur de se connecter à l'agent de contrôle de la qualité d'écran| +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|QC User Level - Ce paramètre définit ce que l'agent de contrôle de la qualité est au niveau utilisateur. Ce qui déterminera le niveau de fonctionnalité de l'agent dans la section QC| +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|Record QC Pass - Cette option permet à l'agent de préciser que le dossier a franchi le premier tour de Québec, après avoir examiné le dossier| +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|Record QC Finish - Cette option permet à l'agent de préciser que le dossier a terminé la deuxième ronde de Québec après avoir examiné le dossier transmis| +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|Record QC Commit - Cette option permet à l'agent de préciser que le record a été commise dans QC. Il ne peut plus être modifié par n'importe qui| +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|QC permis Campagnes - Il s'agit d'un choix de la liste des campagnes où les membres de ce groupe d'utilisateurs seront en mesure de QC. Le ALL-CAMPAGNES option permet aux utilisateurs de ce groupe de Québec une campagne sur le système| +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|QC permis l'arrivée des groupes - Il s'agit d'un choix de la liste des groupes dont l'arrivée des membres de ce groupe d'utilisateurs seront en mesure de QC. Le ALL-GROUPES option permet aux utilisateurs dans ce groupe d'utilisateurs QC arrivée du groupe sur tout le système| +QC Enabled: |QC Enabled:| +QC User Level: |QC User Level:| +QC Pass: |QC Pass:| +QC Finish: |QC Finition:| +QC Commit: |QC Comité:| +Modify Nothing|Rien Modifier| +Modify Nothing Except Status|Modifier Rien Sauf Etat| +Modify All Fields|Modifier tous les Domaines| +Verify First Round of QC|Vérifiez Premier Cycle de QC| +View QC Statistics|Voir QC Statistiques| +Ability to Modify FINISHed records|Possibilité de modifier fini records| +Manager Level|Level Manager| +USERS CAN VIEW ANY CAMPAIGN|Les utilisateurs peuvent visualiser n'importe quelle campagne| +USERS CAN QC ANY CAMPAIGN|USERS CAN QC TOUTE LA CAMPAGNE| +USERS CAN QC ANY INBOUND GROUP|USERS CAN QC ENTRANT TOUT GROUP| +QC Allowed Campaigns: |QC permis Campagnes:| +QC Allowed Inbound Groups: |QC permis l'arrivée des groupes:| +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|File d'attente de priorité - Ce paramètre est utilisé pour définir l'ordre dans lequel les appels sortants à partir de cette campagne devrait être répondu en ce qui concerne les appels entrants si cette campagne est en mode mixte| +Queue Priority: |File d'attente de priorité:| +Drop Action: |Drop d'action:| +Drop Transfer Group: |Drop de transfert du Groupe:| +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|Drop Action - Ce menu vous permet de choisir ce qui se passe à un appel quand il a attendu plus longtemps que ce qui est prévu dans le Drop Call Seconds domaine. Hangup simplement raccrocher l'appel, envoyer le message de l'appel Drop EXTEN que vous avez définies ci-après, à la messagerie vocale vous envoyer l'appel à la boîte vocale que vous avez définis ci-dessous et IN_GROUP envoie l'appel à la Inbound groupe qui est défini ci-dessous| +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|Drop EXTEN - Si l'action est goutte d'MESSAGE, c'est le cadran plan d'extension que l'appel sera envoyée si elle parvient à Drop Call Seconds| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Drop Call Seconds - Le nombre de secondes d'un appel restera dans la file d'attente avant d'être considéré comme un 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|Drop de transfert Group - Si Drop action est fixée à IN_GROUP, l'appel sera envoyé à ce groupe d'arrivée si elle parvient Drop Call Seconds| +QC SETTINGS FOR THIS CAMPAIGN|QC SETTINGS pour cette campagne| +QC Enabled: |QC Enabled:| +QC Statuses: |QC Statut:| +Modify Campaign QC Settings|Modifier les paramètres de campagne QC| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|QC Activé - Mise en ce domaine permet à Y pour l'agent de contrôle de la qualité caractéristiques au travail. La valeur par défaut est 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|Statuts QC - Cette zone est l'endroit où vous choisissez ce qui entraîne des statuts doit être dépassé par le système de QC. Placez un contrôle à côté de l'état que vous voulez examiner QC| +QC SETTINGS NOT MODIFIED|QC SETTINGS PAS mise à jour| +QC SETTINGS MODIFIED|QC SETTINGS mise à jour| +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|QC WebForm Adresse - Il s'agit de l'adresse du site web d'un agent QC pouvez aller à en cliquant sur le lien dans la WebForm QC écran| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|Script QC - C'est le script qui peut être utilisé par les agents QC SCRIPT dans l'onglet de la QC écran| +QC WebForm: |QC WebForm:| +QC Script|QC Script| +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|En groupe enregistrement Override - Ce champ permet d'primordial de la campagne d'appel enregistrement. Ce réglage peut être modifié par l'enregistrement de l'emporter sur la mise en vicidial_user. HANDICAPES ne remplacent pas la campagne de l'enregistrement programmé. JAMAIS désactive l'enregistrement sur le client. OnDemand est l'option par défaut et permet à l'agent de début et de fin d'enregistrement en tant que de besoin. ALLCALLS va commencer l'enregistrement sur le client chaque fois qu'un appel est adressé à un agent. ALLFORCE va commencer l'enregistrement sur le client chaque fois qu'un appel est adressé à un agent qui l'agent aucune option pour arrêter l'enregistrement| +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|En groupe d'enregistrement du fichier - Ce champ peut passer outre à la campagne d'enregistrement nommage des fichiers système, sauf si elle est définie à AUCUNE. Les variables sont autorisés CAMPAGNE CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. La valeur par défaut est FULLDATE_AGENT et se présente comme suit 20051020-103108_6666. Un autre exemple est CAMPAIGN_TINYDATE_CUSTPHONE qui se présente comme suit TESTCAMP_51020103108_3125551212. 50 char max. La valeur par défaut est NON| +In-Group Recording Override: |En groupe enregistrement Override:| +In-Group Recording Filename: |En groupe d'enregistrement du fichier:| +ADDING VICIDIAL QC STATUS CODE|AJOUT VICIDIAL QC Code de statut| +MODIFY VICIDIAL QC STATUS CODE|MODIFY VICIDIAL QC Code de statut| +VICIDIAL QC STATUS CODES|VICIDIAL QC ÉTAT DES CODES| +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.|Le contrôle de la qualité au sein du système-QC VICIDIAL a son propre ensemble de codes distincts de ceux dans le traitement des appels de fonctions VICIDIAL. QC statuse codes doit être comprise entre 2 et 8 caractères et ne contiennent pas de caractères spéciaux, comme un espace ou du côlon. Le code de statut QC description doit être comprise entre 2 et 30 caractères.| + QC Status Codes |Codes d'état QC| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |VICIDIAL QC ÉTAT DANS CE SYSTEME DE CODES:| +ADD NEW QC STATUS CODE|ADD NEW QC Code de statut| +QC STATUS CODE NOT DELETED|QC CODE ÉTAT PAS SUPPRIMÉ| +QC STATUS CODE DELETED: |QC ÉTAT CODE DELETED:| +QC STATUS CODE NOT MODIFIED |QC CODE ÉTAT PAS mise à jour| +QC STATUS CODE MODIFIED: |QC ÉTAT CODE mise à jour:| +the qc status code needs to be at least 1 characters in length|qc le code de statut doit être au moins de 1 caractères| +the qc status code name needs to be at least 1 characters in length|qc le nom de code de statut doit être au moins de 1 caractères| +QC STATUS CODE NOT ADDED |QC CODE ÉTAT PAS AJOUTÉS| +there is already a qc status code in the system with this name:|il existe déjà un code de statut qc dans le système avec ce nom:| +QC STATUS CODE ADDED: |QC ÉTAT CODE AJOUTEE:| +code must be between 1 and 8 characters in length|code doit être compris entre 1 et 8 caractères| +code name must be between 2 and 30 characters in length|nom de code doit être compris entre 2 et 30 caractères| +CALL HANGUP REASON STATS|FAIT APPEL Hangup STATS| +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|Après les heures d'ouverture d'action - L'action à effectuer si c'est après les heures de travail tels que définis dans le temps de l'arrivée pour ce groupe. Hangup hangup immédiatement à l'appel, MESSASGE va jouer le fichier dans le message après les heures de Filenam domaine, EXTENSION envoie l'appel à la fois la durée d'extension de la dialplan et de la messagerie vocale vous envoyer l'appel à la boîte vocale figurant dans la boîte vocale après les heures de domaine , IN_GROUP enverra l'appel à l'arrivée du groupe sélectionné dans le groupe après les heures de sélectionner la liste de transfert. La valeur par défaut est 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|Après les heures d'ouverture de transfert Group - Si l'action Après les heures d'ouverture est fixée à IN_GROUP, l'appel sera envoyé à cette arrivée du groupe si celui-ci entre dans le groupe en dehors de l'appel de temps défini pour le régime de groupe| +After Hours Transfer Group: |Après les heures d'ouverture de transfert de Groupe:| +Total calls taken in to this In-Group:|Total des appels pris en Dans ce groupe:| +CALL HOLD TIME BREAKDOWN IN SECONDS|CALL TIME HOLD RÉPARTITION EN SECONDES| +Date Range:|Date Range:| +ADDING NEW PHONE ALIAS|AJOUT DE NOUVEAU TÉLÉPHONE ALIAS| +ADD NEW PHONE ALIAS|ADD NEW PHONE ALIAS| +MODIFY PHONE ALIAS|MODIFY PHONE ALIAS| +DELETE PHONE ALIAS|DELETE PHONE ALIAS| +PHONE ALIAS LIST|TÉLÉPHONE LISTE ALIAS| +Phone Alias List|Téléphone Alias Liste| +Add A New Phone Alias|Ajouter un nouveau téléphone Alias| +ADD A NEW PHONE ALIAS|Ajouter un nouveau téléphone ALIAS| +Alias ID: |Alias ID:| +Alias Name: |Alias Nom:| +Phone Logins List: |Téléphone Connexions List:| +PHONE ALIAS NOT ADDED|PAS DE TELEPHONE ALIAS AJOUTÉS| +there is already a Phone Alias in the system with this ID|il existe déjà un numéro de téléphone Alias dans le système avec cette ID| +there is already a Phone Login in the system with this ID|il existe déjà un numéro de téléphone dans le système Connectez-vous avec cette ID| +PHONE ALIAS ADDED|PHONE ALIAS AJOUTÉS| +PHONE ALIAS NOT MODIFIED|PHONE ALIAS PAS mise à jour| +PHONE ALIAS MODIFIED|PHONE ALIAS mise à jour| +PHONE ALIAS NOT DELETED|PHONE ALIAS pas supprimé| +PHONE ALIAS DELETION CONFIRMATION|PHONE ALIAS DELETION CONFIRMATION| +Click here to delete phone alias|Cliquez ici pour supprimer le téléphone alias| +PHONE ALIAS DELETION COMPLETED|PHONE ALIAS DELETION ACCOMPLIES| +PHONE ALIAS LISTINGS|PHONE ALIAS LISTAGES| +there is already a Phone alias in the system with this login|il existe déjà un numéro de téléphone alias dans le système avec ce login| +there is already a Phone in the system with this login|il existe déjà un numéro de téléphone dans le système avec ce login| +DELETE THIS PHONE ALIAS|SUPPRIMER CETTE PHONE ALIAS| +MODIFY A PHONE ALIAS RECORD|A MODIFIER TELEPHONE ALIAS RECORD| +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|Alias ID - L'ID de l'alias utilisé pour permettre les connexions de téléphone à équilibrage de charge. pas d'espaces ou autres caractères spéciaux autorisés. Doit être compris entre 2 et 20 caractères de longueur| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Alias Nom - Le nom utilisé pour désigner un téléphone alias, doit être compris entre 2 et 50 caractères de longueur| +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|Téléphones Connexions List - La virgule sépare la liste de téléphone de connexion utilisé lors d'un agent se connecte par téléphone pour équilibrer la charge de connexion. L'agent se trouve l'application serveur actif avec le moins d'agents et connecté à un appel à ce serveur à l'agent au moment de la connexion| +PHONES WITHIN THIS PHONES ALIAS|TELEPHONES PORTABLES DANS CETTE ALIAS| +Add New Shift|Ajouter un nouveau Shift| +New Shift Addition|New Shift adjonction| +Modify Shift|Modifier Shift| +Delete Shift|Maj + Suppr| +Shifts|Shifts| +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|Shift ID - Il s'agit du nom court d'un VICIDIAL Shift Définition. Cela doit être un identifiant unique. Ne pas utiliser les espaces ou la ponctuation dans ce champ. max 20 caractères, un minimum de 2 caractères| +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|Nom Shift - Il s'agit d'un nom descriptif de la Maj Définition. Ceci est un bref résumé de la définition Maj. max 50 caractères, un minimum de 2 caractères| +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|Start Time Shift - Il est temps que la campagne commence à passer. Ne doivent être des chiffres, 9:30 AM serait 0930 et 5:00 PM serait 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|Longueur Shift - Il est temps en heures et minutes que dure la campagne de changement. 8 heures seraient 08h00 et 7 heures et 30 minutes serait 07:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Shift Weekdays - Dans cette section, vous devriez choisir le jour de la semaine que ce changement est active| +Show Shifts|Voir les changements| +Add A New Shift|Add A New Shift| +Shift ID: |Shift ID:| +Shift Name: |Shift Nom:| +Shift Start Time: |Start Time Shift:| +Shift End Time: |End Time Shift:| +SHIFT DEFINITION NOT ADDED|MAJ définition pas AJOUTÉS| +there is already a shift entry with this ID|il ya déjà un quart d'entrée avec cette ID| +Shift ID and name must be at least 2 characters in length|Shift ID et le nom doit être d'au moins 2 caractères| +Shift Start Time must be 4 digits in length and be a valid time|Start Time Shift 4 chiffres doit être de longueur et une heure valide| +Shift Length must be 5 characters in length and be 24 hours or less|Shift Longueur doit être de 5 caractères de longueur et de 24 heures ou moins| +SHIFT ADDED: |SHIFT AJOUTÉS:| +MODIFY A SHIFT|MODIFIER UN DEPLACEMENT| +USER GROUPS USING THIS SHIFT:|Groupes d'utilisateurs UTILISANT CE SHIFT:| +DELETE THIS SHIFT DEFINITION|SUPPRIMER CETTE DEFINITION SHIFT| +MODIFY A SHIFT|MODIFIER UN DEPLACEMENT| +SHIFT NOT DELETED|MAJ pas supprimé| +SHIFT DELETION CONFIRMATION: |SHIFT DELETION CONFIRMATION:| +Click here to delete shift|Cliquez ici pour supprimer le passage| +SHIFT DELETION COMPLETED:|SHIFT DELETION ACHEVES:| +SHIFT MODIFIED|MAJ mise à jour| +SHIFT LISTINGS:|SHIFT inscriptions:| +Shift Weekdays: |Shift-Ven:| +Sunday|Dimanche| +Monday|Lundi| +Tuesday|Mardi| +Wednesday|Mercredi| +Thursday|Jeudi| +Friday|Vendredi| +Saturday|Samedi| +Group Shifts: |Groupe de changements:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Groupe changements - Il s'agit d'un choix de la liste des changements qui peuvent restreindre l'accès des agents à temps sur le système| + Timeclock|Timeclock| +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|Timeclock Fin de la journée - Ce paramètre définit lorsque tous les utilisateurs sont automatiquement déconnecté du système timeclock. Fonctionne uniquement une fois par jour. ne doit être que 4 chiffres et 2 chiffres heures à 2 chiffres dans les minutes de 24 heures. La valeur par défaut est 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Dernière timeclock Auto Logout - Ce champ affiche la date de la dernière auto-logout| +Timeclock Last Auto Logout: |Dernière timeclock Auto Logout:| +Timeclock End Of Day: |Timeclock Fin de la journée:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|SONDAGE SETTINGS pour cette campagne:| +Modify Campaign Survey|Modifier Campagne Survey| +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.|Première Enquête Audio File - Il s'agit du nom de fichier audio qui se joue dès que le client choisit le téléphone lors de l'exécution d'une étude campagne.| +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 |Enquête DTMF Digits - Ce domaine est l'endroit où vous définissez les chiffres que le client peut presse comme une option sur une campagne de sondage. valable chiffres DTMF sont| +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Enquête Non Intéressé Digit - Ce domaine est l'endroit où vous définissez le client pressé chiffres qui montrent qu'ils ne sont pas intéressés.| +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.|Enquête Non Intéressé Etat - Ce domaine est l'endroit où vous choisissez le statut d'être utilisé pour pas intéressé. S'il est utilisé DNC et la campagne est défini pour utiliser DNC ensuite le numéro de téléphone sera automatiquement ajouté à la liste DNC VICIDIAL interne.| +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.|Enquête sur Opt-in Audio File - Il s'agit du nom de fichier audio qui se joue lorsque le client a opté dans l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à optout. Après ce fichier audio est joué, le sondage de l'action ne soit prise.| +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|Enquête Non Intéressé Audio File - Il s'agit du nom de fichier audio qui se joue lorsque le client a choisi de l'enquête, a choisi de ne pas-ou pas répondu si la non-réponse-action est fixé à OptIn. Après ce fichier audio est joué, l'appel sera suspendu jusqu'à| +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.|Enquête sur la méthode - Cette option permet de définir ce qui se passe à un appel après que le client a opté en. AGENT_XFER enverra l'appel à la prochaine agent. MESSAGERIE VOCALE envoie l'appel à la boîte vocale qui est spécifié dans la boîte vocale domaine. EXTENSION envoie le client à l'extension définie dans le Survey Xfer Extension domaine. Hangup se raccrocher le client. CAMPREC_60_WAV enverra au client d'avoir un enregistrement réalisé avec leur réponse, cet enregistrement sera placé dans un dossier nommé comme la campagne de l'intérieur de l'Enquête sur la campagne d'enregistrement Directory.| +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.|Etude de non-réponse de l'action - C'est là que vous définissez ce qui se passera s'il n'y a pas de réponse à la question de sondage. OptIn ne envoyer l'appel à la méthode d'enquête, si le client en pressant une chiffres DTMF. OptOut envoie le client sur la méthode d'enquête, même si elles ne sont pas sur un chiffre DTMF.| +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.|Enquête Réponse Digit Map - Il s'agit de la section où vous pouvez définir une description pour aller avec chaque option DTMF chiffres que le client mai sélectionner.| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Enquête Xfer Extension - Si la méthode d'enquête de l'extension est sélectionné, le client appel sera dirigé vers cette extension dialplan| +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.|Enquête sur la campagne d'enregistrement - Annuaire Si la méthode d'enquête de CAMPREC_60_WAV est sélectionné, le service à la clientèle sera enregistré et placé dans un répertoire nommé d'après la campagne de l'intérieur de ce répertoire.| +SURVEY SETTINGS NOT MODIFIED|SONDAGE SETTINGS PAS mise à jour| +SURVEY SETTINGS MODIFIED|SONDAGE SETTINGS mise à jour| +Survey First Audio File|Enquête Premier fichier audio| +Survey DTMF Digits|Enquête DTMF Digits| +Survey Not Interested Digit|Enquête Non Intéressé Digit| +Survey Not Interested Status|Enquête Non Intéressé Etat| +Survey Opt-in Audio File|Enquête sur Opt-in audio de dossier| +Survey Not Interested Audio File|Enquête Non Intéressé fichier audio| +Survey Method|Enquête sur la méthode| +Survey No-Response Action|Etude de non-réponse de l'action| +Survey Response Digit Map|Enquête sur la carte réponse Digit| +Survey Xfer Extension|Enquête Xfer Extension| +Survey Campaign Recording Directory|Enquête sur la campagne d'enregistrement du répertoire| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Ajouter Log timeclock Record - Cette option permet à l'utilisateur d'ajouter des enregistrements à l'timeclock journal| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Modifier timeclock Connexion Record - Cette option permet à l'utilisateur de modifier des enregistrements dans le journal timeclock| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Supprimer timeclock Connexion Record - Cette option permet à l'utilisateur de supprimer des enregistrements dans les journaux timeclock| +Add Timeclock Log Record|Ajouter Log timeclock Record| +Modify Timeclock Log Record|Modifier timeclock journal Record| +Delete Timeclock Log Record|Supprimer timeclock journal Record| +USER GROUP TIMECLOCK STATUS REPORT|GROUPE D'UTILISATEURS timeclock STATUS REPORT| +Click here to see the Timeclock Status for this user group|Cliquez ici pour voir le statut timeclock pour ce groupe d'utilisateurs| +ADD NUMBERS TO THE DNC LIST|Ajouter des numéros dans DNC LISTE| +Phone Numbers: |Numéros de téléphone:| +one phone number per line only|un numéro de téléphone par ligne seulement| +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|DNC VICIDIAL List - Do Not Call Cette liste contient tous les conduire qui a été fixé à un statut de DCN dans le système. Dans les listes - ADD NOMBRE DE DNC page que vous êtes en mesure d'ajouter manuellement les numéros de cette liste afin de ne pas être appelé par des campagnes qui utilisent la liste interne DNC| + Time Sheet |Feuille de temps| +Timeclock Record Edit|Timeclock Record Edit| +Default date format with year month day|Par défaut avec le format de la date année mois jour| +USA date format with month day year|Etats-Unis avec le format de la date mois jour année| +European date format with day month year|Européen de format de date avec jour mois année| +Text date format with abbreviated month day|Texte de format de date avec abrégée mois jour| +followed by 24 hour time|suivie par 24 heures,| +followed by 12 hour time|, suivies de 12 heures| +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|Agent Header Screen Format Date - Ce menu vous permet de choisir le format de la date qui apparaît en haut de l'écran VICIDIAL agent. Les options de ce paramètre sont les suivants: valeur par défaut est| +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|Agent client Screen Format Date - Ce menu vous permet de choisir le format de la date du fuseau horaire client qui apparaît en haut de la section d'information à la clientèle agent VICIDIAL de l'écran. Les options pour ce paramètre sont les suivants: valeur par défaut est| +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|Agent Client Téléphone Screen Format - Ce menu vous permet de choisir le format du client le numéro de téléphone qui apparaît dans la section du statut de la VICIDIAL agent écran. Les options pour ce paramètre sont les suivants: valeur par défaut est| +dash separated phone number|tableau de bord séparés numéro de téléphone| +dash separated number with area code in parenthesis|Numéro de tableau de bord séparés avec le code régional entre parenthèses| +No formatting|Pas de formatage| +with space after city code|avec l'espace après le code de ville| +space separated phone number|espace séparé numéro de téléphone| +Agent Screen Header Date Format|Agent Header Screen Format Date| +Agent Screen Customer Date Format|Agent client Screen Format Date| +Agent Screen Customer Phone Format|Agent Client Téléphone Screen Format| +ERROR- There is a problem with the data that you entered, please go back|ERREUR-Il ya un problème avec les données que vous avez entré, s'il vous plaît revenir| +A timeclock session cannot overlap another timeclock session|A timeclock session ne peuvent pas se chevaucher un autre timeclock session| +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|Désactiver Alter clientèle Téléphone - Si la valeur de Y, ne modifie pas le client numéro de téléphone lors d'un agent dispositions de l'appel. La valeur par défaut est Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agent API d'accès - Cette option permet le compte à utiliser avec l'agent VICIDIAL commandes 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|Alter Agent Client Téléphone Override - Cette option va remplacer ce que l'option est dans la campagne pour modifier le numéro de téléphone du client. NOT_ACTIVE va utiliser quel que soit l'établissement est présent pour la campagne. ALLOW_ALTER toujours de permettre à l'agent de modifier le numéro de téléphone des clients, quel que soit le réglage de la campagne. La valeur par défaut est NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|Agent API Active - Si définie à 1, cela permet à l'agent d'interface API pour fonctionner. La valeur par défaut est 0| +Agent Alter Customer Phone Override: |Alter Agent Client Téléphone Override:| +Agent API Access: |Agent API d'accès:| +Disable Alter Customer Phone: |Désactiver Alter clientèle Téléphone:| +Agent API Active: |Agent API Active:| +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|Agent Display Queue Count - Si la valeur de Y, lorsque le client est en attente d'un agent, la file d'attente de demande d'affichage en haut de l'agent de l'écran devient rouge et indique le nombre d'appels en attente. Le défaut est Y| +Agent Display Queue Count: |Agent Chef de file d'attente d'affichage:| +agents in dead calls|agents morts dans les appels| +QC Last Pull Time: |Pull QC Dernière Heure:| +and less than 43200 seconds or 12 hours|et moins de 43,200 secondes ou 12 heures| +LEADS AT LIMIT|LIMITE AU FILS| +Lead counts taken from active lists in the campaign only|Lead compte active des listes de prises dans la campagne ne| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|Record QC Get lancement Cela permet à l'une des actions suivantes peut être déclenché sur un agent QC recevoir un nouveau record| +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|QC Voir Recording - qui permet un enregistrement qui mai être liée à la QC record à afficher dans le QC agent écran| +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|QC Shift - Il s'agit du changement de calendrier utilisé pour tirer QC pour une campagne. Les jours de la semaine sont ignorées pour ces fonctions| +QC Get Record Launch|Get Lancement Record QC| +QC Show Recording|QC Voir l'enregistrement| +QC Shift|QC Shift| +Inbound Group QC Settings|Inbound Groupe QC Paramètres| +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|QC Shift - Il s'agit du changement de calendrier servant à tirer d'un QC inbound_group. Les jours de la semaine sont ignorées pour ces fonctions| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|La vente et la catégorie Dead Lead Catégorie sont tous deux utilisés par le système de liste de suggestions lors de l'analyse de la liste des statistiques.| +Sale Category: |Vente Catégorie:| +Dead Lead Category: |Dead Lead Catégorie:| +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|Manuelle Filter - Cela vous permet de filtrer les appels que les agents font en mode manuel composer pour cette campagne par une combinaison des éléments suivants: DNC - à coup sur, CAMPAIGNLISTS - le nombre doit être dans les listes pour la campagne, AUCUN - pas de filtre sur le cadran ou manuel rapide composer des listes| +Manual Dial Filter: |Manuelle Filter:| +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|Agent de presse-papiers de copie d'écran - Cette fonctionnalité est actuellement disponible que pour Internet Explorer. Cette fonctionnalité vous permet de sélectionner un domaine qui sera copiée dans le presse-papiers de l'ordinateur de l'agent sur l'ordinateur d'un appel d'être envoyées à un agent. Commune utilise pour cela sont pour faciliter le collage de numéros de compte ou des numéros de téléphone en héritage les applications client à l'agent d'ordinateur| +Agent Screen Clipboard Copy|Agent de copie d'écran du Presse-papiers| +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.|EXTENDED suppléant nombres sont des nombres dans le système en dehors de la norme de l'écran principal de l'information. L'aide de vous pouvez avoir des centaines de numéros de téléphone pour un seul client record.| +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|Agent Screen Extended Alt Dial - Cette fonction permet aux agents d'accéder à des numéros de téléphone suppléant étendue des pistes au-delà de l'Alt Address3 de téléphone et les champs qui peuvent être utilisés dans VICIDIAL de numéros de téléphone au-delà du numéro de téléphone principal. L'étendue des numéros de téléphone peut être composé automatiquement en utilisant la fonction Auto-Alt-Dial VICIDIAL dans les paramètres de campagne, mais l'activation de cette fonctionnalité, agent d'écran permettra également l'agent d'appeler ces numéros à partir de l'écran de leur mandataire, ainsi que de modifier leurs informations| +Agent Screen Extended Alt Dial:|Agent Screen Extended Alt Dial:| +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.|Utilisez Campagne DNC List - Cela définit si cette campagne est de filtrer les mène à une liste DNC qui est spécifique à cette campagne seulement. Si elle est définie à Y, la trémie sera, pour chaque numéro de téléphone dans la campagne des DNC avant de le placer dans la trémie. Si elle est dans la campagne des DNC liste, il va changer le statut qui conduisent à DNCC il ne peut donc pas être composé. La valeur par défaut est N.| +Use Campaign DNC List|Utilisez la liste de campagne DNC| +and possibly the campaign-specific DNC list|et, éventuellement, la campagne de la liste des DNC| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Il ya aussi la possibilité d'ajouter conduit à la campagne des listes DNC et pour les campagnes qui ont les| +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|NOTE: Copie d'une campagne vous permettra de copier tous les paramètres de campagne, le capitaine que vous sélectionnez, mais il ne sera pas copier une campagne spécifique DNC liste s'il y en a un sur le maître, sélectionnez la campagne| +Add New |Ajouter un nouveau| +Copy |Copie| +New DID Addition|A New Addition| +New Copied DID Addition|Nouvelle adjonction Copied DID| +Modify |Modifier| +Delete |Supprimer| +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|Jouer en ligne Place - Cela définit si l'appelant entendra leur place dans la ligne quand ils entrent dans la file d'attente, ainsi que quand ils entendent le announcemend. La valeur par défaut est 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|Hold estimée Play Time - Cela définit si l'appelant entend tenir les prévisions de temps avant qu'ils ne soient transférés à un agent. La valeur par défaut est 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|Hold Time Option - Cela vous permet de spécifier le routage de l'appel, si les prévisions de tenir le temps est sur le montant de la seconde précisés ci-dessous. La valeur par défaut est NON| +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|Hold Time Option secondes - Si Hold Time Option est fixé à rien, mais AUCUNE, c'est le nombre de secondes de l'estimation du temps que vous maintenez le déclencheur tenir option. La valeur par défaut est 360 secondes| +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|Hold Time Option Extension - Si Hold Time Option est fixé à l'extension, c'est l'extension dialplan que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds| +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|Hold Time Option Voicemail - Si Hold Time Option est fixé à la boîte vocale, il s'agit de la boîte vocale que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds| +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|Hold Time Option de transfert In-Group - Si Hold Time Option est fixé à IN_GROUP, c'est l'arrivée du groupe que l'appel sera envoyé à tenir si l'estimation dépasse le temps Hold Time Option Seconds| +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|Hold Time Option Callback Filename - Si Hold Time Option est fixé à CALLERID_CALLBACK, cette invite est le nom du fichier qui se joue avant l'appel est enregistré comme un nouveau chef de file de la liste ID spécifiées ci-dessous si l'estimation est supérieure à la fois tenir Hold Time Option Seconds| +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|Hold Time Option Rappel Liste ID - Si Hold Time Option est fixé à CALLERID_CALLBACK, il s'agit de la liste de ID de l'appel est ajouté à un nouveau chef de file, si les prévisions de tenir le temps dépasse le Hold Time Option Seconds| +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|Hold Recall transfert In-Group - Si un client demande à ce groupe en plus d'une fois et cela n'est pas mis à AUCUNE, puis l'appel sera automatiquement envoyé à l'En-groupe sélectionné dans ce domaine . La valeur par défaut est NON| +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|Appel Route n ° Delay - Mettre ce paramètre à Y va effacer tous les temps d'attente et audio et de tenter d'envoyer l'appel droit à un agent. T-elle pas sur le message d'accueil ou en attente rapide des paramètres. La valeur par défaut est 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|Message de bienvenue Play - Ces réglages choisir le moment de jouer le message de bienvenue défini, TOUJOURS jouera à chaque fois, JAMAIS il ne pourra jamais jouer, IF_WAIT_ONLY seulement jouer le message de bienvenue si l'appel n'est pas immédiatement à un agent , et YES_UNLESS_NODELAY toujours jouer le message de bienvenue NO_DELAY à moins que le paramètre est activé. La valeur par défaut est TOUJOURS| +Play Place in Line: |Jouer en ligne Lieu:| +Play Estimated Hold Time: |Hold estimée Play Time:| +Hold Time Option: |Hold Time Option:| +Hold Time Option Seconds: |Hold Time Option Seconds:| +Hold Time Option Extension: |Hold Time Option Extension:| +Hold Time Option Voicemail: |Hold Time Option de messagerie vocale:| +Hold Time Option Transfer In-Group: |Hold Time Option de transfert en groupe:| +Hold Time Option Callback Filename: |Hold Time Option Callback Filename:| +Hold Time Option Callback List ID: |Hold Time Option Callback Liste ID:| +Hold Recall Transfer In-Group: |Hold Recall transfert en groupe:| +No Delay Call Route: |Pas de délai d'appel Route:| +Play Welcome Message: |Play Message de bienvenue:| +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|DID Extension - C'est le nombre, d'extension ou de DID qui déclenchent cette entrée et que vous la route à l'intérieur du système en utilisant cette fonction| +DID Description -<\/B> This is the description of the DID routing entry|Description DID - Il s'agit de la description de l'entrée de routage DID| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|DID Active - C'est le domaine où vous définissez la DID à l'entrée active ou non. La valeur par défaut est 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|Route DID - Ce type de route que vous avez mis le DID à utiliser. EXTEN va envoyer des appels à l'extension en dessous, à la messagerie vocale vous envoyer des appels directement à la boîte vocale en dessous, AGENT envoie les appels vers un agent VICIDIAL s'ils sont identifiés, PHONE enverra l'appel d'un téléphone d'entrée, sélectionnez ci-dessous, vous IN_GROUP envoyer des appels directement à l'arrivée du groupe spécifié. La valeur par défaut est 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|Extension - Si EXTEN est sélectionné en tant que DID route, alors c'est le dialplan extension qui appelle sera envoyée. La valeur par défaut est 9998811112, pas de service| +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|Extension Contexte - Si EXTEN est sélectionné en tant que DID route, alors c'est le contexte qui dialplan demande sera envoyée. Par défaut est la valeur par défaut| +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|Voicemail Box - Si messagerie vocale est sélectionné en tant que DID Route, c'est la boîte vocale qui demande sera envoyée. La valeur par défaut est vide| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Téléphone Extension - si le téléphone est sélectionné comme DID Route, cette extension est le téléphone que les appels seront envoyées.| +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|Téléphone IP du serveur - si le téléphone est sélectionné comme DID route, alors c'est l'IP du serveur pour le téléphone d'extension que les appels seront envoyés à| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|User Agent - si l'agent est sélectionné en tant que DID route, alors c'est le VICIDIAL l'agent qui demande sera envoyée à| +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|User Unavailable Action - si l'agent est sélectionné en tant que DID route, et l'utilisateur n'est pas connecté ou disponible, c'est la route que les appels se| +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|User Settings En Route-Group - si l'agent est sélectionné en tant que DID route, alors c'est le groupe In-qui sera utilisé pour la file d'attente de paramètres que l'appelant est en attente d'être envoyé à l'agent. La valeur par défaut est 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|In-Groupe ID - Si IN_GROUP est sélectionné en tant que DID route, alors c'est le groupe qui en demande sera envoyée à| +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|In-Call Groupe Handle Method - Si IN_GROUP est sélectionné en tant que DID route, alors c'est la méthode de traitement des appels de ces appels. Base de données ajouter un nouveau record à conduire tous les appels à l'aide du CallerID comme le numéro de téléphone, CIDLOOKUP vais essayer de rechercher le numéro de téléphone par le CallerID dans l'ensemble du système, CIDLOOKUPRL sera attampt pour rechercher le numéro de téléphone par le CallerID précisé que dans une seule liste , CIDLOOKUPRC sera attampt de rechercher le numéro de téléphone par le CallerID dans l'ensemble des listes qui font partie de la campagne spécifié, plus proche est indiquée pour VICIDIAL Closer appels, ANI va ajouter un nouveau record à conduire tous les appels à l'aide du ANI que le numéro de téléphone, ANILOOKUP va tenter de rechercher le numéro de téléphone de l'ANI dans l'ensemble du système, ANILOOKUPRL sera attampt de rechercher le numéro de téléphone par l'ANI précisé que dans une seule liste, XDIGITID amènera l'appelant pour un X chiffres avant que l'appel sera mis en la file d'attente. La valeur par défaut est BDCE| +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|In-Groupe Agent Méthode de recherche - Si IN_GROUP est sélectionné en tant que DID route, alors c'est l'agent de recherche à la méthode de l'arrivée du groupe, LO est à équilibrage de charge-débordement et d'essayer d'envoyer l'appel à un agent sur le serveur local avant d'essayer de l'envoyer à un agent sur un autre serveur, LB est à équilibrage de charge et de tenter d'envoyer l'appel à l'agent, quel que soit elles sont sur le serveur, le serveur SO est seulement et que d'essayer d'envoyer des appels vers les agents sur le serveur que l'appel est venu dans le. La valeur par défaut est 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|Dans la liste Groupe ID - Si IN_GROUP est sélectionné en tant que DID Route, c'est la liste qui mène mai ID être recherchées à travers et que le conduit sera inséré dans le cas échéant| +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|En-groupe ID de la campagne - Si IN_GROUP est sélectionné en tant que DID route, alors c'est le ID de la campagne que mène mai être recherchée dans le cas de la méthode est de faire appel 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|En-groupe Téléphone Code - Si IN_GROUP est sélectionné en tant que DID route, alors ce téléphone est le code utilisé si un nouveau chef de file est créé| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Téléphones Email - L'adresse e-mail associée à ce téléphone d'entrée. Il est utilisé pour les paramètres de messagerie vocale| +ADD A NEW DID|AJOUTER UN NOUVEAU NE| +DID Extension: |DID Extension:| +DID Description: |A Description:| +COPY DID|COPY DID| +Source DID: |Source DID:| +DID NOT ADDED|NE PAS AJOUTER| +there is already a DID in the system with this ID|il ya déjà un DID dans le système avec cette ID| +there is already a DID in the system with this extension|il ya déjà un DID dans le système avec cette extension| +DID NOT MODIFIED|NE MODIFIE PAS| +DID MODIFIED|DID mise à jour| +MODIFY A DID RECORD: |Modifier un DID RECORD:| +DID Route: |Route de DID:| +Extension: |Extension:| +Extension Context: |Extension Contexte:| +Voicemail Box: |Boîte vocale:| +Phone Extension: |Téléphone Extension:| +User Agent: |User Agent:| +User Unavailable Action: |Unavailable Action utilisateur:| +User Route Settings In-Group: |User Settings En Route-Group:| +In-Group ID: |En-groupe ID:| +In-Group Call Handle Method: |In-Call Groupe Handle Méthode:| +In-Group Agent Search Method: |En groupe Agent Méthode de recherche:| +In-Group List ID: |In-Liste du groupe ID:| +In-Group Campaign ID: |En-groupe ID de la campagne:| +In-Group Phone Code: |En-groupe Téléphone Code:| +DELETE THIS DID|SUPPRIMER CETTE DID| +Email: |Email:| +DID NOT DELETED|NE PAS SUPPRIMER| +DID DELETION CONFIRMATION|A DELETION CONFIRMATION| +Click here to delete |Cliquez ici pour supprimer| +DID DELETION COMPLETED|A DELETION ACCOMPLIES| +Delete DIDs: |Supprimer DiDs:| +Modify DIDs: |Modifier DiDs:| +To disable the On Hold Prompt, set the interval to 0|Pour désactiver l'invite en attente, réglez l'intervalle de 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|3-Way Outbound Call CallerID - Cela définit ce qui est envoyé en tant que sortant CallerID nombre de 3-way appels effectués par l'agent, la campagne utilise la campagne personnalisée CallerID, client utilise le numéro de client qui est actif sur les agents de l'écran et utilise les CallerID AGENT_PHONE le téléphone pour que l'agent est entré dans| +3-Way Call Outbound CallerID:|3-Way Outbound Call CallerID:| +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 permet à l'agent de mise manuel composer des appels de la liste d'une campagne tout en étant en mesure de prendre des appels entrants entre le manuel de composer des appels| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|Force va forcer les agents à choisir un code PAUSE si elles cliquez sur le bouton PAUSE| +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|3-Way Call Dial Prefix - Cela définit ce qui est utilisé comme préfixe pour les 3-way appels, par défaut est vide de sorte que la campagne de préfixe est utilisé, passthru afin que vous puissiez entendre sonner est de 88| +3-Way Call Dial Prefix|3-Way Call Dial Prefix| +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|Force timeclock Login - Cette option vous permet de ne pas laisser un agent vous connecter à l'interface agent VICIDIAL si elles ne sont pas enregistrés dans le timeclock. La valeur par défaut est N. Il est possible d'exonérer les utilisateurs admin, le niveau 8 et 9| +Force Timeclock Login|Force timeclock Login| +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|Stats Pourcentage des appels dans les X secondes - Ce domaine vous permet de définir le nombre de secondes que le tenir en temps réel des statistiques d'affichage à utiliser pour calculer le pourcentage d'appels qui ont répondu ont répondu dans X le nombre de secondes en attente| +Stats Percent of Calls Answered Within X seconds|Stats Pourcentage des appels dans les X secondes| +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.|Web Form Public- C'est là que vous pouvez définir la page Web personnalisée cadre que le formulaire web sera ouverte lorsque l'utilisateur clique sur le bouton de formulaire Web. La valeur par défaut est _blank.| +Web Form Target|Formulaire Web Public| +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|Pour personnaliser la chaîne de requête, après le formulaire Web, il suffit de commencer avec le formulaire web, VAR et puis l'URL que vous voulez utiliser, en remplaçant les variables avec les noms des variables que vous voulez utiliser - A - phone_number - B -- comme dans l'onglet 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|Enregistrement Web Link - Ce paramètre permet d'outrepasser les paramètres par défaut de l'affichage de l'enregistrement de lien dans l'admin des pages web. La valeur par défaut est 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|Autre enregistrement IP du serveur - Ce paramètre est l'endroit où vous pouvez mettre une IP de serveur de nom de machine ou d'autres qui peuvent être utilisés à la place de la server_ip dans les liens d'enregistrements au sein de l'administration des pages Web. La valeur par défaut est vide| +Recording Web Link|Enregistrement Web Link| +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|Activer Vtiger Integration - Ce paramètre vous permet d'activer l'intégration avec Vtiger VICIDIAL. Actuellement, des liens vers Vtiger admin et de recherche ainsi que l'utilisateur de réplication sont les seules fonctions d'intégration disponibles. La valeur par défaut est 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|Vtiger DB Server IP - Il s'agit de l'adresse IP de la base de données de votre installation Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Vtiger Database Name - C'est le nom de base de données de votre base de données Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Vtiger Database Login - C'est le nom d'utilisateur utilisé pour vous connecter à votre base de données Vtiger| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Vtiger Database Password - Il s'agit du mot de passe utilisé pour vous connecter à votre base de données Vtiger| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|Vtiger Web - Il s'agit de l'URL ou adresse du site Web utilisé pour accéder à votre installation Vtiger| +Enable Vtiger Integration:|Activer Vtiger Integration:| +Vtiger DB Server IP|Vtiger DB Server IP| +Vtiger Database Name|Vtiger Database Name| +Vtiger Database Login|Vtiger Database Login| +Vtiger Database Password|Vtiger Database Password| +Vtiger URL|Vtiger Web| +VTIGER HOME|VTIGER ACCUEIL| +Active -<\/B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y|Active - Ce champ détermine si l'utilisateur est actif dans le système et peuvent utiliser VICIDIAL ressources. La valeur par défaut est Y| +show only active users|Afficher uniquement les utilisateurs actifs| +show all users|Afficher tous les utilisateurs| +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|Recherche Catégorie Vtiger - Si Vtiger intégration est activé dans les paramètres du système puis de définir ce paramètre lorsque l'vtiger_search.php page de recherche pour le numéro de téléphone qui a été entré. Il ya 4 options qui peuvent être utilisés dans ce domaine: LEAD-Cette option de recherche par le biais du conduit Vtiger seulement, COMPTE-Cette option de recherche par le biais du Vtiger comptes et tous les contacts et les sous-contacts pour le numéro de téléphone, VENDOR-Cette option ne recherche que par l'intermédiaire du Vtiger fournisseurs, ACCTID-Cette option ne fonctionne que pour les comptes et il prendra les VICIDIAL vendor_lead_code terrain et essayer de chercher le numéro de compte Vtiger. En cas d'échec, il va essayer d'autres méthodes que la liste que vous avez sélectionné. Plusieurs options peuvent être utilisées pour chaque recherche, mais sur de grandes bases de données ce n'est pas recommandé. La valeur par défaut est LEAD| +Vtiger Search Category:|Vtiger Recherche Catégorie:| +ACTIVE LISTS CHANGED|LISTES D'ACTIFS MODIFIES| +SUBMIT ACTIVE LIST CHANGES|SUBMIT ACTIVE LISTE DES CHANGEMENTS| +LAST CALL DATE|LAST CALL DATE| +User Group Bulk Change|Changement de groupe d'utilisateur en vrac| +Bulk Group Change|Bulk Change Group| +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 Créer Call Record - Si Vtiger intégration est activé dans les paramètres du système puis de définir ce paramètre est de savoir si un nouveau record d'activité Vtiger est créé pour l'appel lorsque l'agent est à la vtiger_search page. La valeur par défaut est Y| +Vtiger Create Call Record:|Vtiger Créer Enregistrement d'appel:| +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|Vtiger Créer Lead Record - Si Vtiger intégration est activé dans les paramètres système et Vtiger LEAD Recherche Catégorie comprend alors ce paramètre est de déterminer si un nouveau record Vtiger plomb est créé lorsque l'agent est à la page vtiger_search et il n'est pas ont trouvé à l'appel le numéro de téléphone. La valeur par défaut est Y| +Vtiger Create Lead Record:|Vtiger Créer Lead Enregistrement:| +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|Vtiger Login Screen - Si Vtiger intégration est activé dans les paramètres de ce système de réglage de définir si l'utilisateur est connecté à l'interface Vtiger automatiquement lors de leur connexion à VICIDIAL. Le défaut est Y| +Vtiger Screen Login:|Vtiger Screen Login:| +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|Alerte Activé - Ce champ indique si l'agent est le navigateur Web des alertes lorsque les appels ont permis de venir dans leur vicidial.php session. La valeur par défaut est 0 pour les NO| +Alert Enabled:|Alerte Enabled:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|Caractéristiques QC Active - Cette option vous permet d'activer ou désactiver le contrôle de la qualité ou QC fonctionnalités. La valeur par défaut est 0 pour les inactifs| +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|Auto-Outbound Dial Active - Cette option vous permet d'activer ou désactiver la numérotation automatique sortants dans VICIDIAL, la mise en ce domaine à 0 supprime les listes et FILTERS sections et de nombreux champs de la campagne Modification écrans. Manuel de l'entrée de numérotation sera encore autorisée au sein de l'agent de l'écran, mais pas de liste d'appel ne sera possible. La valeur par défaut est 1 pour les actifs| +QC Features Active:|QC Active Caractéristiques:| +Outbound Auto-Dial Active:|Auto Outbound Dial-Active:| +Close Panel|Fermer le panneau| +Choose Report Display Options|Rapport Choisissez Options d'affichage| +To select more than 1 campaign, hold down the Ctrl key and click|Pour sélectionner plus de 1 campagne, maintenez la touche Ctrl enfoncée et cliquez sur| +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|CPD AMD Action - Si vous utilisez le Sangoma ParaXip Call Progress logiciel de détection, vous souhaitez activer ce paramètre, soit la mise à disposition DISPO qui l'appel comme AA et l'accrocher si l'appel est en cours de traitement et n'a pas été envoyée à un agent ou encore MESSAGE qui enverra l'appel à la définition Answering Machine Message pour cette campagne. La valeur par défaut est DISABLED| +CPD AMD Action:|CPD AMD Action:| +Click here for user multiple day status detail report|Cliquez ici pour l'utilisateur de plusieurs jours le statut de détails rapport| +Click here to download this list|Cliquez ici pour télécharger la liste| +Download Lists:|Listes de téléchargement:| +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|Asterisk Active Server - Si Asterisk ne fonctionne pas sur ce serveur, ou si VICIDIAL ne devrait pas utiliser ce serveur, ou si seulement ce serveur en utilisant des scripts pour d'autres comme la trémie de chargement de script que vous souhaiteriez mettre à la N. La valeur par défaut est 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|Générer des fichiers de conf - Si vous souhaitez que le système d'auto-générer des fichiers de conf astérisque sur la base des entrées de téléphones, le transporteur et l'équilibrage de charge des entrées de configuration dans VICIDIAL puis mettre à la valeur par défaut est Y. 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|Reconstruire les fichiers conf - Si vous voulez forcer une reconstruction de la conf Asterisk fichiers ou si l'une des entrées de porte ou les téléphones ont changé, alors ceci doit être réglé sur Y. Après la conf des fichiers ont été générés et Asterisk a été rechargée alors ce sera changée pour N. La valeur par défaut est Y| +Active Asterisk Server:|Active Server Asterisk:| +Generate conf files:|Générer des fichiers de conf:| +Rebuild conf files:|Reconstruire les fichiers de configuration:| +Show Templates|Afficher les modèles| +Add A New Template|Ajouter un nouveau modèle| +ADD NEW CONF TEMPLATE|ADD NEW CONF TEMPLATE| +ADD NEW CARRIER|ADD NEW CARRIER| +ADDING NEW CONF TEMPLATE|AJOUT DE NOUVEAUX CONF TEMPLATE| +ADDING NEW CARRIER|AJOUT DE NOUVEAUX CARRIER| +MODIFY CONF TEMPLATE|MODIFY CONF TEMPLATE| +MODIFY CARRIER|MODIFY CARRIER| +DELETE CONF TEMPLATE|DELETE CONF TEMPLATE| +DELETE CARRIER|DELETE CARRIER| +CONF TEMPLATE LIST|CONF TEMPLATE LISTE| +CARRIER LIST|CARRIER LISTE| +Template ID:|Template ID:| +Template Name:|Nom du modèle:| +Template Contents:|Template Sommaire:| +Carrier ID:|Carrier ID:| +Carrier Name:|Nom du transporteur:| +Registration String:|Inscription à cordes:| +Account Entry:|Entrée de compte:| +Protocol:|Protocole:| +Globals String:|Globals String:| +Dialplan Entry:|Dialplan Entrée:| +CONF TEMPLATE NOT ADDED|CONF TEMPLATE pas ajouté| +there is already a template in the system with this ID|il existe déjà un modèle dans le système avec cette ID| +CONF TEMPLATE ADDED|CONF TEMPLATE AJOUTÉS| +CARRIER NOT ADDED|CARRIER pas ajouté| +there is already a carrier in the system with this ID|il ya déjà un transporteur dans le système avec cette ID| +CONF TEMPLATE NOT MODIFIED|CONF TEMPLATE PAS mise à jour| +CARRIER NOT MODIFIED|CARRIER PAS mise à jour| +CARRIER MODIFIED|CARRIER mise à jour| +CONF TEMPLATE NOT DELETED|CONF TEMPLATE pas supprimé| +Template ID be at least 2 characters in length|Template ID être d'au moins 2 caractères| +CONF TEMPLATE DELETION CONFIRMATION|CONF TEMPLATE DELETION CONFIRMATION| +Click here to delete conf template|Cliquez ici pour supprimer le modèle de conf| +CARRIER NOT DELETED|CARRIER pas supprimé| +Carrier ID be at least 2 characters in length|Carrier ID être d'au moins 2 caractères| +CARRIER DELETION CONFIRMATION|SUPPRESSION DE SUPPORT DE CONFIRMATION| +Click here to delete carrier|Cliquez ici pour supprimer le transporteur| +CONF TEMPLATE DELETION COMPLETED|CONF TEMPLATE DELETION ACCOMPLIES| +CARRIER DELETION COMPLETED|CARRIER SUPPRESSION ACCOMPLIES| +MODIFY A CONF TEMPLATE RECORD|A MODIFIER CONF TEMPLATE RECORD| +DELETE THIS CONF TEMPLATE|SUPPRIMER CETTE CONF TEMPLATE| +MODIFY A CARRIER RECORD|MODIFIER UN SUPPORT D'ENREGISTREMENT| +DELETE THIS CARRIER|SUPPRIMER CETTE CARRIER| +CARRIERS WITHIN THIS SERVER|SUPPORTS DE CE SERVEUR| +CONF TEMPLATE LISTINGS|CONF TEMPLATE LISTAGES| +CARRIER LISTINGS|CARRIER LISTAGES| +PHONES USING THIS CONF TEMPLATE|PHONES UTILISANT CE CONF TEMPLATE| +CARRIERS USING THIS CONF TEMPLATE|SUPPORTS UTILISANT CE CONF TEMPLATE| +Conf Override:|Conf Override:| +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|Template ID - Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le modèle de configuration à travers le système| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Nom du modèle - C'est le nom descriptif du modèle de fichier de configuration d'entrée| +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|Template Sommaire - Ce domaine est l'endroit où vous pouvez entrer dans les paramètres spécifiques pour être utilisés par tous les téléphones et / ou les transporteurs qui sont mis à utiliser ce modèle de conf. Les champs qui ne doivent PAS être inclus dans cette zone sont: le secret, accountcode, compte, nom d'utilisateur et boîte aux lettres| +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|Carrier ID - Ce champ doit être d'au moins 2 caractères et pas plus de 15 caractères, sans espaces. C'est l'identifiant qui sera utilisé pour identifier le transporteur pour cette entrée spécifique dans l'ensemble du système| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Nom du transporteur - C'est le nom descriptif de la porte d'entrée| +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|Inscription String - Ce domaine est l'endroit où vous pouvez entrer dans la chaîne exacte nécessaire dans le IAX ou SIP pour enregistrer le fichier de configuration pour le fournisseur. Facultatif mais fortement recommandé si votre opérateur permet l'enregistrement| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|Template ID - Ce champ facultatif permet de choisir un modèle de fichier de conf de ce transporteur entrée| +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|Compte Entrée - Ce champ est utilisé si vous n'avez pas choisi un modèle à utiliser, et c'est là où vous pouvez entrer dans les paramètres du compte à utiliser pour ce transporteur| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Protocole - Ce domaine vous permet de définir le protocole à utiliser pour le transporteur d'entrée. Actuellement, seuls SIP et IAX sont soutenus| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|Globals String - Ce champ facultatif permet de définir une variable globale à utiliser pour le transporteur de la dialplan| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Entrée Dialplan - Ce champ facultatif permet de définir un ensemble de dialplan entrées à utiliser pour ce transporteur| +Server IP -<\/B> This is the server that this specific carrier record is associated with|Server IP - Il s'agit du serveur que ce support est associé à enregistrer| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Active - Cela définit si le transporteur sera inclus dans l'auto-générés ou non les fichiers conf| +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|Conf Override Settings - Si peuplée, et le modèle est fixé à ID - ABSENCE -, alors le contenu de ce champ sont utilisés comme des entrées de fichier de configuration pour ce téléphone. generate_vicidial_conf téléphones pour ce serveur doit être réglé sur Y pour que cela fonctionne. Ce champ ne doit pas contenir de l'[extension] en ligne, qui sera généré automatiquement| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|Template ID - C'est le fichier de conf ID que ce modèle de téléphone utilisé pour la saisie des paramètres de son Asterisk. La valeur par défaut est - ABSENCE --| +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|Si vous prenez en appels entrants à partir de ce transporteur tronc, vous pouvez définir le contexte = trunkinbound dans ce domaine, de sorte que vous pouvez utiliser le processus de traitement des DID dans 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|Il est réservé par défaut DID que vous pouvez utiliser ce qui est juste le mot-par défaut, sans les tirets, qui allos d'envoyer tout appel qui ne correspond pas à tout les autres modèles de la valeur par défaut de DID| +Campaign VDAD extension|Campagne VDAD extension| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Ce champ permet une coutume VDAD transfert extension. Cela vous permet d'utiliser différentes méthodes de traitement des appels en fonction de votre campagne.| + - 8364 - same as 8368|- 8364 - même que 8368| + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Will seulement envoyer l'appel à un agent sur le même serveur que l'appel est en| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Occasions-1 pour la presse et campagnes de sondage| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - Le premier à essayer d'envoyer l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - DEFAULT? Envoie l'appel à la prochaine agent quel que soit le serveur, ils sont sur| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Occasions de Answering Machine de détection après que, même comportement que 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Occasions de Answering Machine de détection après cette même comportement que 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.|Également dans cette section sont le WEB VAR pour chaque campagne. Il s'agit de permettre à chaque agent d'avoir une autre variable de chaîne qui peuvent être ajoutés à la fiche de Web ou SCRIPT onglet URL, simplement en mettant - A - web_vars - B - comme vous le mettre dans tout autre domaine.| +Group Alias List|Groupe Alias Liste| +Add A New Group Alias|Ajouter un nouveau groupe Alias| +ADD NEW GROUP ALIAS|ADD NEW GROUP ALIAS| +ADDING NEW GROUP ALIAS|AJOUT DE NOUVEAU GROUPE ALIAS| +MODIFY GROUP ALIAS|Modifier un groupe ALIAS| +DELETE GROUP ALIAS|DELETE GROUP ALIAS| +GROUP ALIAS LIST|GROUPE ALIAS LISTE| +GROUP ALIAS LISTINGS|GROUPE ALIAS LISTAGES| +MODIFY A GROUP ALIAS RECORD|Modifier un groupe ALIAS RECORD| +Group Alias ID|Alias Groupe ID| +Group Alias Name|Nom du groupe Alias| +CallerID Number|Nombre CallerID| +CallerID Name|CallerID Nom| +DELETE THIS GROUP ALIAS|Supprimer ce groupe ALIAS| +GROUP ALIAS NOT MODIFIED|GROUPE ALIAS PAS mise à jour| +GROUP ALIAS MODIFIED|GROUPE ALIAS mise à jour| +ADD A NEW GROUP ALIAS|Ajouter un nouveau groupe ALIAS| +MODIFY A GROUP ALIAS RECORD|Modifier un groupe ALIAS RECORD| +GROUP ALIAS NOT ADDED|GROUPE ALIAS pas ajouté| +GROUP ALIAS ADDED|GROUPE ALIAS AJOUTÉS| +GROUP ALIAS NOT DELETED|GROUPE ALIAS pas supprimé| +GROUP ALIAS DELETION CONFIRMATION|GROUPE ALIAS DELETION CONFIRMATION| +Click here to delete group alias|Cliquez ici pour supprimer le groupe alias| +GROUP ALIAS DELETION COMPLETED|GROUPE ALIAS DELETION ACCOMPLIES| +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|Alias Groupe ID - L'ID du groupe alias utilisés par les agents de composer les appels de l'agent VICIDIAL interface avec différents Caller ID. pas d'espaces ou autres caractères spéciaux autorisés. Doit être compris entre 2 et 20 caractères de longueur| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Nom du groupe Alias - Le nom utilisé pour décrire un groupe d'emprunt, doit être compris entre 2 et 50 caractères de longueur| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Numéro d'identification de l'appelant - Le numéro d'identification de l'appelant utilisée dans ce groupe Alias. Chiffres doivent être| +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|Nom d'identification de l'appelant - Le nom d'identification de l'appelant qui peut être envoyé à ce groupe Alias. Pour autant que nous sachions ce qui ne fera que travailler au Canada sur les circuits PRI et l'utilisation d'un tronc IAX boucle par 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|Groupe Alias Admis - Si vous souhaitez permettre à vos agents d'utiliser les alias de groupe, vous devez mettre à Y. alias Groupe sont expliqués plus en section administrative, ils permettent de sélectionner différents agents callerIDs manuel pour les appels sortants qu'ils mai place. La valeur par défaut est 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|Groupe par défaut Alias - Si vous avez permis à ce groupe Alias est l'alias du groupe qui est sélectionné en premier par défaut lorsque l'agent choisit d'utiliser un alias pour un groupe émetteur manuel appel. La valeur par défaut est None ou vide| +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|Groupe par défaut Alias - Si vous avez permis à Groupe Alias pour la campagne que l'agent est entré dans ce groupe est l'alias qui est sélectionnée par défaut sur la première d'un appel provenant de l'arrivée de ce groupe quand l'agent choisit de utiliser un alias pour un groupe émetteur manuel appel. La valeur par défaut est None ou vide| +Group Alias Allowed|Groupe Alias permis| +Default Group Alias|Groupe par défaut Alias| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE permet de choisir l'agent qui CallerID à utiliser pour les 3-way appels à partir d'une liste de choix.| +you cannot use reserved words in group aliases|vous ne pouvez pas utiliser des mots réservés dans le groupe des alias| +Agent Shift Enforcement Override|Agent de l'exécution Shift Override| +Manager Shift Enforcement Override|Shift Manager exécution Override| +Shift Enforcement|Shift exécution| +Max Calls per Second|Max demande par seconde| +Max FILL Calls per Second|Max REMPLISSAGE demande par seconde| +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.|Ce paramètre remplace les utilisateurs quel que soit le groupe d'utilisateurs a mis en application de la loi pour Maj. HANDICAPES utilise l'utilisateur groupe. OFF ne fera pas appliquer à tous les changements. START ne faire respecter les temps de connexion, mais n'aura pas d'incidence sur un agent qui est en cours d'exécution sur leurs heures de travail si elles sont déjà logged in ALL appliquent passer l'heure de début et se connecter à un agent, après, ils courent sur la fin de leur quart de temps. La valeur par défaut est désactivé.| +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.|Ce paramètre, s'il est à 1 permettra d'entrer dans un gestionnaire d'utilisateur et leur mot de passe sur l'écran d'un agent pour l'emporter sur l'évolution des restrictions sur un agent de la session si l'agent essaie de se connecter à l'extérieur de leur quart de travail. La valeur par défaut est 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.|Ce paramètre vous permet de restreindre l'agent de connexion sur la base des changements qui ont été sélectionnés ci-dessous. OFF ne fera pas appliquer à tous les changements. START ne faire respecter les temps de connexion, mais n'aura pas d'incidence sur un agent qui est en cours d'exécution sur leurs heures de travail si elles sont déjà logged in ALL appliquent passer l'heure de début et se connecter à un agent, après, ils courent sur la fin de leur quart de temps. La valeur par défaut est 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.|Ce paramètre détermine le nombre maximum d'appels qui peuvent être mis par la sortie d'auto-script d'appel sur ce serveur par seconde. Doit être de 1 à 100. La valeur par défaut est 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.|Ce paramètre détermine le nombre maximum d'appels qui peuvent être placés par les auto-FILL sortie d'auto-script de numérotation pour tous les serveurs, par seconde. Doit être de 1 à 200. La valeur par défaut est 40.| +System Load|Système de charge| +Live Channels|Live Chaînes| +Disk Usage|Disk Usage| +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.|Ces deux statistiques montrent loadavg la fois d'un système 100 et le pourcentage d'utilisation CPU du serveur et est mis à jour chaque minute. Le loadavg devrait être en moyenne inférieure à 100 multiplié par le nombre de noyaux de CPU de votre système a, pour des performances optimales. Le pourcentage d'utilisation CPU devrait rester en dessous de 50 pour une performance optimale.| +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.|Ce champ indique le nombre actuel d'Asterisk canaux qui sont en direct sur le système dès maintenant. Il est important de noter que le nombre de canaux Asterisk est habituellement beaucoup plus élevé que le nombre d'appels sur un système. Ce champ est mis à jour une fois chaque minute.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Ce champ montre l'utilisation du disque pour chaque partition sur ce serveur. Ce champ est mis à jour une fois chaque minute.| +ADMIN CHANGE LOG|ADMIN CHANGE LOG| +USER ADMIN CHANGE LOG|UTILISATEUR ADMIN CHANGE LOG| +SECTION ADMIN CHANGE LOG|SECTION ADMIN CHANGE LOG| +DETAIL ADMIN CHANGE LOG|DETAIL ADMIN CHANGE LOG| +Last 10000 records|Mise à 10.000 dossiers| +Changes made by|Les modifications apportées par| +Record Detail|Record Detail| +Section Records|Section Records| +Click here to see Admin chages to this record|Cliquez ici pour voir Admin chages à ce record| +Click here to see Admin chages to this campaign|Cliquez ici pour voir Admin chages à cette campagne| +Click here to see Admin chages to this list|Cliquez ici pour voir Admin chages à cette liste| +Click here to see Admin chages to this In-Group|Cliquez ici pour voir Admin chages à ce groupe en| +Click here to see Admin chages to this DID|Cliquez ici pour voir Admin chages à ce DID| +Click here to see Admin chages to this remote agent|Cliquez ici pour voir Admin chages à cette télécommande agent| +Click here to see Admin chages to this user group|Cliquez ici pour voir Admin chages à ce groupe d'utilisateurs| +Click here to see Admin chages to this script|Cliquez ici pour voir Admin chages de ce script| +Click here to see Admin chages to this filter|Cliquez ici pour voir Admin chages à ce filtre| +Click here to see Admin chages to this call time|Cliquez ici pour voir Admin chages à ce temps de garde| +Click here to see Admin chages to this shift|Cliquez ici pour voir Admin chages à ce changement| +Click here to see Admin chages to this phone alias|Cliquez ici pour voir Admin chages à ce téléphone alias| +Click here to see Admin chages to this group alias|Cliquez ici pour voir Admin chages à ce groupe alias| +Click here to see Admin chages to this server|Cliquez ici pour voir Admin chages à ce serveur| +Click here to see Admin chages to this conf template|Cliquez ici pour voir Admin chages à ce modèle de conf| +Click here to see Admin chages to this carrier|Cliquez ici pour voir Admin chages à ce transporteur| +Click here to see Admin chages to the system settings|Cliquez ici pour voir Admin chages pour les réglages du système| +Export Reports|Rapports d'exportation| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Ce paramètre, s'il est à 1 permettra d'accéder à un gestionnaire de l'exportation des rapports sur l'appel RAPPORTS écran. La valeur par défaut est 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.|Ce paramètre, s'il est à 1 permet à un gestionnaire de téléchargement, cliquez sur le lien de la liste au bas de l'écran de modification d'une liste d'exporter la totalité du contenu d'une liste de données à un fichier plat. La valeur par défaut est 0.| +Export Calls Report|Appels d'exportation Rapport| +EXPORT CALLS REPORT|EXPORTATION DE RAPPORT ENGAGE| +For the Export Calls Report, the following field order is used for exports|Pour le rapport invite l'exportation, l'ordre suivant est utilisé pour les exportations| +Timeclock|Horloge en temps| +Logout|Logout| +Show Users|Voir les utilisateurs| +Add A New User|Ajouter un nouvel utilisateur| +Search For A User|Rechercher un utilisateur| +User Stats|Statistiques utilisateur| +User Status|User Status| +Time Sheet|Feuille de temps| +Days Status|Jours Etat| +Campaigns Main|Campagnes principale| +Statuses|Statuts| +HotKeys|HotKeys| +Lead Recycle|Recyclage Plomb| +Auto Alt-Dial|Auto Alt-Dial| +Auto Alt Dial|Auto Alt Dial| +List Mix|Liste Mix| +Pause Codes|Pause Codes| +Basic|Basic| +Detail|Détail| +Survey|Sondage| +Real-Time|Real-Time| +CAMPAIGN ID|CAMPAIGN ID| +DIAL PLAN|DIAL PLAN| +DIAL METHOD|DIAL PROCEDE| +LEADS COUNT|ABOUTIT COUNT| +LEAD ORDER|RESPONSABLE DE COMMANDE| +DIAL STATUSES|DIAL STATUTS| +SCRIPT ID|SCRIPT ID| +SCRIPT NAME|Nom du script| +USER GROUP|GROUPE D'UTILISATEURS| +GROUP NAME|GROUP NAME| +PRIORITY|PRIORITÉ| +FORCE TIMECLOCK|Force timeclock| +CALLTIME ID|CALLTIME ID| +CALLTIME NAME|CALLTIME NOM| +DEFAULT START|Démarrage par défaut| +DEFAULT STOP|DEFAULT STOP| +SHIFT ID|SHIFT ID| +SHIFT NAME|SHIFT NOM| +SHIFT START|SHIFT START| +SHIFT LENGTH|SHIFT LONGUEUR| +WEEKDAYS|SEMAINE| +Template ID|Template ID| +Template Name|Nom du modèle| +Carrier ID|Carrier ID| +Carrier Name|Nom du transporteur| +Registration|Inscription| +Active|Active| +USER ID|USER ID| +FULL NAME|FULL NAME| +LEVEL|NIVEAU| +LINKS|LIENS| +TRUNKS|Malles| +HUMAN|L'HOMME| +ANSWER|REPONSE| +CATEGORY|CATÉGORIE| +STATUSES IN THIS CATEGORY|STATUTS DE CETTE CATEGORIE| +Display|Afficher| +Dates|Dates| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|S'IL VOUS PLAÎT Sélectionnez une campagne ou groupe d'utilisateurs-HEURE ET DATE ET CLIQUEZ CI-DESSUS| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|S'IL VOUS PLAÎT CHOISIR UN UTILISATEUR ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|S'IL VOUS PLAÎT CHOISIR UNE CAMPAGNE ET DATE EN TEMPS ET CLIQUEZ CI-DESSUS| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|S'IL VOUS PLAÎT CHOISIR UN GROUPE EN DATE ET-dessus et cliquez sur Soumettre| +DOWNLOAD|TÉLÉCHARGER| +Users|Utilisateurs| +User|Utilisateur| +Reports|Rapports| +OUTBOUND|SORTANT| +INBOUND|ENTRANT| +Server Stats and Reports|Stats Reports Server et| +Click here to see a VDAD report for this campaign|Cliquez ici pour voir une VDAD rapport de cette campagne| +Show DIDs|Voir DiDs| +Add A New DID|Ajouter une nouvelle DID| +Templates|Modèles| +Carriers|Carriers| +Carrier Name|Nom du transporteur| +Click here to see all CallBack Holds in this user group|Cliquez ici pour voir tous les CallBack Détient dans ce groupe d'utilisateurs| +Click here to see all CallBack Holds in this list|Cliquez ici pour voir tous les CallBack Détient dans cette liste| +Click here to see a report for this inbound group|Cliquez ici pour voir un rapport de ce groupe d'entrants| +Click here to Synchronize users with Vtiger|Cliquez ici pour synchroniser les utilisateurs avec Vtiger| +Alert Enabled|Alerte Enabled| +Change Date|Changement Date| +Login Date|Login Date| +List Last Call Date|Liste Date Last Call| +Phone Code Override|Téléphone Code Override| +GROUP ALIAS ID|ALIAS ID GROUP| +GROUP ALIAS NAME|GROUPE NOM ALIAS| +CID NUMBER|CID NUMÉRO| +CID NAME|CID NOM| +PHONE ALIAS|PHONE ALIAS| +ALIAS ID|ALIAS ID| +ALIAS NAME|Alias| +PHONE LOGINS LIST|TÉLÉPHONE LISTE Connexions| +Shift Length|Longueur Shift| +short description of the shift|brève description de l'évolution| +DELETE THIS SERVER|SUPPRIMER CE SERVEUR| +DELETE THIS CONFERENCE|SUPPRIMER CETTE CONFERENCE| +DELETE THIS VICIDIAL CONFERENCE|SUPPRIMER CETTE CONFERENCE VICIDIAL| +Install Date|Date d'installation| +Human Answer|Réponse de l'homme| +STATUS CATEGORIES|ÉTAT CATEGORIES| +per campaign|par campagne| +all campaigns|toutes les campagnes| diff --git a/translations/it_language.txt b/translations/it_language.txt index c4ffa18f..b7bde64e 100644 --- a/translations/it_language.txt +++ b/translations/it_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"GEN"| @@ -449,3 +449,43 @@ F - Female|F - Femmina| ### BEGIN translation phrases for 2.0.5 release build 890 Date of Birth: |Data di Nascita: | YOU MUST BE PAUSED TO CHANGE GROUPS|DEVI ESSERE IN PAUSA PER CAMBIARE GRUPPO| +Calls in Queue:|Chiede, in coda:| + Timeclock|Orologio| +The user and password you entered are not active in the system|Lutente e la password che hai inserito non sono attivi nel sistema| +Please try again|Si prega di riprovare| +You cannot log in or out within 30 seconds of your last login or logout|Non è possibile accedere o entro 30 secondi del tuo ultimo accesso o il logout| +You have now logged-out|Lei ha appena effettuato laccesso-out| +You logged out at |Hai effettuato laccesso a| +Amount of time you were logged-in: |Importo di tempo sono state registrate in:| +ERROR: timeclock log entry already made: |ERRORE: orologio registro entrata già fatto:| +BACK to Agent Login Screen|Torna alla schermata di login di agente| +BACK to Administration|BACK per Amministrazione| +BACK to Welcome Screen|Torna alla schermata iniziale| +Time since you were last logged-in: |Tempo dallultimo registrato in:| +You last logged-out at: |È lultima connesso a:| +Click LOGIN below to log-in|Clicca qui sotto per LOGIN log-in| +Amount of time you have been logged-in: |Quantità di tempo è stato registrato in:| +You logged-in at:|Hai effettuato laccesso al-in:| +Click LOGOUT below to log-out|Clicca qui sotto per LOGOUT log-out| +Undefined|Undefined| +This phone number is not in the campaign lists|Questo numero di telefono non si trova nella campagna di elenchi| +Unspecified error|Errore non specificato| +Extended Alt Phone Information: |Estensione Alt Telefono informazioni:| +ALT DIAL NUMBER:|ALT DIAL NUMERO:| +Phone Code and Number:|Codice e Numero di telefono:| +Notes: |Note:| +Active: |Attivo:| +Alt Count: |Alt Conte:| +Change this phone number to INACTIVE|Cambia il numero di telefono a INACTIVE| +Change this phone number to ACTIVE|Cambia il numero di telefono per ATTIVO| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|È necessario accedere al orologio LA PRIMA| +There is a time synchronization problem with your system, please tell your system administrator|Cè un problema di sincronizzazione con il tempo il vostro sistema, si prega di informare lamministratore di sistema| +Preview Call|Anteprima invito| +SELECT A GROUP ALIAS|SCEGLI UN GRUPPO ALIAS| +Group Alias Selection|Gruppo Alias selezione| +Click Here to Choose a Group Alias|Clicca qui per scegliere un gruppo Alias| +Group Alias|Gruppo Alias| +ERROR: There are no Shifts enabled for your user group|ERRORE: Non ci sono cambiamenti abilitati per il tuo gruppo di utenti| +ERROR: You are not allowed to log in outside of your shift|ERRORE: Non ti è consentito di accedere al di fuori del proprio turno| +MANAGER OVERRIDE|Sovrascrive MANAGER| +Your Shift is over or has changed, you have been logged out of your session|Il tuo Shift è finita o è cambiato, è stato disconnesso dal tuo sessione| diff --git a/translations/it_language_admin.txt b/translations/it_language_admin.txt index 29fe2439..24771f43 100644 --- a/translations/it_language_admin.txt +++ b/translations/it_language_admin.txt @@ -43,6 +43,27 @@ 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 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### BORDER|Border| @@ -1535,3 +1556,661 @@ CALLS TODAY<|CHIAMATE OGGI<| >DELETE THIS CONFERENCE<|>CANCELLA QUESTA CONFERENZA<| >DELETE THIS VICIDIAL CONFERENCE<|>CANCELLA QUESTA CONFERENZA VICIDIAL<| >please select a campaign from the pulldown above<|>per favore seleziona una campagna dal menu qui in alto<| +### START translations for 2.0.5 release ### +QC Enabled -<\/B> This option allows the user to log in to the Quality Control agent screen|QC Attivato - Questa opzione permette allutente di accedere alla schermata di controllo della qualità agente| +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|QC Utente Livello - Questa impostazione consente di definire ciò che lagente di controllo della qualità è il livello utente. Ciò dettare il livello di funzionalità per lagente nel QC sezione| +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|QC record Pass - Questa opzione permette di specificare lagente di un record che ha superato il primo turno delle QC dopo aver esaminato il record| +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|QC record Fine - Questa opzione permette di specificare lagente che ha finito di registrare il secondo turno delle QC dopo aver esaminato il passato record| +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|QC record Impegni - Questa opzione permette di specificare lagente che un record è stato commesso in QC. Essa non può più essere modificato da chiunque| +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|QC ammessi Campagne - Si tratta di un elenco di campagne selezionabili che membri di questo gruppo di utenti sarà in grado di QC. The All-CAMPAGNE opzione consente agli utenti di questo gruppo di QC una campagna sul 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|QC ammessi Inbound Gruppi - Si tratta di un elenco di ingresso selezionabile gruppi che membri di questo gruppo di utenti sarà in grado di QC. TUTTI I GRUPPI opzione consente agli utenti di questo gruppo di utenti di qualsiasi entrata CQ gruppo sul sistema| +QC Enabled: |QC Enabled:| +QC User Level: |QC Utente Livello:| +QC Pass: |QC Pass:| +QC Finish: |QC Fine:| +QC Commit: |QC Impegni:| +Modify Nothing|Modificare Nulla| +Modify Nothing Except Status|Modificare Nulla Salvo Stato| +Modify All Fields|Modificare tutti i campi| +Verify First Round of QC|Verificare prima tornata di CQ| +View QC Statistics|Vedi QC Statistiche| +Ability to Modify FINISHed records|Capacità di modificare i record finito| +Manager Level|Livello Manager| +USERS CAN VIEW ANY CAMPAIGN|Gli utenti possono visualizzare qualsiasi campagna| +USERS CAN QC ANY CAMPAIGN|Gli utenti possono, QC OGNI CAMPAGNA| +USERS CAN QC ANY INBOUND GROUP|Gli utenti possono QC INBOUND OGNI GRUPPO| +QC Allowed Campaigns: |QC ammessi Campagne:| +QC Allowed Inbound Groups: |QC ammessi Inbound Gruppi:| +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|Coda di priorità - Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended| +Queue Priority: |Coda di priorità:| +Drop Action: |Goccia dazione:| +Drop Transfer Group: |Trasferimento Drop Group:| +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|Goccia dazione - Questo menu consente di scegliere che cosa succede a una chiamata quando si è in attesa di più di quello che si trova nel campo Secondi Call Drop. Hangup semplicemente riagganciare la chiamata, inviare il messaggio di chiamare il Drop Extensions che lei ha definito di seguito, segreteria invierà la chiamata alla casella vocale che è stato definito sotto IN_GROUP e invia la chiamata in ingresso al gruppo che è definito qui di seguito| +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|Drop Extensions - In caso di caduta di azione è fissato al messaggio, questa è la linea che il piano di estensione invito sarà inviato a se raggiunge Call Drop Secondi| +Drop Call Seconds -<\/B> The number of seconds a call will stay in queue before being considered a DROP|Call Drop Secondi - Il numero di secondi di una chiamata rimane in coda, prima di essere considerato un 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|Trasferimento Drop Group - In caso di caduta di azione è fissato a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si raggiunge il Call Drop Secondi| +QC SETTINGS FOR THIS CAMPAIGN|IMPOSTAZIONI CQ per questa campagna| +QC Enabled: |QC Enabled:| +QC Statuses: |QC Status:| +Modify Campaign QC Settings|Modifica impostazioni campagna, QC| +QC Enabled -<\/B> Setting this field to Y allows for the agent Quality Control features to work. Default is N|QC Attivato - Limpostazione di questo campo a Y consente, per lagente di Controllo della Qualità funzioni. Il valore di default è 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 QC - La zona dove si è stati di selezionare quale porta deve essere andato oltre, QC, dal sistema. Mettere un segno di spunta accanto allo status che si desidera, QC, di rivedere| +QC SETTINGS NOT MODIFIED|QC IMPOSTAZIONI NON MODIFICATI| +QC SETTINGS MODIFIED|IMPOSTAZIONI CQ MODIFICATI| +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|QC Indirizzo Web Form - Questo è lindirizzo web che un agente, QC può andare quando si fa clic sul link contenuto nel Web Form, QC schermo| +QC Script -<\/B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen|QC Script - Questo è lo script che possono essere utilizzati da agenti QC nel SCRIPT scheda nella schermata QC| +QC WebForm: |QC Web Form:| +QC Script|QC Script| +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|Nel gruppo di registrazione Sovrascrive - Questo campo consente di rilevante della campagna chiamata di registrazione. Questa impostazione può essere ignorata dal vicidial_user scavalcare limpostazione di registrazione. ANDICAPPATI non ignorare la campagna di registrazione. Non potrà mai disabilitare la registrazione sul client. OnDemand è il default e permette lagente di avviare e interrompere la registrazione, se necessario. ALLCALLS si avvia la registrazione sul client quando viene inviata una chiamata a un agente. ALLFORCE si avvia la registrazione sul client quando viene inviata una chiamata a un agente che lagente non opzione per interrompere la registrazione| +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|Nel gruppo di registrazione Filename - Questo campo sovrascrive la campagna di registrazione Filenaming sistema a meno che non sia impostato su NESSUNO. Le variabili sono ammessi CAMPAGNA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che assomigliare a questa TESTCAMP_51020103108_3125551212. Max 50 caratteri. Il valore di default è NESSUNO| +In-Group Recording Override: |Nel gruppo di registrazione Override:| +In-Group Recording Filename: |Nel gruppo Registrazione Nome file:| +ADDING VICIDIAL QC STATUS CODE|AGGIUNGENDO VICIDIAL QC CODICE STATO| +MODIFY VICIDIAL QC STATUS CODE|MODIFICA VICIDIAL QC CODICE STATO| +VICIDIAL QC STATUS CODES|QC VICIDIAL Codici di stato| +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.|Il Controllo Qualità-QC VICIDIAL sistema ha il proprio set di codici di stato separato da coloro che, nelle funzioni di gestione delle chiamate VICIDIAL. QC statuse codici deve essere compresa tra 2 e 8 caratteri e non contengono caratteri speciali, come uno spazio o due punti. Il codice di stato, QC descrizione deve essere compresa tra 2 e 30 caratteri di lunghezza.| + QC Status Codes |Codici di stato, QC| +VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: |QC VICIDIAL Status CODICI Nellambito di questo sistema:| +ADD NEW QC STATUS CODE|ADD NEW QC CODICE STATO| +QC STATUS CODE NOT DELETED|QC CODICE STATO NON DELETED| +QC STATUS CODE DELETED: |QC STATUS CODICE DELETED:| +QC STATUS CODE NOT MODIFIED |QC CODICE STATO NON MODIFICATI| +QC STATUS CODE MODIFIED: |QC CODICE STATO MODIFICATO:| +the qc status code needs to be at least 1 characters in length|qc il codice di stato deve essere di almeno 1 caratteri di lunghezza| +the qc status code name needs to be at least 1 characters in length|qc stato il nome in codice deve essere di almeno 1 caratteri di lunghezza| +QC STATUS CODE NOT ADDED |QC CODICE STATO NON AGGIUNTO| +there is already a qc status code in the system with this name:|vi è già un qc codice di stato del sistema con questo nome:| +QC STATUS CODE ADDED: |QC STATUS CODICE AGGIUNTO:| +code must be between 1 and 8 characters in length|codice deve essere compreso tra 1 e 8 caratteri di lunghezza| +code name must be between 2 and 30 characters in length|nome in codice deve essere compreso tra 2 e 30 caratteri di lunghezza| +CALL HANGUP REASON STATS|INVITO hangup MOTIVO STATS| +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|After Hours Azione - Loperazione da eseguire se si tratta di ore dopo, come definito nel tempo per la chiamata in entrata questo gruppo. Hangup hangup immediatamente la chiamata, si MESSASGE riprodurre il file in After Hours Messaggio Filenam campo, ESTENSIONE invierà la chiamata al After Hours Estensione nel dialplan Voicemail e invia la chiamata alla casella vocale di cui il settore After Hours Voicemail , IN_GROUP invierà la chiamata in ingresso al gruppo selezionato nel gruppo After Hours Trasferimento selezionare lista. Il valore di default è MESSAGGIO| +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|After Hours Trasferimento Group - Se After Hours azione è destinata a IN_GROUP, la chiamata verrà inviata a questo gruppo in entrata se si entra nel gruppo in al di fuori del regime di chiamata tempo definito per il gruppo in| +After Hours Transfer Group: |Dopo ore di trasferimento del gruppo:| +Total calls taken in to this In-Group:|Totale chiamate a prendere in questo gruppo:| +CALL HOLD TIME BREAKDOWN IN SECONDS|INVITO HOLD TIME RIPARTIZIONE IN SECONDI| +Date Range:|Date:| +ADDING NEW PHONE ALIAS|Aggiunta di nuovi TELEFONO ALIAS| +ADD NEW PHONE ALIAS|AGGIUNGI NUOVO TELEFONO ALIAS| +MODIFY PHONE ALIAS|MODIFICA ALIAS TELEFONO| +DELETE PHONE ALIAS|DELETE PHONE ALIAS| +PHONE ALIAS LIST|ALIAS ELENCO TELEFONICO| +Phone Alias List|Telefono Alias Elenco| +Add A New Phone Alias|Aggiungi un nuovo telefono Alias| +ADD A NEW PHONE ALIAS|AGGIUNGI UN NUOVO TELEFONO ALIAS| +Alias ID: |Alias ID:| +Alias Name: |Alias Nome:| +Phone Logins List: |Telefono Login Lista:| +PHONE ALIAS NOT ADDED|ALIAS TELEFONO NON AGGIUNTO| +there is already a Phone Alias in the system with this ID|vi è già un Telefono Alias nel sistema con questo ID| +there is already a Phone Login in the system with this ID|vi è già un Telefono Login nel sistema con questo ID| +PHONE ALIAS ADDED|TELEFONO ALIAS AGGIUNTO| +PHONE ALIAS NOT MODIFIED|ALIAS TELEFONO NON MODIFICATI| +PHONE ALIAS MODIFIED|TELEFONO ALIAS MODIFICATI| +PHONE ALIAS NOT DELETED|ALIAS TELEFONO NON DELETED| +PHONE ALIAS DELETION CONFIRMATION|TELEFONO ALIAS CONFERMA ELIMINAZIONE| +Click here to delete phone alias|Clicca qui per cancellare telefono alias| +PHONE ALIAS DELETION COMPLETED|TELEFONO ALIAS DELETION COMPIUTI| +PHONE ALIAS LISTINGS|TELEFONO ALIAS LISTINGS| +there is already a Phone alias in the system with this login|vi è già un alias Telefono nel sistema con questo login| +there is already a Phone in the system with this login|vi è già un telefono nel sistema con questo login| +DELETE THIS PHONE ALIAS|CANC questo telefono ALIAS| +MODIFY A PHONE ALIAS RECORD|MODIFICARE UN TELEFONO ALIAS RECORD| +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 Alias - LID del alias utilizzati per consentire di telefono carico equilibrato login. senza spazi o altri caratteri speciali ammessi. Deve essere compreso tra 2 e 20 caratteri di lunghezza| +Alias Name -<\/B> The name used to describe a phones alias, Must be between 2 and 50 characters in length|Alias Nome - Il nome utilizzato per descrivere un alias cellulari, deve essere compresa tra 2 e 50 caratteri di lunghezza| +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|Cellulari Login Lista - Lelenco separato da virgole di telefono cellulare utilizzato dati di accesso quando un agente accede tramite telefono cellulare carico equilibrato login. Lagente si trova lapplicazione server attivo con il minor numero di agenti e registrati in una chiamata da tale server di agenti su login| +PHONES WITHIN THIS PHONES ALIAS|TELEFONI CELLULARI PRESENTE IN ALIAS| +Add New Shift|Aggiungi nuovo Shift| +New Shift Addition|Nuova aggiunta Maiusc| +Modify Shift|Modificare Maiusc| +Delete Shift|Elimina Maiusc| +Shifts|Turni| +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|Maiusc ID - Questo è il nome breve di un Vicidial Maiusc Definizione. Questo deve essere un identificatore unico. Non utilizzare spazi o segni di punteggiatura in questo campo. max 20 caratteri, minimo di 2 caratteri| +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 Shift - Questo è un nome più descrittivo della Maiuscole Definizione. Questa è una breve sintesi della Maiuscole definizione. max 50 caratteri, minimo di 2 caratteri| +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|Start Time Shift - Questo è il tempo che la campagna ha inizio turno. Deve essere solo numeri, 9:30 AM sarebbe 5:00 PM 0930 e 1700 sarebbe| +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|Maiusc Lunghezza - Questo è il tempo in ore e minuti che la campagna a turni dura. 8 ore sarebbe 08:00 e 7 ore e 30 minuti sarebbero 07:30| +Shift Weekdays -<\/B> In this section you should choose the days of the week that this shift is active|Maiusc Weekdays - In questa sezione si deve scegliere il giorno della settimana che questo spostamento è attivo| +Show Shifts|Mostra cambiamenti| +Add A New Shift|Aggiungi un nuovo Shift| +Shift ID: |Maiusc ID:| +Shift Name: |Maiusc Nome:| +Shift Start Time: |Maiusc Start Time:| +Shift End Time: |Fine Time Shift:| +SHIFT DEFINITION NOT ADDED|SHIFT DEFINIZIONE NON AGGIUNTO| +there is already a shift entry with this ID|esiste già una voce con questo passaggio ID| +Shift ID and name must be at least 2 characters in length|Maiusc ID e il nome deve essere di almeno 2 caratteri| +Shift Start Time must be 4 digits in length and be a valid time|Start Time Shift 4 cifre devono essere di lunghezza e da tempo una valida| +Shift Length must be 5 characters in length and be 24 hours or less|Maiusc Lunghezza deve essere di 5 caratteri di lunghezza e di 24 ore o meno| +SHIFT ADDED: |SHIFT AGGIUNTI:| +MODIFY A SHIFT|Modificare una SHIFT| +USER GROUPS USING THIS SHIFT:|LUSO DI QUESTO MANUALE GRUPPI SHIFT:| +DELETE THIS SHIFT DEFINITION|Elimina questo SHIFT DEFINIZIONE| +MODIFY A SHIFT|Modificare una SHIFT| +SHIFT NOT DELETED|SHIFT non eliminati| +SHIFT DELETION CONFIRMATION: |SHIFT DELETION CONFERMA:| +Click here to delete shift|Clicca qui per cancellare turno| +SHIFT DELETION COMPLETED:|SHIFT DELETION Completato:| +SHIFT MODIFIED|SHIFT MODIFICATI| +SHIFT LISTINGS:|SHIFT LISTINGS:| +Shift Weekdays: |Maiusc Feriali:| +Sunday|Domenica| +Monday|Lunedi| +Tuesday|Martedì| +Wednesday|Mercoledì| +Thursday|Giovedi| +Friday|Venerdì| +Saturday|Sabato| +Group Shifts: |Gruppo Turni:| +Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|Gruppo Turni - Si tratta di un elenco dei turni selezionabili che possono limitare il tempo di accesso agenti sul sistema| + Timeclock|Orologio| +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|Orologio End Of Day - Questa impostazione definisce il momento in cui tutti gli utenti devono essere registrati automaticamente dal sistema orologio. Funziona solo una volta al giorno. deve essere solo il 4 cifre 2 cifre 2 cifre ora e 24 minuti in ora di tempo. Il valore di default è 0000| +Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout|Ultimo orologio automatico Logout - Questo campo visualizza la data degli ultimi auto-logout| +Timeclock Last Auto Logout: |Ultimo Logout orologio automatico:| +Timeclock End Of Day: |Orologio End of Day:| +SURVEY SETTINGS FOR THIS CAMPAIGN:|INDAGINE SETTINGS per questa campagna:| +Modify Campaign Survey|Modificare la campagna Sondaggio| +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.|Indagine primo file audio - Questo è il nome del file audio che viene riprodotto non appena il cliente sceglie il telefono cellulare durante lesecuzione di un sondaggio campagna.| +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 |Indagine sulle cifre DTMF - Questo campo è il punto in cui definire le cifre che un cliente può premere come opzione su una campagna di indagine. cifre DTMF sono validi| +Survey Not Interested Digit -<\/B> This field is where you define the customer digit pressed that will show they are Not Interested.|Indagine non interessa Digit - Questo campo è dove si definisce il cliente premuto cifre che dimostrano che non sono interessati.| +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.|Indagine non interessa Stato - Questo campo è se si seleziona lo stato che saranno utilizzati per non essere interessato. DNC Se viene utilizzato e la campagna è impostata per usare DNC poi il numero di telefono sarà automaticamente aggiunto alla lista VICIDIAL interno DNC.| +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.|Indagine Opt-in Audio File - Questo è il nome del file audio che viene riprodotto quando il cliente ha optato-in per lindagine, non hanno scelto lopt-out non ha risposto o se la non-azione-reazione è impostato su OptOut. Dopo questo file audio viene riprodotto, il metodo di indagine di azione.| +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|Indagine non interessa File audio - Questo è il nome del file audio che viene riprodotto quando il cliente ha scelto lopt-out di indagine, non hanno scelto lopt-in o non ha risposto se il non-azione-reazione è impostato su OptIn. Dopo questo file audio viene riprodotto, linvito sarà appeso| +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.|Indagine Metodo - Questa opzione definisce che cosa succede a una chiamata dopo che il cliente ha scelto lopt-in. AGENT_XFER invierà linvito al prossimo disponibili agente. Segreteria invierà la chiamata alla casella vocale che è specificato nel campo Voicemail. ESTENSIONE invierà al cliente di definire lestensione della Indagine Xfer Estensione campo. Hangup si bloccherà il cliente. CAMPREC_60_WAV invierà al cliente di avere una registrazione fatta con la loro risposta, questa registrazione sarà collocato in una cartella denominata come la campagna allinterno della campagna di registrazione Indagine Directory.| +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.|Indagine n. risposta Azione - Questo è dove si definisce che cosa accadrà se non vi è alcuna risposta alla domanda del sondaggio. OptIn solo inviare la chiamata al metodo di indagine, se il cliente preme un cifre DTMF. OptOut invierà al cliente al metodo di indagine, anche se non si preme uno cifre DTMF.| +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.|Indagine risposta Digit Mappa - Questa è la sezione in cui è possibile definire una descrizione per andare a ciascuna opzione cifre DTMF che il cliente può scegliere.| +Survey Xfer Extension -<\/B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension|Indagine Xfer Estensione - Se il metodo di indagine è stato selezionato ESTENSIONE quindi chiamare il cliente sarebbe stata destinata a questo dialplan estensione| +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.|Indagine campagna di registrazione Repertorio - Se il metodo di indagine è stato selezionato CAMPREC_60_WAV allora la risposta dei clienti vengono registrati e messi in una directory di nome, dopo la campagna allinterno di questa directory.| +SURVEY SETTINGS NOT MODIFIED|INDAGINE IMPOSTAZIONI NON MODIFICATI| +SURVEY SETTINGS MODIFIED|INDAGINE SETTINGS MODIFICATI| +Survey First Audio File|Indagine primo file audio| +Survey DTMF Digits|Indagine sulle cifre DTMF| +Survey Not Interested Digit|Indagine non interessa Digit| +Survey Not Interested Status|Indagine Stato non è interessato| +Survey Opt-in Audio File|Indagine Opt-in File Audio| +Survey Not Interested Audio File|Indagine non interessa File Audio| +Survey Method|Indagine Metodo| +Survey No-Response Action|Indagine n.-Azione di risposta| +Survey Response Digit Map|Indagine risposta Digit Mappa| +Survey Xfer Extension|Indagine Xfer Estensione| +Survey Campaign Recording Directory|Indagine Campagna Registrazione Directory| +Add Timeclock Log Record -<\/B> This option allows the user to add records to the timeclock log|Aggiungi orologio Entra record - Questa opzione permette allutente di aggiungere record alla orologio Accedi| +Modify Timeclock Log Record -<\/B> This option allows the user to modify records in the timeclock log|Modificare orologio Entra record - Questa opzione permette allutente di modificare i record nella orologio Accedi| +Delete Timeclock Log Record -<\/B> This option allows the user to delete records in the timeclock log|Elimina orologio Entra record - Questa opzione consente allutente di eliminare i record nel registro orologio| +Add Timeclock Log Record|Aggiungi orologio Entra record| +Modify Timeclock Log Record|Modificare orologio Entra record| +Delete Timeclock Log Record|Elimina orologio Entra record| +USER GROUP TIMECLOCK STATUS REPORT|User Group orologio Status RELAZIONE| +Click here to see the Timeclock Status for this user group|Clicca qui per visualizzare lorologio di stato per questo gruppo di utenti| +ADD NUMBERS TO THE DNC LIST|Aggiungere numeri alla DNC ELENCO| +Phone Numbers: |Numeri di telefono:| +one phone number per line only|uno per ogni riga il numero di telefono unico| +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|DNC VICIDIAL List - Questo Dont Call elenco contiene ogni piombo che è stato fissato ad uno stato di DNC nel sistema. Attraverso il ELENCHI - ADD numero DNC pagina si ha la possibilità di aggiungere manualmente i numeri di questo elenco in modo che essi non saranno chiamati da campagne che utilizzano la lista interno DNC| + Time Sheet |Time Sheet| +Timeclock Record Edit|Orologio Modifica record| +Default date format with year month day|Default data con formato giorno mese anno| +USA date format with month day year|Stati Uniti dAmerica con il formato della data giorno mese anno| +European date format with day month year|Europeo con il formato della data giorno mese anno| +Text date format with abbreviated month day|Testo abbreviato con il formato della data giorno mese| +followed by 24 hour time|seguita da 24 ore di tempo| +followed by 12 hour time|seguita da 12 ore di tempo| +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|Agente Screen Header Data Format - Questo menu consente di scegliere il formato della data che compare nella parte superiore della schermata VICIDIAL agente. Le opzioni di questa impostazione sono: il default è| +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|Cliente di agente Screen Formato data - Questo menu consente di scegliere il formato del cliente fuso orario data che compare nella parte superiore della sezione Informazioni per i clienti del VICIDIAL agente schermo. Le opzioni di questa impostazione sono: il default è| +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|Agente Telefono Formato schermo clienti - Questo menu consente di scegliere il formato del cliente, numero di telefono che compare nella sezione status del VICIDIAL agente schermo. Le opzioni di questa impostazione sono: il default è| +dash separated phone number|dash separati numero di telefono| +dash separated number with area code in parenthesis|dash separati numero con prefisso parentesi| +No formatting|N. formattazione| +with space after city code|con lo spazio dopo il codice di città| +space separated phone number|spazio separato numero telefonico| +Agent Screen Header Date Format|Agente Screen Formato Data Header| +Agent Screen Customer Date Format|Cliente di agente Screen Formato Data| +Agent Screen Customer Phone Format|Agente Cliente Telefono Formato schermo| +ERROR- There is a problem with the data that you entered, please go back|ERRORI Si è verificato un problema con i dati che hai inserito, si prega di tornare indietro| +A timeclock session cannot overlap another timeclock session|Un orologio di sessione non può sovrapporsi di un altro orologio sessione| +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|Disattiva Alter clienti Telefono - Se è impostata a Y, non cambia il numero di telefono del cliente, quando un agente disposizioni la chiamata. Il valore di default è Y| +Agent API Access -<\/B> This option allows the account to be used with the vicidial agent API commands|Agente Accesso API - Questa opzione permette laccount da utilizzare con lAPI vicidial agente comandi| +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|Agente Alter clienti Telefono Sovrascrive - Questa opzione sovrascrive lopzione è ciò che nella campagna per modificare il numero di telefono del cliente. NOT_ACTIVE userà qualsiasi impostazione è presente per la campagna. ALLOW_ALTER sempre per consentire lagente di modificare il numero di telefono del cliente, non importa ciò che la campagna è limpostazione. Il valore di default è NOT_ACTIVE| +Agent API Active -<\/B> If set to 1, this will allow the Agent API interface to function. Default is 0|Agente attivo API - Se è impostato a 1, questo permetterà lagente interfaccia API di funzionare. Il valore di default è 0| +Agent Alter Customer Phone Override: |Agente Alter clienti Sovrascrive Telefono:| +Agent API Access: |Agente API Accesso:| +Disable Alter Customer Phone: |Disattiva Alter Clienti Telefono:| +Agent API Active: |API di agente attivo:| +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|Agente Mostra Coda Conte - Se è impostata a Y, ogni volta che un cliente è in attesa di un agente, la coda invita visualizzazione nella parte superiore dello schermo agente diventa rosso e mostra il numero di chiamate in attesa. Il valore di default è Y| +Agent Display Queue Count: |Agente Mostra Coda Count:| +agents in dead calls|agenti morti chiamate| +QC Last Pull Time: |QC Ultimo Tirare Tempo:| +and less than 43200 seconds or 12 hours|e meno di 43200 secondi o 12 ore| +LEADS AT LIMIT|PORTA AL LIMITE| +Lead counts taken from active lists in the campaign only|Piombo conta prese da elenchi attiva nella campagna solo| +QC Get Record Launch-<\/B> This allows one of the following actions to be triggered upon a QC agent receiving a new record|QC ottenere il record di lancio- Ciò consente una delle seguenti azioni per essere attivato su un QC agente riceve un nuovo record| +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|QC Visualizza Registrazione - Ciò consente una registrazione che può essere collegato con la QC record di essere esposto nel QC agente schermo| +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|QC Maiusc - Questo è il passaggio di tempo utilizzato per estrarre QC record per una campagna. I giorni della settimana sono ignorati per queste funzioni| +QC Get Record Launch|QC ottenere il record di lancio| +QC Show Recording|Visualizza la registrazione, QC| +QC Shift|QC Maiusc| +Inbound Group QC Settings|Inbound Gruppo QC Impostazioni| +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|QC Maiusc - Questo è il passaggio di tempo utilizzato per estrarre QC record per un inbound_group. I giorni della settimana sono ignorati per queste funzioni| +The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|La vendita e Dead Categoria Categoria di piombo sono entrambi utilizzati dal sistema quando Elenco Suggerimento analisi statistiche elenco.| +Sale Category: |Vendita Categoria:| +Dead Lead Category: |Morto leader Categoria:| +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|Manuale Dial Filtro - Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTS - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi| +Manual Dial Filter: |Manuale Dial Filtro:| +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|Appunti di agente Schermata Copia - Questa funzione è al momento attivo solo per Internet Explorer. Questa funzione consente di selezionare un campo che verrà copiato negli appunti il computer dellagente computer su una chiamata in corso linvio di un agente. Comune utilizza per questo sono per facilitare lincollatura di numeri di conto corrente o numeri di telefono in eredità applicazioni client sul computer agente| +Agent Screen Clipboard Copy|Appunti di agente Schermata Copia| +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.|PROROGATO alternano i numeri sono numeri caricato nel sistema al di fuori della norma portare informazioni schermo. Uso PROROGATO si possono avere centinaia di numeri di telefono per un singolo cliente record.| +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|Agente Screen estensione Alt Dial - Questa funzione consente di agenti per laccesso esteso alternano i numeri di telefono per porta oltre la normale Alt Telefono e Address3 settori che possono essere utilizzati in VICIDIAL per i numeri di telefono al di là del numero di telefono principale. Lestensione numeri di telefono può essere selezionato automaticamente utilizzando la funzione Auto-Alt-Dial VICIDIAL in funzione delle impostazioni della campagna, ma che consentono questa funzione di agente dello schermo consentirà anche per lagente di chiamare questi numeri dal loro agente schermo così come modificare le loro informazioni| +Agent Screen Extended Alt Dial:|Agente Screen estensione Alt Dial:| +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.|Usa campagna DNC List - Questo definisce se questa è una campagna per filtrare DNC conduce contro una lista che è specifico per tale campagna solo. Se è impostato su Y, la tramoggia sarà per ciascuno il numero di telefono nel campo specifico DNC prima immissione nella tramoggia. Se si è in campagna specifici DNC elenco allora cambierà status che portano a DNCC e non può quindi essere selezionato. Il valore predefinito è N.| +Use Campaign DNC List|Usa campagna DNC Elenco| +and possibly the campaign-specific DNC list|e, eventualmente, la campagna specifici DNC elenco| +There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them|Vi è inoltre la possibilità di aggiungere porta alla campagna specifici DNC liste per le campagne che hanno loro| +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|NOTA: La copia di una campagna di copiare tutte le impostazioni dal comandante campagna selezionata, ma non si copia una campagna specifica DNC lista se è stato selezionato uno sul master campagna| +Add New |Aggiungi nuovo| +Copy |Copia| +New DID Addition|Nuova aggiunta DID| +New Copied DID Addition|Nuova aggiunta Copiato DID| +Modify |Modificare| +Delete |Eliminare| +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|Gioca Luogo in Linea - Questo definisce se il chiamante ascolterà il loro posto in linea momento in cui entra nella coda così come quando sentono il announcemend. Il valore di default è 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|Gioca stimato Hold Time - Questo definisce se il chiamante ascolterà il tempo stimato tenere prima di essere trasferiti a un agente. Il valore di default è 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|Tenere Opzione Tempo - Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO| +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|Tenere Opzione Tempo Secondi - Se Hold Time opzione è impostata a nulla, ma NESSUNO, questo è il numero di secondi di attesa tempo stimato che il tempo di attivare lopzione. Il valore predefinito è 360 secondi| +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|Tenere Opzione Tempo Estensione - Se lopzione Hold Time è impostato per estensione, questo è il dialplan proroga che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi| +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|Tenere Tempo Opzione Segreteria - Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi| +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|Tenere Opzione Tempo trasferimento in gruppo - Se Hold Time opzione è impostata a IN_GROUP, questo è il gruppo in entrata che linvito sarà inviato a se la stima del tempo di attesa supera il tempo di Opzione Secondi| +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|Tenere Opzione Tempo richiamata Filename - Se lopzione Hold Time è impostato su CALLERID_CALLBACK, questo è il nome del file che viene riprodotto prompt prima che la chiamata viene registrata come un nuovo condurre alla lista ID specificato di seguito, se la stima del tempo di attesa supera i Tenere Opzione Tempo Secondi| +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|Tenere Opzione Tempo richiamata Elenco ID - Se lopzione Hold Time è impostato su CALLERID_CALLBACK, questo è lelenco ID la chiamata viene aggiunto come un nuovo piombo se la stima del tempo di attesa supera il tempo di Opzione Secondi| +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|Tenere Ricorda Trasferimento In-Group - Se un cliente chiede di tornare in questo gruppo di più di una volta e questo non è impostato su Nessuno, quindi la chiamata verrà automaticamente inviata al gruppo selezionato In-in questo campo . Il valore di default è NESSUNO| +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|Scadenza Bando n. rotta - Impostando questo parametro a Y rimuoverà tutti i tempi di attesa e audio richiede e si tenta di inviare il diritto di chiamata di un agente. Non ignorare il messaggio di benvenuto o tenere prompt impostazioni. Il valore di default è 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|Lettura del messaggio di benvenuto - Queste impostazioni selezionate, quando per la riproduzione del messaggio di benvenuto definito, SEMPRE svolgerà ogni volta, non potrà mai mai giocare, IF_WAIT_ONLY solo riprodurre il messaggio di benvenuto, se la chiamata non vada immediatamente ad un agente , e YES_UNLESS_NODELAY avranno sempre il messaggio di benvenuto NO_DELAY a meno che limpostazione è attivata. Il valore di default è SEMPRE| +Play Place in Line: |Gioca Luogo in Linea:| +Play Estimated Hold Time: |Gioca Tenere Tempo stimato:| +Hold Time Option: |Tenere Tempo Opzione:| +Hold Time Option Seconds: |Tenere Opzione Secondi Tempo:| +Hold Time Option Extension: |Tenere Opzione Tempo Estensione:| +Hold Time Option Voicemail: |Tenere Tempo Opzione Segreteria:| +Hold Time Option Transfer In-Group: |Tenere Opzione Tempo trasferimento in gruppo:| +Hold Time Option Callback Filename: |Tenere il tempo di richiamata Opzione Nome file:| +Hold Time Option Callback List ID: |Tenere Opzione Tempo richiamata Elenco ID:| +Hold Recall Transfer In-Group: |Tenere Ricorda Trasferimento in gruppo:| +No Delay Call Route: |Scadenza Bando n. Percorso:| +Play Welcome Message: |Lettura del messaggio di benvenuto:| +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|Estensione DID - Questo è il numero, lestensione o la DID che attiveranno questa voce e che si percorso allinterno del sistema di utilizzare questa funzione| +DID Description -<\/B> This is the description of the DID routing entry|Descrizione DID - Questa è la descrizione di DID routing| +DID Active -<\/B> This the field where you set the DID entry to active or not. Default is Y|HA attiva - Questo è il campo in cui si è impostato il DID ingresso attivo o meno. Il valore di default è 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|HA rotta - Questo tipo di percorso che si è impostato il DID da usare. Estensione invierà le chiamate verso lestensione al di sotto, segreteria invierà chiede direttamente alla casella vocale al di sotto, AGENTE invierà le chiamate a un agente VICIDIAL se sono connesso, TELEFONO invierà la chiamata a un telefono voce selezionata di seguito, si IN_GROUP inviare chiamate direttamente al gruppo specificato in entrata. Il valore di default è Extensions| +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|Estensione - Se è selezionata come estensione DID rotta, allora questa è lestensione che dialplan inviti saranno inviati. Il valore di default è 9998811112, nessun servizio| +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|Estensione Contesto - Se è selezionata come estensione DID rotta, allora questo è il contesto che dialplan inviti saranno inviati. Il valore di default è di 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|Voicemail Box - Se è selezionata come Voicemail DID rotta, allora questa è la casella vocale che inviti saranno inviati. Il valore di default è vuota| +Phone Extension -<\/B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.|Telefono Estensione - Se è selezionata come TELEFONO DID percorso, allora questo è il telefono cellulare in estensione che inviti saranno inviati.| +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|Telefono Server IP - Se è selezionata come TELEFONO DID percorso, allora questo è lIP del server per il telefono che chiede lestensione sarà trasmessa al| +User Agent -<\/B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to|User Agent - Se è selezionata come AGENTE DID rotta, allora questo è lagente che chiede VICIDIAL saranno inviati alla| +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|Lutente non disponibile Azione - Se è selezionata come AGENTE DID rotta, e lutente non è connesso o disponibili, allora questo è il percorso che le chiamate si| +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|Utente percorso Impostazioni In-Group - Se è selezionata come AGENTE DID rotta, allora questo è il gruppo In-che saranno utilizzati per la coda di impostazioni come il chiamante è in attesa di essere inviati al agente. Il valore di default è 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|In-ID gruppo - Se è selezionata come IN_GROUP DID rotta, allora questo è il gruppo In-chiede che saranno inviati alla| +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|Nel gruppo di chiamata Metodo Maniglia - Se è selezionata come IN_GROUP DID rotta, allora questo è il metodo di gestione delle chiamate per queste chiamate. CID di aggiungere un nuovo record con piombo ogni chiamata utilizzando il CallerID come il numero di telefono, CIDLOOKUP tenterà di ricerca il numero di telefono dal CallerID in tutto il sistema, CIDLOOKUPRL sarà attampt di ricerca il numero di telefono dal CallerID specificato in una sola lista , CIDLOOKUPRC si attampt di ricerca il numero di telefono dal CallerID in tutte le liste che appartengono alla campagna specificato, più vicina è specificato per VICIDIAL Closer chiamate, ANI si aggiunge un nuovo record con piombo ogni chiamata utilizzando il ANI, come il numero di telefono, ANILOOKUP tenterà di ricerca il numero di telefono dal ANI in tutto il sistema, ANILOOKUPRL si attampt di ricerca il numero di telefono dal ANI specificato in una sola lista, XDIGITID verrà chiesto il chiamante per una X cifre del codice prima che la chiamata verrà messa in la coda. Il valore di default è 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|Nel gruppo di agente Metodo di ricerca - Se è selezionata come IN_GROUP DID rotta, allora questo è il metodo di ricerca agente debba essere utilizzato da un gruppo in entrata, LO è Load-Balanced-Overflow e cercherà di inviare la chiamata di un agente sul server locale prima di tentare di inviarlo a un agente su un altro server, LB è bilanciamento del carico e si tenta di inviare la chiamata al prossimo agente non importa ciò che essi sono il server, server-SO è solo e solo tenta di inviare gli inviti agli agenti presenti sul server che linvito è venuto in su. Il valore di default è 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|Nel gruppo Lista ID - Se è selezionata come IN_GROUP DID rotta, allora questo è lelenco ID che porta può essere cercato attraverso la porta e che sarà inserito in se necessario| +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|Nel gruppo-ID campagna - Se è selezionata come IN_GROUP DID rotta, allora questo è lID campagna che porta può essere cercato per se il metodo di gestire la chiamata è 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|Nel gruppo Codice Telefono - Se è selezionata come IN_GROUP DID rotta, allora questo è il codice utilizzato Telefono se un nuovo piombo è creato| +Phones Email -<\/B> The email address associated with this phone entry. This is used for voicemail settings|Cellulari e-mail - Lindirizzo email associato a questo telefono cellulare entrata. Questo è utilizzato per le impostazioni della segreteria| +ADD A NEW DID|AGGIUNGI UN NUOVO DID| +DID Extension: |HA Estensione:| +DID Description: |HA Descrizione:| +COPY DID|COPIA DID| +Source DID: |HA Fonte:| +DID NOT ADDED|NON HA AGGIUNTO| +there is already a DID in the system with this ID|vi è già un fatto per il sistema con questo ID| +there is already a DID in the system with this extension|vi è già un fatto per il sistema con questa estensione| +DID NOT MODIFIED|NON MODIFICATI| +DID MODIFIED|HA MODIFICATO| +MODIFY A DID RECORD: |A MODIFICARE LO RECORD:| +DID Route: |HA Percorso:| +Extension: |Estensione:| +Extension Context: |Estensione Contesto:| +Voicemail Box: |Voicemail Box:| +Phone Extension: |Estensione Telefono:| +User Agent: |User Agent:| +User Unavailable Action: |Lutente non disponibile Azione:| +User Route Settings In-Group: |Utente percorso Impostazioni In-Group:| +In-Group ID: |Nel gruppo-ID:| +In-Group Call Handle Method: |Nel gruppo di chiamata Maneggiare Metodo:| +In-Group Agent Search Method: |Nel gruppo di agente Metodo di ricerca:| +In-Group List ID: |Nel gruppo Elenco ID:| +In-Group Campaign ID: |Nel gruppo-ID campagna:| +In-Group Phone Code: |Nel gruppo Codice Telefono:| +DELETE THIS DID|CANCELLA QUESTO HA| +Email: |Email:| +DID NOT DELETED|NON HA ELIMINATO| +DID DELETION CONFIRMATION|LO CONFERMA ELIMINAZIONE| +Click here to delete |Clicca qui per cancellare| +DID DELETION COMPLETED|DELETION HA COMPIUTO| +Delete DIDs: |Elimina DIDs:| +Modify DIDs: |Modificare DIDs:| +To disable the On Hold Prompt, set the interval to 0|Per disattivare il prompt Hold On, impostare lintervallo a 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|3-Way chiamate in uscita CallerID - Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in| +3-Way Call Outbound CallerID:|3-Way chiamate in uscita CallerID:| +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 consente di collocare lagente manuale comporre le chiamate provenienti da una campagna elenco pur essendo in grado di prendere le chiamate in entrata tra manuale quadrante chiamate| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|VIGORE costringerà gli agenti di scegliere un codice PAUSE se fai clic sul pulsante PAUSE| +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|3-Way Call Dial Prefix - Questo definisce quello che è usato come prefisso per chiamare il 3-way chiamate, di default è vuoto in modo che il prefisso campagna quadrante è usato, passthru in modo che tu possa sentire suonare è 88| +3-Way Call Dial Prefix|3-Way Call Dial Prefix| +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|Forza orologio Login - Questa opzione permette di non lasciare che un agente ad accedere al VICIDIAL agente interfaccia se non hanno effettuato laccesso al orologio. Il valore predefinito è N. Vi è la possibilità di esentare admin utenti, i livelli 8 e 9| +Force Timeclock Login|Forza orologio Login| +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|Statistiche per cento delle chiamate risposta entro X secondi - Questo campo consente di impostare il numero di tenere secondo le statistiche in tempo reale che il display utilizza per calcolare la percentuale di risposta che sono state chiamate risposta entro X numero di secondi in attesa| +Stats Percent of Calls Answered Within X seconds|Statistiche per cento delle chiamate risposta entro X secondi| +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.|Web Form-Target Qui è possibile impostare la pagina web personalizzata cornice del modulo web che sarà aperto a quando lutente fa clic sul pulsante Web Form. Il valore di default è _blank.| +Web Form Target|Web Form Target| +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|Per personalizzare la stringa di ricerca dopo il modulo web, è sufficiente avviare il modulo web con VAR e quindi lURL che si desidera utilizzare, che sostituisce le variabili con i nomi di variabile che si desidera utilizzare - A - phone_number - B -- proprio come nella sezione SCRIPTS scheda| +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|Registrazione Web Link - Questa impostazione consente di ignorare limpostazione predefinita della visualizzazione della registrazione in collegamento lamministratore pagine web. Il valore di default è 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|Supplente di registrazione Server IP - Questa impostazione è dove si può mettere un server IP o nome di altre macchine che possono essere utilizzati al posto del server_ip tra i link alle registrazioni ai admin pagine web. Il valore di default è vuota| +Recording Web Link|Registrazione Web Link| +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|Attiva Vtiger Integrazione - Questa impostazione consente di attivare Vtiger integrazione con VICIDIAL. Attualmente i collegamenti a Vtiger admin e di ricerca così come utente di replica sono gli unici disponibili funzioni di integrazione. Il valore di default è 0| +Vtiger DB Server IP -<\/B> This is the IP address of the database for your Vtiger installation|Vtiger DB Server IP - Questo è lindirizzo IP della banca dati per la vostra installazione Vtiger| +Vtiger Database Name -<\/B> This is the database name for your Vtiger database|Vtiger Nome Database - Questo è il nome del database per il vostro database Vtiger| +Vtiger Database Login -<\/B> This is the user name used to log in to your Vtiger database|Vtiger Database Login - Questo è il nome utente utilizzato per accedere al vostro database Vtiger| +Vtiger Database Password -<\/B> This is the password used to log in to your Vtiger database|Vtiger Database Password - Questa è la password utilizzata per accedere al tuo database Vtiger| +Vtiger URL -<\/B> This is the URL or web site address used to get to your Vtiger installation|Vtiger URL - Questo è lURL o lindirizzo del sito web utilizzato per accedere al tuo Vtiger installazione| +Enable Vtiger Integration:|Attiva Vtiger Integrazione:| +Vtiger DB Server IP|Vtiger DB Server IP| +Vtiger Database Name|Nome Database Vtiger| +Vtiger Database Login|Vtiger Database Login| +Vtiger Database Password|Vtiger Database Password| +Vtiger URL|Vtiger URL| +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|Active - Questo campo definisce se lutente è attivo nel sistema e può essere utilizzato VICIDIAL risorse. Il valore di default è Y| +show only active users|mostra solo utenti attivi| +show all users|mostra tutti gli utenti| +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|Vtiger Ricerca Categoria - Se Vtiger integrazione è attivata in poi le impostazioni del sistema questa impostazione definirà in cui la pagina di ricerca vtiger_search.php per il numero di telefono che è stato inserito. Ci sono 4 opzioni che possono essere utilizzati in questo campo: PIOMBO-Questa opzione ricerca attraverso la porta solo Vtiger, CONTO-Questa opzione ricerca attraverso il Vtiger conti e tutti i contatti e sub-contatti per il numero di telefono, VENDITORE-Questa opzione solo attraverso la ricerca Vtiger venditori, ACCTID-Questa opzione funziona solo per i conti e si prendono le vicidial vendor_lead_code campo e provare a cercare il Vtiger ID account. Se si tenta senza successo di qualsiasi altro metodi elencati che hai selezionato. Opzioni multiple possono essere utilizzati per ogni ricerca, ma su grandi banche dati questo non è raccomandato. Il valore di default è PIOMBO| +Vtiger Search Category:|Vtiger Ricerca Categoria:| +ACTIVE LISTS CHANGED|ATTIVO LISTE CAMBIAMENTO| +SUBMIT ACTIVE LIST CHANGES|ATTIVO PRESENTARE ELENCO MODIFICHE| +LAST CALL DATE|DATA ULTIMA CHIAMATA| +User Group Bulk Change|User Group Bulk Cambia| +Bulk Group Change|Bulk Gruppo Cambia| +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 Crea chiamate record - Se Vtiger integrazione è attivata in poi le impostazioni del sistema questa impostazione definisce se una nuova attività Vtiger è stato creato per registrare la chiamata quando lagente va al vtiger_search pagina. Il valore di default è Y| +Vtiger Create Call Record:|Vtiger Crea chiamate record:| +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|Vtiger Crea record Piombo - Se è attivata Vtiger integrazione nel sistema e le impostazioni Vtiger Ricerca Categoria PIOMBO comprende quindi questa impostazione definisce se un nuovo record Vtiger piombo viene creato quando lagente va a vtiger_search la pagina di registrazione e non è di avere trovato la chiamata numero di telefono. Il valore di default è Y| +Vtiger Create Lead Record:|Vtiger Crea Piombo record:| +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|Vtiger Screen Login - Se Vtiger di integrazione è attivata in poi le impostazioni del sistema questa impostazione definisce se lutente è connesso al Vtiger interfaccia automaticamente quando laccesso al VICIDIAL. Il valore di default è Y| +Vtiger Screen Login:|Vtiger Screen accesso:| +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|Alert Attivato - Questo campo indica se lagente ha permesso browser avvisi per quando si chiede loro in vicidial.php sessione. Il valore di default è 0 per il NO| +Alert Enabled:|Alert Enabled:| +QC Features Active -<\/B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive|Caratteristiche di Active QC - Questa opzione consente di attivare o disattivare la qualità o le caratteristiche di controllo della qualità. Il valore di default è 0 per inattive| +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|Outbound Auto-Dial Active - Questa opzione consente di attivare o disattivare la connessione automatica in uscita entro VICIDIAL, limpostazione di questo campo a 0 rimuove gli elenchi e le sezioni FILTRI e molti campi della campagna Modifica schermi. Manuale per lingresso di selezione sarà ancora consentita lagente da schermo, ma nessuna lista di selezione sarà possibile. Il valore di default è 1, per attività di| +QC Features Active:|QC Active Caratteristiche:| +Outbound Auto-Dial Active:|Outbound Active Auto-Dial:| +Close Panel|Chiudi pannello| +Choose Report Display Options|Scegli Opzioni di visualizzazione Relazione| +To select more than 1 campaign, hold down the Ctrl key and click|Per selezionare più di campagna 1, tenere premuto il tasto Ctrl e fare clic su| +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|CPD AMD Azione - Se si utilizza il Sangoma ParaXip chiamate di avanzamento di rilevamento di software allora si desidera attivare questa impostazione o limpostazione di DISPO disposizione che la chiamata come AA e appende se la chiamata è in fase di elaborazione e non è stato inviato a un agente o un messaggio che ancora invierà la richiesta alla Segreteria definito Messaggio per questa campagna. Il valore di default è ANDICAPPATI| +CPD AMD Action:|CPD AMD Azione:| +Click here for user multiple day status detail report|Clicca qui per lutente più giorni status dettaglio relazione| +Click here to download this list|Clicca qui per scaricare lelenco| +Download Lists:|Download liste:| +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|Active Server Asterisk - Asterisk Se non è in esecuzione su questo server, o se VICIDIAL non dovrebbero utilizzare questo server, o se sono solo utilizzando questo server per altri script come la tramoggia di carico script si desidera impostare questo N. Il valore di default è 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|Genera file conf - Se si desidera il sistema di auto-generare asterisco conf file basati su telefoni voci, le voci del vettore e di impostazione di bilanciamento del carico allinterno VICIDIAL quindi impostare ad Y. Il valore di default è 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|Ricostruire conf - Se si desidera forzare una ricostruzione del Asterisk conf file o se uno dei telefoni cellulari o vettore voci hanno cambiato allora questo deve essere impostato a Y. Dopo il file di configurazione sono stati generati e Asterisk ha stati ricaricati quindi questo sarà cambiato in N. Il valore di default è Y| +Active Asterisk Server:|Active Server Asterisk:| +Generate conf files:|Genera file di configurazione:| +Rebuild conf files:|Ricostruire i file di configurazione:| +Show Templates|Visualizza modelli| +Add A New Template|Aggiungi un nuovo modello| +ADD NEW CONF TEMPLATE|ADD NEW CONF TEMPLATE| +ADD NEW CARRIER|AGGIUNGI NUOVO VETTORE| +ADDING NEW CONF TEMPLATE|Aggiunta di nuovi CONF TEMPLATE| +ADDING NEW CARRIER|Aggiunta di nuovi VETTORE| +MODIFY CONF TEMPLATE|MODIFICA TEMPLATE CONF| +MODIFY CARRIER|MODIFICA DEL VETTORE| +DELETE CONF TEMPLATE|CANC CONF TEMPLATE| +DELETE CARRIER|CANC VETTORE| +CONF TEMPLATE LIST|CONF TEMPLATE ELENCO| +CARRIER LIST|ELENCO CARRIER| +Template ID:|Template ID:| +Template Name:|Nome modello:| +Template Contents:|Template Sommario:| +Carrier ID:|Vettore ID:| +Carrier Name:|Nome del vettore:| +Registration String:|Stringa di registrazione:| +Account Entry:|Conto Entrata:| +Protocol:|Protocollo:| +Globals String:|Globals Stringa:| +Dialplan Entry:|Dialplan entrata:| +CONF TEMPLATE NOT ADDED|CONF TEMPLATE NON AGGIUNTO| +there is already a template in the system with this ID|vi è già un modello del sistema con questo ID| +CONF TEMPLATE ADDED|CONF TEMPLATE AGGIUNTO| +CARRIER NOT ADDED|Vettore non AGGIUNTO| +there is already a carrier in the system with this ID|vi è già un elemento portante del sistema con questo ID| +CONF TEMPLATE NOT MODIFIED|CONF TEMPLATE NON MODIFICATI| +CARRIER NOT MODIFIED|VETTORE NON MODIFICATI| +CARRIER MODIFIED|VETTORE MODIFICATI| +CONF TEMPLATE NOT DELETED|CONF TEMPLATE NON DELETED| +Template ID be at least 2 characters in length|Template ID essere almeno 2 caratteri| +CONF TEMPLATE DELETION CONFIRMATION|CONF TEMPLATE CONFERMA ELIMINAZIONE| +Click here to delete conf template|Clicca qui per cancellare conf modello| +CARRIER NOT DELETED|Vettore non DELETED| +Carrier ID be at least 2 characters in length|Vettore ID essere almeno 2 caratteri| +CARRIER DELETION CONFIRMATION|CONFERMA ELIMINAZIONE DEL VETTORE| +Click here to delete carrier|Clicca qui per cancellare vettore| +CONF TEMPLATE DELETION COMPLETED|CONF TEMPLATE DELETION COMPIUTI| +CARRIER DELETION COMPLETED|VETTORE DELETION COMPIUTI| +MODIFY A CONF TEMPLATE RECORD|MODIFICARE UN RECORD CONF TEMPLATE| +DELETE THIS CONF TEMPLATE|CONF CANC QUESTO MODELLO| +MODIFY A CARRIER RECORD|MODIFICARE UN RECORD DEL VETTORE| +DELETE THIS CARRIER|Elimina questo VETTORE| +CARRIERS WITHIN THIS SERVER|PORTARINFUSE IN QUESTO SERVER| +CONF TEMPLATE LISTINGS|CONF TEMPLATE LISTINGS| +CARRIER LISTINGS|VETTORE LISTINGS| +PHONES USING THIS CONF TEMPLATE|PHONES LUSO DI QUESTO MODELLO CONF| +CARRIERS USING THIS CONF TEMPLATE|PORTARINFUSE LUSO DI QUESTO MODELLO CONF| +Conf Override:|Conf. Sovrascrive:| +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|Template ID - Questo campo deve essere di almeno 2 caratteri e non più di 15 caratteri, senza spazi. Questo è lID che sarà utilizzato per identificare il modello di conf in tutto il sistema| +Template Name -<\/B> This is the descriptive name of the conf file template entry|Nome modello - Questo è il nome descrittivo del file di conf modello entrata| +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|Template Sommario - Questo campo è possibile entrare nello specifico delle impostazioni per essere utilizzati da tutti i telefoni o e-vettori che sono impostate per lutilizzo di questo modello conf. I campi che non dovrebbero essere inclusi in questa casella sono i seguenti: segreto, accountcode, account, nome utente e la casella e-mail| +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 Vettore - Questo campo deve essere di almeno 2 caratteri e non più di 15 caratteri, senza spazi. Questo è lID che sarà utilizzato per individuare il vettore per questo specifico entrata in tutto il sistema| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|Nome Vettore - Questo è il nome descrittivo del vettore entrata| +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|Registrazione Stringa - Questo campo è possibile immettere nella stringa esatta necessaria la SIP IAX o file di configurazione per la registrazione al provider. Opzionale, ma altamente raccomandato se il vettore consente di registrazione| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|Template ID - Questo campo opzionale vi permette di scegliere un file di configurazione per questo modello vettore entrata| +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|Conto Entrata - Questo campo è utilizzato se non hai selezionato un modello da utilizzare, ed è dove si può entrare nello specifico le impostazioni da utilizzare per questo vettore| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|Protocollo - Questo campo permette di definire il protocollo da utilizzare per lingresso del vettore. Attualmente solo SIP e IAX sono supportati| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|Globals Stringa - Questo campo opzionale permette di definire una variabile globale da utilizzare per il vettore in dialplan| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|Entrata Dialplan - Questo campo opzionale permette di definire una serie di dialplan voci da utilizzare per questo vettore| +Server IP -<\/B> This is the server that this specific carrier record is associated with|Server IP - Questo è il server che questo specifico vettore record è associato con| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|Attiva - Questo definisce se il vettore sarà incluso nel generata automaticamente conf file o non| +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|Conf. Sovrascrive Impostazioni - Se popolate, e il modello di ID è impostato su - INSUSSISTENZA - quindi il contenuto di questo campo è utilizzato come file di conf voci per questo telefono. per questo generate_vicidial_conf telefoni server deve essere impostato su Y per questo lavoro. Questo campo NON deve contenere il [estensione] linea, che sarà generato automaticamente| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|Template ID - Questo è il file di conf che questo modello di telefono cellulare ID entrata utilizzerà per i suoi Asterisk impostazioni. Il valore di default è - INSUSSISTENZA --| +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 si sarà tenuto a chiamate in entrata da questo vettore tronco che si desidera impostare il contesto trunkinbound = allinterno di questo settore, in modo che si può utilizzare il processo di trattamento allinterno DID 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|Vi è una riservati DID predefinito che è possibile utilizzare, che è solo la parola-default-senza trattini, che Allos di inviare qualsiasi richiesta che non corrisponde a tutte le altre esistenti modelli di default DID| +Campaign VDAD extension|Campagna VDAD estensione| +This field allows for a custom VDAD transfer extension. This allows you to use different call handling methods depending upon your campaign.|Questo campo consente un trasferimento personalizzato VDAD estensione. Questo vi permette di utilizzare diversi metodi di gestione delle chiamate a seconda della tua campagna.| + - 8364 - same as 8368|- 8364 - 8368 stessa| + - 8365 - Will send the call only to an agent on the same server as the call is on|- 8365 - Will inviare la chiamata ad un solo agente sullo stesso server come la chiamata è in| + - 8366 - Used for press-1 and survey campaigns|- 8366 - Usato-1 per la stampa e campagne di indagine| + - 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers|- 8367 - Il primo a provare a inviare la chiamata a un agente sul server locale, poi si guarda su altri server| + - 8368 - DEFAULT – Will send the call to the next available agent no matter what server they are on|- 8368 - DEFAULT? Può inviare linvito alla prossima disponibili agente non importa quale server si trovano in| + - 8369 - Used for Answering Machine Detection after that, same behavior as 8368|- 8369 - Utilizzato per Segreteria di rilevamento, dopo che, lo stesso comportamento come 8368| + - 8373 - Used for Answering Machine Detection after that same behavior as 8366|- 8373 - Utilizzato per Segreteria di rilevamento dopo lo stesso comportamento come 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.|Anche in questa sezione sono WEB VAR per ciascuna campagna. Questi permettono di ogni agente di avere una diversa variabile stringa che può essere aggiunto al Web Form o SCRIPT scheda URL semplicemente messa - A - web_vars - B - come si farebbe con qualsiasi altro posto campo.| +Group Alias List|Gruppo Alias Elenco| +Add A New Group Alias|Aggiungere un nuovo gruppo Alias| +ADD NEW GROUP ALIAS|AGGIUNGI NUOVO GRUPPO ALIAS| +ADDING NEW GROUP ALIAS|AGGIUNGENDO NUOVO GRUPPO ALIAS| +MODIFY GROUP ALIAS|MODIFICA GRUPPO ALIAS| +DELETE GROUP ALIAS|Elimina gruppo ALIAS| +GROUP ALIAS LIST|GRUPPO ALIAS ELENCO| +GROUP ALIAS LISTINGS|GRUPPO ALIAS LISTINGS| +MODIFY A GROUP ALIAS RECORD|MODIFICARE UN GRUPPO ALIAS RECORD| +Group Alias ID|Gruppo Alias ID| +Group Alias Name|Alias Nome Gruppo| +CallerID Number|Numero CallerID| +CallerID Name|CallerID Nome| +DELETE THIS GROUP ALIAS|CANCELLA QUESTO GRUPPO ALIAS| +GROUP ALIAS NOT MODIFIED|ALIAS GRUPPO NON MODIFICATI| +GROUP ALIAS MODIFIED|GRUPPO ALIAS MODIFICATI| +ADD A NEW GROUP ALIAS|Aggiungere un nuovo gruppo ALIAS| +MODIFY A GROUP ALIAS RECORD|MODIFICARE UN GRUPPO ALIAS RECORD| +GROUP ALIAS NOT ADDED|ALIAS GRUPPO NON AGGIUNTO| +GROUP ALIAS ADDED|GRUPPO ALIAS AGGIUNTO| +GROUP ALIAS NOT DELETED|ALIAS GRUPPO NON DELETED| +GROUP ALIAS DELETION CONFIRMATION|ALIAS GRUPPO CONFERMA ELIMINAZIONE| +Click here to delete group alias|Clicca qui per eliminare gruppo alias| +GROUP ALIAS DELETION COMPLETED|GRUPPO ALIAS DELETION COMPIUTI| +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|Alias ID gruppo - LID del gruppo alias utilizzati da agenti di effettuare chiamate in uscita le chiamate dalla VICIDIAL agente di interfaccia con le diverse Caller ID. senza spazi o altri caratteri speciali ammessi. Deve essere compreso tra 2 e 20 caratteri di lunghezza| +Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length|Gruppo Alias Nome - Il nome utilizzato per designare un gruppo di alias, deve essere compresa tra 2 e 50 caratteri di lunghezza| +Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only|Numero ID chiamante - Il numero ID del chiamante utilizzato in questo gruppo di Alias. Deve essere solo cifre| +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|Caller ID Nome - Il Caller ID nome che possono essere inviati con questo gruppo di Alias. Per quanto ne sappiamo questo funziona solo in Canada e il PRI circuiti IAX loop utilizzando un tronco attraverso 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|Gruppo Alias ammessi - Se si desidera consentire agli agenti di utilizzare il vostro gruppo alias quindi è necessario impostare questo gruppo Y. Alias sono spiegate più in Admin sezione, che consentono di selezionare diversi agenti callerIDs manuale per le chiamate in uscita che essi possono posto. Il valore di default è 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|Predefinito Gruppo Alias - Se si hanno consentito Gruppo Alias allora questo è il gruppo alias che viene selezionato per impostazione predefinita quando prima lagente sceglie di utilizzare un gruppo di Alias per un manuale di chiamata in uscita. Il valore predefinito è vuoto o NESSUNO| +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|Predefinito Gruppo Alias - Se si hanno consentito Alias gruppo per la campagna che lagente è registrato in poi questo è il gruppo alias che è stato selezionato prima di default su un invito da parte di questo gruppo in entrata, quando lagente sceglie di utilizzare un gruppo di Alias per un manuale di chiamata in uscita. Il valore predefinito è vuoto o NESSUNO| +Group Alias Allowed|Gruppo Alias ammessi| +Default Group Alias|Predefinito Gruppo Alias| +AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.|AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte.| +you cannot use reserved words in group aliases|non è possibile utilizzare le parole riservate nel gruppo alias| +Agent Shift Enforcement Override|Agente Maiusc esecuzione Sovrascrive| +Manager Shift Enforcement Override|Shift Manager esecuzione Sovrascrive| +Shift Enforcement|Maiusc esecuzione| +Max Calls per Second|Max chiede al secondo| +Max FILL Calls per Second|Max COMPILA invita al secondo| +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.|Questa impostazione si sovrascriverà qualsiasi cosa gli utenti del gruppo di utenti ha fissato per lesecuzione Maiusc. ANDICAPPATI utilizzerà lutente gruppo. OFF non applicare a tutti i turni. INIZIO solo applicare il login, ma non riguarda un agente che è in esecuzione sul loro passaggio, se essi sono già eseguito laccesso TUTTE imporrà a turni orario di inizio e di un agente di log dopo che corrono oltre la fine del loro turno tempo. Il valore di default è disattivato.| +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.|Questa impostazione, se impostato a 1 consentirà un manager per inserire il proprio utente e la password su un agente schermo per scavalcare le restrizioni al passaggio di un agente di sessione, se lagente sta tentando di accedere al di fuori del loro passaggio. Il valore di default è 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.|Questa impostazione consente di limitare agente login basata su turni che sono selezionati in appresso. OFF non applicare a tutti i turni. INIZIO solo applicare il login, ma non riguarda un agente che è in esecuzione sul loro passaggio, se essi sono già eseguito laccesso TUTTE imporrà a turni orario di inizio e di un agente di log dopo che corrono oltre la fine del loro turno tempo. Il valore di default è 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.|Questa impostazione determina il numero massimo di chiamate che possono essere immessi in uscita dalla selezione automatica di script sul server al secondo. Deve essere da 1 a 100. Il valore predefinito è 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.|Questa impostazione determina il numero massimo di chiamate che possono essere messi da parte lauto-fill-in uscita di selezione automatica di script per tutti i server, al secondo. Deve essere da 1 a 200. Il valore predefinito è 40.| +System Load|Sistema di carico| +Live Channels|Live Canali| +Disk Usage|Utilizzo del disco| +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.|Queste due statistiche mostrano il loadavg di un sistema di 100 volte e la percentuale di utilizzo della CPU del server e viene aggiornato ogni minuto. Il loadavg dovrebbe essere in media al di sotto di 100, moltiplicato per il numero di CPU core il sistema è, per ottenere prestazioni ottimali. La percentuale di utilizzo della CPU dovrebbe rimanere al di sotto del 50 per ottenere prestazioni ottimali.| +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.|Questo campo indica il numero attuale di Asterisk canali che sono in diretta su il sistema adesso. È importante notare che il numero di canali Asterisk è di solito molto più elevato rispetto al numero effettivo di chiamate su un sistema. Questo campo è aggiornato una volta ogni minuto.| +This field will show the disk usage for every partition on this server. This field is updated once every minute.|Questo campo mostra lutilizzo del disco per ogni partizione su questo server. Questo campo è aggiornato una volta ogni minuto.| +ADMIN CHANGE LOG|ADMIN Change Log| +USER ADMIN CHANGE LOG|Lutente admin CAMBIAMENTO LOG| +SECTION ADMIN CHANGE LOG|SEZIONE ADMIN Change Log| +DETAIL ADMIN CHANGE LOG|DETTAGLIO ADMIN Change Log| +Last 10000 records|Ultimo 10000 record| +Changes made by|Modifiche apportate dal| +Record Detail|Record Detail| +Section Records|Sezione Records| +Click here to see Admin chages to this record|Clicca qui per visualizzare Admin chages a questo record| +Click here to see Admin chages to this campaign|Clicca qui per visualizzare Admin chages a questa campagna| +Click here to see Admin chages to this list|Clicca qui per visualizzare Admin chages a questo elenco| +Click here to see Admin chages to this In-Group|Clicca qui per visualizzare Admin chages per questo gruppo di in -| +Click here to see Admin chages to this DID|Clicca qui per visualizzare Admin chages a questo DID| +Click here to see Admin chages to this remote agent|Clicca qui per visualizzare Admin chages a questo agente remoto| +Click here to see Admin chages to this user group|Clicca qui per visualizzare Admin chages a questo gruppo di utenti| +Click here to see Admin chages to this script|Clicca qui per visualizzare Admin chages a questo script| +Click here to see Admin chages to this filter|Clicca qui per visualizzare Admin chages a questo filtro| +Click here to see Admin chages to this call time|Clicca qui per visualizzare Admin chages tempo al presente invito| +Click here to see Admin chages to this shift|Clicca qui per visualizzare Admin chages a questo passaggio| +Click here to see Admin chages to this phone alias|Clicca qui per visualizzare Admin chages a questo telefono cellulare alias| +Click here to see Admin chages to this group alias|Clicca qui per visualizzare Admin chages a questo gruppo alias| +Click here to see Admin chages to this server|Clicca qui per visualizzare Admin chages a questo server| +Click here to see Admin chages to this conf template|Clicca qui per visualizzare Admin chages a questo modello di conf| +Click here to see Admin chages to this carrier|Clicca qui per visualizzare Admin chages a questo vettore| +Click here to see Admin chages to the system settings|Clicca qui per visualizzare Admin chages per le impostazioni di sistema| +Export Reports|Rapporti Export| +This setting if set to 1 will allow a manager to access the export call reports on the REPORTS screen. Default is 0.|Questa impostazione, se impostato su 1 consente di accedere a un manager di esportazione chiamata relazioni sulle relazioni schermo. Il valore di default è 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.|Questa impostazione, se impostato a 1 consentirà un manager per il download cliccare sul link elenco nella parte inferiore della schermata di modifica un elenco di esportare lintero contenuto di un elenco di file di dati di un appartamento. Il valore di default è 0.| +Export Calls Report|Esporta invita Relazione| +EXPORT CALLS REPORT|ESPORTAZIONE CHIAMATE RELAZIONE| +For the Export Calls Report, the following field order is used for exports|Per la relazione chiede di esportazione, per il seguente campo è utilizzato per le esportazioni| +Timeclock|Orologio| +Logout|Logout| +Show Users|Inserisci Utenti| +Add A New User|Aggiungere un nuovo utente| +Search For A User|Cerca un utente| +User Stats|Statistiche utente| +User Status|Status Utente| +Time Sheet|Time Sheet| +Days Status|Giorni di stato| +Campaigns Main|Campagne Main| +Statuses|Status| +HotKeys|HotKeys| +Lead Recycle|Piombo Riciclare| +Auto Alt-Dial|Auto Alt-Dial| +Auto Alt Dial|Alt Auto Dial| +List Mix|Elenco Mix| +Pause Codes|Pausa Codici| +Basic|Basic| +Detail|Dettaglio| +Survey|Indagine| +Real-Time|Real-Time| +CAMPAIGN ID|CAMPAGNA ID| +DIAL PLAN|DIAL PIANO| +DIAL METHOD|DIAL METODO| +LEADS COUNT|PORTA CONTE| +LEAD ORDER|PIOMBO PER| +DIAL STATUSES|DIAL status| +SCRIPT ID|SCRIPT ID| +SCRIPT NAME|Nome script| +USER GROUP|User Group| +GROUP NAME|NOME GRUPPO| +PRIORITY|PRIORITY| +FORCE TIMECLOCK|VIGORE orologio| +CALLTIME ID|CALLTIME ID| +CALLTIME NAME|CALLTIME NOME| +DEFAULT START|INIZIO DI MORA| +DEFAULT STOP|DEFAULT STOP| +SHIFT ID|SHIFT ID| +SHIFT NAME|SHIFT NOME| +SHIFT START|SHIFT INIZIO| +SHIFT LENGTH|SHIFT DURATA| +WEEKDAYS|SETTIMANALE| +Template ID|Template ID| +Template Name|Nome modello| +Carrier ID|Vettore ID| +Carrier Name|Nome del vettore| +Registration|Registrazione| +Active|Attivo| +USER ID|USER ID| +FULL NAME|DENOMINAZIONE COMPLETA| +LEVEL|LIVELLO| +LINKS|LINK| +TRUNKS|Bauli| +HUMAN|UMANA| +ANSWER|RISPOSTA| +CATEGORY|CATEGORIA| +STATUSES IN THIS CATEGORY|Stati in questa categoria| +Display|Visualizzare| +Dates|Date| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|Seleziona una campagna o utente GRUPPO E DATA A TEMPO E CLICCA SOPRA| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|SELEZIONA UN UTENTE E DATA A TEMPO E CLICCA SOPRA| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|SELEZIONA UNA CAMPAGNA E DATA A TEMPO E CLICCA SOPRA| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia| +DOWNLOAD|DOWNLOAD| +Users|Utenti| +User|Utente| +Reports|Rapporti| +OUTBOUND|OUTBOUND| +INBOUND|INBOUND| +Server Stats and Reports|Server Statistiche e rapporti| +Click here to see a VDAD report for this campaign|Clicca qui per vedere un VDAD relazione per questa campagna| +Show DIDs|Visualizza DIDs| +Add A New DID|Aggiungi un nuovo DID| +Templates|Modelli| +Carriers|Vettori| +Carrier Name|Nome del vettore| +Click here to see all CallBack Holds in this user group|Clicca qui per vedere tutte le CallBack Prese in questo gruppo di utenti| +Click here to see all CallBack Holds in this list|Clicca qui per vedere tutte le CallBack Prese in questo elenco| +Click here to see a report for this inbound group|Clicca qui per vedere una relazione di questo gruppo in entrata| +Click here to Synchronize users with Vtiger|Clicca qui per sincronizzare gli utenti con Vtiger| +Alert Enabled|Alert Attivato| +Change Date|Cambia Data| +Login Date|Login Data| +List Last Call Date|Elenco Last Call Data| +Phone Code Override|Telefono Codice Sovrascrive| +GROUP ALIAS ID|GRUPPO ALIAS ID| +GROUP ALIAS NAME|ALIAS NOME GRUPPO| +CID NUMBER|CID NUMERO| +CID NAME|CID NOME| +PHONE ALIAS|TELEFONO ALIAS| +ALIAS ID|ALIAS ID| +ALIAS NAME|ALIAS NOME| +PHONE LOGINS LIST|Login ELENCO TELEFONICO| +Shift Length|Maiusc Lunghezza| +short description of the shift|breve descrizione del turno| +DELETE THIS SERVER|CANCELLA QUESTO SERVER| +DELETE THIS CONFERENCE|Elimina questo CONFERENZA| +DELETE THIS VICIDIAL CONFERENCE|Elimina questo VICIDIAL CONFERENZA| +Install Date|Installare Data| +Human Answer|Umani Risposta| +STATUS CATEGORIES|Status CATEGORIE| +per campaign|per campagna| +all campaigns|tutte le campagne| diff --git a/translations/pl_language.txt b/translations/pl_language.txt index 629bb89b..629bb8ba 100644 --- a/translations/pl_language.txt +++ b/translations/pl_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"STY"| @@ -429,3 +429,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|WY MUSICIE WCHODZI ENTER A PAUSE CODE|WCHODZĄ SZYFR PRZERWY| YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|WY MUSICIE BYĆ PRZEDŁUŻANI WCHODZIĆ SZYFR PRZERWY W TRYBIE AUTOTARCZY| Your session has been disabled|Wasza sesja była uszkadzana| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Płeć:| +Date of Birth: |Data urodzenia:| +YOU MUST BE PAUSED TO CHANGE GROUPS|Musisz być Paused ZMIANA DO GRUPY| +Calls in Queue:|Wzywa w kolejce:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|Użytkownika i hasło podane nie są aktywne w systemie| +Please try again|Please try again| +You cannot log in or out within 30 seconds of your last login or logout|Nie można zalogować się w ciągu 30 sekund od ostatniego logowania lub wylogowywania| +You have now logged-out|Musisz się zalogować-out| +You logged out at |Możesz zalogować się na| +Amount of time you were logged-in: |Czas był zalogowany w:| +ERROR: timeclock log entry already made: |ERROR: timeclock wpisu już wykonane:| +BACK to Agent Login Screen|POWRÓT pełnomocnika do ekranu logowania| +BACK to Administration|POWRÓT do administracji| +BACK to Welcome Screen|Powrót do ekranu powitalnego| +Time since you were last logged-in: |Czas od twojego ostatniego logowania w:| +You last logged-out at: |Ostatniego zalogowanego obecnie pod adresem:| +Click LOGIN below to log-in|Kliknij poniżej, aby LOGOWANIE log-in| +Amount of time you have been logged-in: |Kwota czas były rejestrowane w:| +You logged-in at:|Możesz zalogować się na stronie:| +Click LOGOUT below to log-out|Kliknij poniżej, aby zalogować LOGOUT-out| +Undefined|Niezdefiniowana| +This phone number is not in the campaign lists|Ten telefon nie jest w kampanii list| +Unspecified error|Nieokreślony błąd| +Extended Alt Phone Information: |Rozszerzony Alt telefonu:| +ALT DIAL NUMBER:|ALT DIAL NUMBER:| +Phone Code and Number:|Telefon Kod i numer:| +Notes: |Uwagi:| +Active: |Aktywne:| +Alt Count: |Alt Count:| +Change this phone number to INACTIVE|Zmień to numer telefonu do nieaktywne| +Change this phone number to ACTIVE|Zmień to numer telefonu do CZYNNEJ| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|Należy zalogować się do TIMECLOCK PIERWSZEJ| +There is a time synchronization problem with your system, please tell your system administrator|Istnieje problem synchronizacji czasu z systemem, należy powiadomić administratora systemu| +Preview Call|Podgląd połączeń| +SELECT A GROUP ALIAS|Wybierz grupę Alias| +Group Alias Selection|Wybór grupy Alias| +Click Here to Choose a Group Alias|Kliknij tutaj, aby wybrać grupy Alias| +Group Alias|Nazwa grupy| +ERROR: There are no Shifts enabled for your user group|BŁĄD: Brak Przesuwa aktywny dla grupy użytkowników| +ERROR: You are not allowed to log in outside of your shift|BŁĄD: Nie masz uprawnień, aby zalogować się poza swoim zmiany| +MANAGER OVERRIDE|KIEROWNIK nadrzędne| +Your Shift is over or has changed, you have been logged out of your session|Twoja Shift jest ponad lub zmienił, zostałeś wylogowany z sesji| diff --git a/translations/pt_language.txt b/translations/pt_language.txt index f7ee04fa..ecadf8a4 100644 --- a/translations/pt_language.txt +++ b/translations/pt_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"JAN"| @@ -367,7 +367,7 @@ Invalid|Inválido| Username|Username| CUSTOM|COSTUME| Notes|Notas| -First|Primeiramente| +First|Prime| MI: |Mi:| Last|Último| Address|Endereço| @@ -429,3 +429,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|VOCÊ DEVE DAR ENTR 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| +### 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| +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 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:| +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| diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index 2463da45..e3ff6293 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -554,6 +554,82 @@ This setting if set to 1 will allow a manager to click on the download list link Export Calls Report|| EXPORT CALLS REPORT|| For the Export Calls Report, the following field order is used for exports|| +Timeclock|| +Logout|| +Show Users|| +Add A New User|| +Search For A User|| +User Stats|| +User Status|| +Time Sheet|| +Days Status|| +Campaigns Main|| +Statuses|| +HotKeys|| +Lead Recycle|| +Auto Alt-Dial|| +Auto Alt Dial|| +List Mix|| +Pause Codes|| +Basic|| +Detail|| +Survey|| +Real-Time|| +CAMPAIGN ID|| +DIAL PLAN|| +DIAL METHOD|| +LEADS COUNT|| +LEAD ORDER|| +DIAL STATUSES|| +SCRIPT ID|| +SCRIPT NAME|| +USER GROUP|| +GROUP NAME|| +PRIORITY|| +FORCE TIMECLOCK|| +CALLTIME ID|| +CALLTIME NAME|| +DEFAULT START|| +DEFAULT STOP|| +SHIFT ID|| +SHIFT NAME|| +SHIFT START|| +SHIFT LENGTH|| +WEEKDAYS|| +Template ID|| +Template Name|| +Carrier ID|| +Carrier Name|| +Registration|| +Active|| +USER ID|| +FULL NAME|| +LEVEL|| +LINKS|| +TRUNKS|| +HUMAN|| +ANSWER|| +CATEGORY|| +STATUSES IN THIS CATEGORY|| +Display|| +Dates|| +PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK|| +PLEASE SELECT A USER AND DATE-TIME ABOVE AND CLICK|| +PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK|| +PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT|| +DOWNLOAD|| +Users|| +User|| +Reports|| +OUTBOUND|| +INBOUND|| +Server Stats and Reports|| +Click here to see a VDAD report for this campaign|| +Show DIDs|| +Add A New DID|| +Templates|| +Carriers|| +Carrier Name|| ############################################################ CLIENT diff --git a/translations/sk_language.txt b/translations/sk_language.txt index 75a62975..31705739 100644 --- a/translations/sk_language.txt +++ b/translations/sk_language.txt @@ -20,7 +20,7 @@ agc|live_exten_check.php|0 agc|call_log_display.php|0 agc|voicemail_check.php|0 agc|dbconnect.php|1 -agc|htglobalize.php|1 +agc|timeclock.php|0 ***TRANSLATIONS*** ### special translations that should stay at the top of the file ### "JAN"|"JAN"| @@ -375,9 +375,9 @@ City|Mesto| State|Štát| PostCode|PSČ| Province|Kraj| -Vendor ID|zákaznícke ID| +Vendor ID|zákaznícke| DialCode|Volací kód| -Alt. Phone|Alternatívne číslo| +Alt. Phone|Alter. číslo| Show|Prezrieť| Email|Email| Comments|Komentár| @@ -429,3 +429,47 @@ YOU MUST ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|MUSÍTE VLOŽIŤ Č ENTER A PAUSE CODE|VLOŽIŤ KÓD PAUZY| YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE|MUSÍTE BYŤ V PAUZE NA VLOŽENIE KÓDU PAUZY V MÓDE AUTO-DIAL| Your session has been disabled|Vaša relácia bola ukončená| +### BEGIN translation phrases for 2.0.5 release ### +Gender: |Pohlavie:| +Date of Birth: |Dátum narodenia:| +YOU MUST BE PAUSED TO CHANGE GROUPS|Musíte byť pozastavené NA ZMENU ZOSKUPENIA| +Calls in Queue:|Hovory v Queue:| + Timeclock|Timeclock| +The user and password you entered are not active in the system|Užívateľa a heslo, ktoré ste zadali, nie sú aktívne v systéme| +Please try again|Prosím, skúste to znova| +You cannot log in or out within 30 seconds of your last login or logout|Nemôžete sa prihlásiť alebo sa do 30 sekúnd od vášho posledného prihlásenia alebo odhlásenie| +You have now logged-out|Teraz ste prihlásený-out| +You logged out at |Ste odhlásený na| +Amount of time you were logged-in: |Množstvo času, ste prihlásený-in:| +ERROR: timeclock log entry already made: |ERROR: timeclock log vstupe už bolo dosiahnuté:| +BACK to Agent Login Screen|SPÄŤ na Agent Prihlásiť obrazovky| +BACK to Administration|SPÄŤ na administratívne| +BACK to Welcome Screen|SPÄŤ na úvodnú obrazovku| +Time since you were last logged-in: |Čas od Vášho posledného prihlásenia-in:| +You last logged-out at: |Ty posledný prihlásený-out na:| +Click LOGIN below to log-in|Kliknite nižšie k LOGIN LOG-IN| +Amount of time you have been logged-in: |Množstvo času, ktoré ste vykáceli-in:| +You logged-in at:|Ste prihlásený-in na adrese:| +Click LOGOUT below to log-out|Kliknite na Logout nižšie log-out| +Undefined|Undefined| +This phone number is not in the campaign lists|Tento telefón nie je v kampani zoznamy| +Unspecified error|Nešpecifikovaná chyba| +Extended Alt Phone Information: |Rozšírená Alt Telefón Informácie:| +ALT DIAL NUMBER:|ALT DIAL číslo:| +Phone Code and Number:|Telefón Kód a číslo:| +Notes: |Poznámky:| +Active: |Aktívne:| +Alt Count: |Alt Count:| +Change this phone number to INACTIVE|Zmeniť toto telefónne číslo k NEAKTÍVNYCH| +Change this phone number to ACTIVE|Zmeniť toto telefónne číslo k aktívnemu| +YOU MUST LOG IN TO THE TIMECLOCK FIRST|Musíte sa prihlásiť do TIMECLOCK PRVEJ| +There is a time synchronization problem with your system, please tell your system administrator|Je synchronizácia času problém s vašim systémom, povedzte to, prosím, správcu systému| +Preview Call|Náhľad Výzva| +SELECT A GROUP ALIAS|VYBER GROUP ALIAS| +Group Alias Selection|Skupina Alias Výber| +Click Here to Choose a Group Alias|Kliknite tu pre Zvoliť skupinu Alias| +Group Alias|Skupina Alias| +ERROR: There are no Shifts enabled for your user group|ERROR: Nie sú k dispozícii žiadne Posuvy povolený pre užívateľské skupiny| +ERROR: You are not allowed to log in outside of your shift|ERROR: Nemáte možnosť prihlásiť sa mimo vašej smeny| +MANAGER OVERRIDE|MANAGER prepísať| +Your Shift is over or has changed, you have been logged out of your session|Vaša Shift je nad alebo sa zmenilo, ste boli odhlásený vašej relácie| diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index e83deb4f..27caa82b 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -7965,7 +7965,7 @@ if ($ADD==23111111111) {echo "
GROUP ALIAS NOT ADDED - there is already a Phone Alias in the system with this ID\n";} else { - if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",'',$group_alias_id)) + if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id)) {echo "
GROUP ALIAS NOT ADDED - you cannot use reserved words in group aliases\n";} else { @@ -18942,8 +18942,8 @@ if ($ADD==10000000) echo "
LEAD FILTER LISTINGS:\n"; echo "
\n"; echo ""; - $stmt="SELECT * from vicidial_conferences order by conf_exten"; + $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); + $vicidialconf_to_print = mysql_num_rows($rslt); -echo "
ELENCO CONFERENZE:\n"; -echo "
\n"; + echo "
VICIDIAL ELENCO CONFERENZE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; $o=0; - while ($phones_to_print > $o) { + while ($vicidialconf_to_print > $o) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16443,124 +19423,466 @@ echo "
CONFERENCESERVER IPINTERNOMODIFICA
\n"; {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; - echo ""; - echo "\n"; + echo ""; + echo "\n"; $o++; + } + + echo "
$row[0] $row[1] $row[2]$row[4]  MODIFICA
$row[2]MODIFICA
\n"; + } + + + + + +###################### +# ADD=700000000000000 view all activity in the admin log +###################### + +if ($ADD==700000000000000) + { + echo "\n";echo "\n"; +$stmt="SELECT admin_home_url from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$admin_home_url_LU = $row[0]; + +?> +
+ + +
\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 "
ADMIN Change Log: (Ultimo 10000 record)\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('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 "NEXT\n"; + echo "
\n"; + } + + +###################### +# ADD=710000000000000 view all activity in the admin log made by one user +###################### + +if ($ADD==710000000000000) + { + echo "\n"; +echo "
\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 "
ADMIN Change Log: Modifiche apportate dal $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('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"; + } + + +###################### +# ADD=720000000000000 view all activity in the admin log made to one section/value +###################### + +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) + { + $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"; + } + + +###################### +# ADD=730000000000000 detail view of one admin log entry +###################### + +if ($ADD==730000000000000) + { + 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]); + 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"; -} ###################### # ADD=999999 display reports section ###################### if ($ADD==999999) -{ - if ($LOGview_reports==1) { - echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - - $stmt="select * from servers;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $servers_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $servers_to_print) + 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;"; + $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); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } + $queuemetrics_url_LU = $row[0]; + $vtiger_url_LU = $row[1]; - $stmt="SELECT enable_queuemetrics_logging,queuemetrics_url from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $enable_queuemetrics_logging_LU = $row[0]; - $queuemetrics_url_LU = $row[1]; + ?> + + + + + VICIDIAL: Statistiche e Report + VICIDIAL: Statistiche e Report

+
\n"; + } else - { - echo "Non hai l`autorizzazione per accedere a questa pagina\n"; - exit; + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } } -} +echo "
\n"; echo "
\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n


\n
\n"; - - -echo "\n\n\n


\nTempo Esecuzione Script: $RUNtime seconds"; -echo "                   VERSIONE: $admin_version"; -echo "                   BUILD: $build
\n"; - +echo "
\n"; +echo "

"; +echo "VERSIONE: $admin_version
"; +echo "BUILD: $build
\n"; ?> - +
@@ -16664,7 +19986,7 @@ if (isset($camp_lists)) $state_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday ora locale + if ($GMT_day[$r]==0) #### Domenica ora locale { if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) { @@ -16677,7 +19999,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday ora locale + if ($GMT_day[$r]==1) #### Lunedi ora locale { if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) { @@ -16690,7 +20012,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday ora locale + if ($GMT_day[$r]==2) #### Martedì ora locale { if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) { @@ -16703,7 +20025,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday ora locale + if ($GMT_day[$r]==3) #### Mercoledì ora locale { if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) { @@ -16716,7 +20038,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday ora locale + if ($GMT_day[$r]==4) #### Giovedi ora locale { if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) { @@ -16729,7 +20051,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday ora locale + if ($GMT_day[$r]==5) #### Venerdì ora locale { if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) { @@ -16742,7 +20064,7 @@ if (isset($camp_lists)) {$state_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday ora locale + if ($GMT_day[$r]==6) #### Sabato ora locale { if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) { @@ -16777,7 +20099,7 @@ if (isset($camp_lists)) $default_gmt=''; while($r < $g) { - if ($GMT_day[$r]==0) #### Sunday ora locale + if ($GMT_day[$r]==0) #### Domenica ora locale { if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) { @@ -16790,7 +20112,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==1) #### Monday ora locale + if ($GMT_day[$r]==1) #### Lunedi ora locale { if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) { @@ -16803,7 +20125,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==2) #### Tuesday ora locale + if ($GMT_day[$r]==2) #### Martedì ora locale { if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) { @@ -16816,7 +20138,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==3) #### Wednesday ora locale + if ($GMT_day[$r]==3) #### Mercoledì ora locale { if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) { @@ -16829,7 +20151,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==4) #### Thursday ora locale + if ($GMT_day[$r]==4) #### Giovedi ora locale { if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) { @@ -16842,7 +20164,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==5) #### Friday ora locale + if ($GMT_day[$r]==5) #### Venerdì ora locale { if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) { @@ -16855,7 +20177,7 @@ if (isset($camp_lists)) {$default_gmt.="'$GMT_gmt[$r]',";} } } - if ($GMT_day[$r]==6) #### Saturday ora locale + if ($GMT_day[$r]==6) #### Sabato ora locale { if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) { diff --git a/LANG_www/vicidial_it/admin_header.php b/LANG_www/vicidial_it/admin_header.php new file mode 100644 index 00000000..8cf52091 --- /dev/null +++ b/LANG_www/vicidial_it/admin_header.php @@ -0,0 +1,932 @@ + LICENSE: AGPLv2 +# + +# CHANGES +# 90310-0709 - First Build + + +######################### SMALL HTML HEADER BEGIN ####################################### +if($short_header) + { + ?> +
+ + + + + + + + + + + + +
    Utenti     Campagnas     Liste     Script     Filtri     In-Groups     Gruppi Utenti     Operatori Remoti     Admin     Rapporti  
+ 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 Italiano
+ +
+VICIDIAL logo +ADMINISTRATION
+ + + + 1) { + ?> + >>>>>>> + + + + 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) { + ?> + >>>>> + + + + 1) + { + ?> + >> + + + 0) + { + ?> + + 1) + { + ?> + >> + + + + 1) + { + ?> + >>>>>> + + + + 1) + { + ?> + >>>> + + + + 1) + { + ?> + >> + + + + 1) + { + if ($sh=='times') {$times_sh="bgcolor=\"$times_color\""; $times_fc="$times_font";} # pink + else {$times_sh=''; $times_fc='BLACK';} + if ($sh=='shifts') {$shifts_sh="bgcolor=\"$shifts_color\""; $shifts_fc="$shifts_font";} # pink + else {$shifts_sh=''; $shifts_fc='BLACK';} + if ($sh=='templates') {$templates_sh="bgcolor=\"$templates_color\""; $templates_fc="$templates_font";} # pink + else {$templates_sh=''; $templates_fc='BLACK';} + if ($sh=='carriers') {$carriers_sh="bgcolor=\"$carriers_color\""; $carriers_fc="$carriers_font";} # pink + else {$carriers_sh=''; $carriers_fc='BLACK';} + if ($sh=='phones') {$phones_sh="bgcolor=\"$server_color\""; $phones_fc="$phones_font";} # pink + else {$phones_sh=''; $phones_fc='BLACK';} + if ($sh=='server') {$server_sh="bgcolor=\"$server_color\""; $server_fc="$server_font";} # pink + else {$server_sh=''; $server_fc='BLACK';} + if ($sh=='conference') {$conference_sh="bgcolor=\"$server_color\""; $conference_fc="$server_font";} # pink + else {$conference_sh=''; $conference_fc='BLACK';} + if ($sh=='settings') {$settings_sh="bgcolor=\"$settings_color\""; $settings_fc="$settings_font";} # pink + else {$settings_sh=''; $settings_fc='BLACK';} + if ($sh=='status') {$status_sh="bgcolor=\"$status_color\""; $status_fc="$status_font";} # pink + else {$status_sh=''; $status_fc='BLACK';} + + ?> + > + + > + > + > + > + > + > + > + > + + + + +
WIDTH=160> + SIZE=>Utenti +
+   >Inserisci Utenti +
+   >Aggiungere un nuovo utente +
+   >Copia Utente +
+   >Cerca un utente +
+   >Statistiche utente +
+   >Status Utente +
+   >Time Sheet
> + SIZE=>Campagnas +
>   SIZE=>Campagne Main
>   SIZE=>Esiti
>   SIZE=>Hot-Key
>   SIZE=>Piombo Riciclare
>   SIZE=>Auto-Alt Dial
>   SIZE=>Elenco Mix
>   SIZE=>Codici Pausa
> SIZE=>Liste
  + > Visualizza Liste +
  + > Nuova Lista +
  + > Ricerca Contatti +
  + > Aggiungi Numero Alla Lista DNC +
  + > Carica Nuovi Contatti +
> + SIZE=> Script +
  + > Visualizza Script +
  + > Aggiungi Nuovo Script +
> SIZE=> Filtri
  + > Visualizza Filtri +
  + > Aggiungi Nuovo Filtro +
> + SIZE=> Gruppi Inbound +
  + > Visualizza Gruppi Inbound +
  + > Aggiungi Gruppo Inbound +
  + > Copia Gruppo Inbound +
  + > Visualizza DIDs +
  + > Aggiungi un nuovo DID +
  + > CopiaDID +
> + SIZE=> Gruppi Utenti +
  + > Visualizza Gruppi Utenti +
  + >Aggiungi Nuovo Gruppo Utente +
  + > Report Orario Per Gruppo +
  + > Bulk Gruppo Cambia +
> + SIZE=> Operatori Remoti +
  + > Visualizza Operatori Remoti +
  + >Aggiungi Operatore Remoto +
> + SIZE=> Admin +
COLSPAN=2>   + SIZE=> Orari Chiamata
>   + SIZE=> Turni
>   + SIZE=> Telefoni
>   + SIZE=> Modelli
>   + SIZE=> Vettori
>   + SIZE=> Server
>   + SIZE=> Conferencias
>   + SIZE=> Impostazioni di Sistema
>   + SIZE=> Esiti di Default
> + SIZE=> Report +
+
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) { + ?> + > + 1) and (!eregi('campaign',$hh) ) ) { + ?> + > + + > + \n"; + echo "Le no autorizan a visio`n esta página. Vaya por favor detrás.\n"; + } + +if (strlen($reports_hh) > 1) { + ?> +> + + + + +"; $agent_log .= ""; $agent_log .= "\n"; - $agent_log .= "\n"; + $agent_log .= "\n"; $agent_log .= "\n"; $agent_log .= "\n"; $agent_log .= "\n"; @@ -530,9 +540,9 @@ else echo "(with $log_campaign statuses)\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -565,7 +575,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UtenteID: \n"; echo "
\n"; } else @@ -575,7 +585,7 @@ else echo "\n"; echo "\n"; echo "\n"; - echo "New Callback Owner UserID: \n"; + echo "New Callback Owner UtenteID: \n"; echo "
\n"; } } @@ -636,9 +646,9 @@ echo "RECORDINGS FOR THIS LEAD:\n"; echo "
HOME | Orologio | Logout  
>   > Visualizza Campagne     |     > Aggiungi Nuova Campagna     |     > Copia Campagna     |     > Riepilogo Campagne In Tempo Reale
  > Elenca Orari Chiamata  | > Nuovo Orario Chiamate  | > Elenca Orari Chiamata Per Stati  | > Nuovo Orario Chiamate Per Stato
  > Mostra cambiamenti  | > Aggiungi un nuovo Shift
  > Visualizza Telefoni  | > Aggiungi Un Nuovo Telefono  | > Telefono Alias Elenco  | > Aggiungi un nuovo telefono Alias  | > Gruppo Alias Elenco  | > Aggiungere un nuovo gruppo Alias
  >Visualizza Conferenze   |   > Aggiungi Conferenza   |   > Visualizza Conferenze VICIDIAL   |   > Aggiungi Conferenza VICIDIAL
  > Visualizza Server   |   > Aggiungi Un Nuovo Server
  > Visualizza modelli   |   > Aggiungi un nuovo modello
  > Show Vettori   |   > Add A New Carrier
  > Impostazioni di Sistema
  > Esiti di Default   |   > Categorie di esiti   |   >Codici di stato, QC
  >Statistiche utente   |   >Status Utente   |   >Time Sheet   |   >Giorni di stato
>  
+ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -27,6 +27,8 @@ # 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 # require("dbconnect.php"); @@ -170,7 +172,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -222,6 +224,14 @@ if ($end_call > 0) echo "informazione modificata

\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 @@ -380,7 +390,7 @@ else $agent_log .= "
$y$row[3] $row[5] $row[1] $row[1] $row[7] $row[9] $row[11]
Modify vicidial log
Modify agent log
Modify closer log
Modificarevicidial log
Modificareagent log
Modificarecloser log
Add closer log record
\n"; echo "\n"; - $stmt="select * 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); +$stmt="select * 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); $u=0; while ($logs_to_print > $u) @@ -650,6 +660,30 @@ echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD2) + { + $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 diff --git a/LANG_www/vicidial_it/admin_search_lead.php b/LANG_www/vicidial_it/admin_search_lead.php index 7f08c8c1..0efbf4e5 100644 --- a/LANG_www/vicidial_it/admin_search_lead.php +++ b/LANG_www/vicidial_it/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -15,6 +15,9 @@ # - 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 # require("dbconnect.php"); @@ -43,6 +46,7 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} $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); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -66,7 +70,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -102,13 +106,35 @@ $browser = getenv("HTTP_USER_AGENT"); -VICIDIAL ADMIN: Ricerca Contatti - -Operaciones de búsqueda del Lead - - +VICIDIAL ADMIN: Ricerca Contatti <? -echo "<a href=\"./admin.php?ADD=100\">VICIDIAL ADMIN</a>: Lead search<BR>\n"; + +##### 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<BR>\n"; if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) )) @@ -218,6 +244,7 @@ else { $row=mysql_fetch_row($rslt); $o++; + $search_lead = $row[0]; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else @@ -233,11 +260,19 @@ else 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[2]</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 MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } diff --git a/LANG_www/vicidial_it/call_report_export.php b/LANG_www/vicidial_it/call_report_export.php new file mode 100644 index 00000000..6e0b5f0d --- /dev/null +++ b/LANG_www/vicidial_it/call_report_export.php @@ -0,0 +1,513 @@ +<? +# 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) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90310-2247 - First build +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Utentename/Password non validi 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"; + exit; + } + + + if ($RUNcampaign > 0) + { + $export_campaign_rows=''; + $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 from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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); + + $export_campaign_rows .= "$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]\r\n"; + $i++; + } + } + } + + if ($RUNgroup > 0) + { + $export_group_rows=''; + $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 from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date' and vl.call_date <= '$end_date' 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) + { + 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); + + $export_group_rows .= "$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]\r\n"; + $i++; + } + } + } + + + 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 ESPORTAZIONE CHIAMATE RELAZIONE', 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(); + + echo "$export_campaign_rows$export_group_rows"; + } + 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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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;"; + $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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + echo "<TITLE>VICIDIAL: Esporta invita Relazione"; + + ##### 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>Esporta invita Relazione</B></FONT><BR><BR>\n"; + echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\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:</B></font><BR><CENTER>\n"; + echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; + echo "<BR>to<BR>\n"; + echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; + + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; + echo "<font class=\"select_bold\"><B>Campagnas:</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>Gruppi Inbound:</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>Liste:</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>Esiti:</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>Gruppi Utenti:</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=INVIA VALUE=INVIA>\n"; + echo "</TD></TR></TABLE>\n"; + echo "</FORM>\n\n"; + + } +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_it/fcstats.php b/LANG_www/vicidial_it/fcstats.php new file mode 100644 index 00000000..9f04f641 --- /dev/null +++ b/LANG_www/vicidial_it/fcstats.php @@ -0,0 +1,600 @@ +<? +# fcstats.php +# +# Copyright (C) 2009 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 +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +$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 "Utentename/Password non validi: |$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;"; +$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> + +<? +echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; +echo "<TITLE>VICIDIAL: In-Group Fronter-Closer Stats\n"; + + $short_header=1; + + require("admin_header.php"); + +echo "
"; + +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "           MODIFICA | REPORT \n"; +echo "
\n\n"; + +echo "
\n\n";
+
+
+if (!$group)
+{
+echo "\n\n";
+echo "PLEASE SELECT AN IN-GROUP AND DATE ABOVE THEN CLICK INVIA\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 "VICIDIAL: In-Group Fronter-Closer Stats                      $NOW_TIME\n";
+
+echo "\n";
+echo "---------- TOTALI 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 "| AGENT                    |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 "| AGENT                    | 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/LANG_www/vicidial_it/group_hourly_stats.php b/LANG_www/vicidial_it/group_hourly_stats.php index 85a19448..15990dfd 100644 --- a/LANG_www/vicidial_it/group_hourly_stats.php +++ b/LANG_www/vicidial_it/group_hourly_stats.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell 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 # require("dbconnect.php"); @@ -38,7 +39,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } @@ -67,7 +68,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -104,14 +105,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL ADMIN: Statistiche Orarie Del Gruppo + +VICIDIAL ADMIN: Statistiche Orarie Del Gruppo <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + +##### 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"); + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> + + <CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php?ADD=100000\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: Statistiche Orarie Del Gruppo <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   Statistiche Orarie Del Gruppo <? echo $group ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> @@ -234,7 +256,7 @@ echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds ?> -</TD></TR><TABLE> +</TD></TR></TABLE> </body> </html> diff --git a/LANG_www/vicidial_it/list_download.php b/LANG_www/vicidial_it/list_download.php new file mode 100644 index 00000000..90fb0ed5 --- /dev/null +++ b/LANG_www/vicidial_it/list_download.php @@ -0,0 +1,130 @@ +<? +# list_download.php +# +# downloads the entire contents of a vicidial list ID to a flat text file +# that is tab delimited +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 90209-1310 - First build +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +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); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $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 > 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 "Utentename/Password non validi 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 * 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); + + 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]\r\n"; + + $i++; + } + +exit; + +?> \ No newline at end of file diff --git a/LANG_www/vicidial_it/listloaderMAIN.php b/LANG_www/vicidial_it/listloaderMAIN.php index f76f8e85..bf86a0c8 100644 --- a/LANG_www/vicidial_it/listloaderMAIN.php +++ b/LANG_www/vicidial_it/listloaderMAIN.php @@ -40,7 +40,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else diff --git a/LANG_www/vicidial_it/new_listloader_superL.php b/LANG_www/vicidial_it/new_listloader_superL.php index c6bb87d7..1abdfb9d 100644 --- a/LANG_www/vicidial_it/new_listloader_superL.php +++ b/LANG_www/vicidial_it/new_listloader_superL.php @@ -1,7 +1,7 @@ <? # new_listloader_superL.php # -# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # # AST GUI lead loader from formatted file # @@ -23,11 +23,13 @@ # 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 # # 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.0.5-27'; -$build = '81011-2009'; +$version = '2.0.5-29'; +$build = '90310-2128'; require("dbconnect.php"); @@ -162,7 +164,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -317,7 +319,17 @@ function ParseFileName() { </script> <title>VICIDIAL ADMIN: Lead Loader - + + +
"; +?> + +
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> @@ -793,6 +805,12 @@ function ParseFileName() { 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='LISTE', 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 ""; @@ -1518,17 +1536,17 @@ $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";} + if ($DBX) {print " Second Domenica March to First Domenica 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. + # Based on Second Domenica March to First Domenica 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) + # dow INTEGER Day of week (0=Domenica, to 6=Sabato) # OPTIONAL INPUT: # timezone INTEGER hour difference UTC - local standard time # (DEFAULT is blank) @@ -1614,12 +1632,12 @@ if ( (!$AC_processed) and ($dst_range == 'SSM-FSN') ) if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} + if ($DBX) {print " First Domenica April to Last Domenica 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. + # Based on first Domenica in April and last Domenica in October at 2 am. #********************************************************************** $USA_DST=0; @@ -1683,11 +1701,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + if ($DBX) {print " Last Domenica March to Last Domenica 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. + # Based on last Domenica in March and last Domenica in October at 1 am. #********************************************************************** $GBR_DST=0; @@ -1751,11 +1769,11 @@ if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) } if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + if ($DBX) {print " Last Domenica October to Last Domenica 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. + # Based on last Domenica in October and last Domenica in March at 1 am. #********************************************************************** $AUS_DST=0; @@ -1820,12 +1838,12 @@ if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} + if ($DBX) {print " First Domenica October to Last Domenica 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. + # Based on first Domenica in October and last Domenica in March at 1 am. #********************************************************************** $AUST_DST=0; @@ -1887,11 +1905,11 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) } if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} + if ($DBX) {print " First Domenica October to Third Domenica 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. + # Based on first Domenica in October and third Domenica in March at 1 am. #********************************************************************** $NZL_DST=0; @@ -1954,12 +1972,12 @@ if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) if ( (!$AC_processed) and ($dst_range == 'TSO-LSF') ) { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + if ($DBX) {print " Third Domenica October to Last Domenica 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. + # Based on Third Domenica October to Last Domenica February at 1 am. #********************************************************************** $BZL_DST=0; @@ -2033,3 +2051,4 @@ return $gmt_offset; } ?> +
diff --git a/LANG_www/vicidial_it/non_agent_api.php b/LANG_www/vicidial_it/non_agent_api.php new file mode 100644 index 00000000..2d525f39 --- /dev/null +++ b/LANG_www/vicidial_it/non_agent_api.php @@ -0,0 +1,1419 @@ + 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 +# + +$version = '2.0.5-5'; +$build = '90118-1056'; + +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"];} + + +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); +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) + { + $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); + } + +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';} + +$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; + } + + + + +################################################################################ +### 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';"; + if ($DB) {echo "|$stmt|\n";} + $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 + { + if ($dnc_check == 'Y') + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; + if ($DB) {echo "|$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') + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';"; + if ($DB) {echo "|$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; + } + } + + ### 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';"; + if ($DB) {echo "$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) {echo "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) {echo "$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;"; + if ($DB) {echo "|$stmt|\n";} + $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) {echo "$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; + } + } + + + +$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 * 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 * 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 * 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 * 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 * 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-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 == '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 * 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 * 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/LANG_www/vicidial_it/remote_dispo.php b/LANG_www/vicidial_it/remote_dispo.php index 86a988be..ad839a8a 100644 --- a/LANG_www/vicidial_it/remote_dispo.php +++ b/LANG_www/vicidial_it/remote_dispo.php @@ -129,7 +129,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else diff --git a/LANG_www/vicidial_it/timeclock_edit.php b/LANG_www/vicidial_it/timeclock_edit.php new file mode 100644 index 00000000..fc5db5f6 --- /dev/null +++ b/LANG_www/vicidial_it/timeclock_edit.php @@ -0,0 +1,478 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 80624-1342 - First build +# 80701-1323 - functional beta version done +# 90310-2109 - Added admin header +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Utentename/Password non validi: |$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; + } + } + + + +?> + + + +VICIDIAL ADMIN: Orologio Modifica record +<? + +##### 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>Orologio Modifica record for <? echo $user ?></TD><TD ALIGN=RIGHT>   </TD></TR> + +<? + +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 "ERRORI Si è verificato un problema con i dati che hai inserito, si prega di tornare indietro<BR>\n"; + echo "Un orologio di sessione non può sovrapporsi di un altro orologio sessione<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 "ERRORI Si è verificato un problema con i dati che hai inserito, si prega di tornare indietro<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>Utente Gruppo: </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>Utente Gruppo: </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=INVIA 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\">VICIDIAL Time Sheet</a>\n"; +echo " - <a href=\"./user_stats.php?user=$user\">Statistiche utente</a>\n"; +echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</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>\nTempo Esecuzione Script: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +} +else +{ + +echo "ERROR! You cannot edit this timeclock record: $timeclock_id\n"; +} +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_it/timeclock_report.php b/LANG_www/vicidial_it/timeclock_report.php new file mode 100644 index 00000000..34b34f1b --- /dev/null +++ b/LANG_www/vicidial_it/timeclock_report.php @@ -0,0 +1,359 @@ +<? +# timeclock_report.php +# +# Copyright (C) 2009 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 +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +if (strlen($shift)<2) {$shift='ALL';} +if (strlen($order)<2) {$order='hours_down';} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Utentename/Password non validi: |$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;"; +$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> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> +<TITLE>VICIDIAL: UtenteOrologio Report + +<? + +##### 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>\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>Date:</B></font><BR><CENTER>\n"; +echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">"; +echo "<BR>to<BR>\n"; +echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n"; +echo "</TD><TD ALIGN=LEFT VALIGN=TOP>\n"; +echo "<font class=\"select_bold\"><B>Gruppi Utenti:</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>Utente:</B></font><BR>\n"; +echo "<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n"; + +echo "<BR><BR><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\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\">REPORT</a> </FONT>\n"; + +echo "</TD></TR></TABLE>\n"; +echo "</FORM>\n\n"; + +echo "<PRE><FONT SIZE=3>\n"; + + +echo "VICIDIAL: UtenteOrologio Report $NOW_TIME\n"; + +echo "Intervallo Di Tempo: $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\">TOTALI</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/LANG_www/vicidial_it/timeclock_status.php b/LANG_www/vicidial_it/timeclock_status.php new file mode 100644 index 00000000..3c42355d --- /dev/null +++ b/LANG_www/vicidial_it/timeclock_status.php @@ -0,0 +1,548 @@ +<? +# timeclock_status.php +# +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# +# 80602-0201 - First Build +# 80603-1500 - formatting changes +# 90310-2103 - Added admin header +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day 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]; + $timeclock_end_of_day = $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"); +$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 "Utentename/Password non validi: |$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;"; +$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>VICIDIAL ADMIN:Orologio Status +<? + +##### 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>Orologio Status for <? echo $user_group ?></TD><TD ALIGN=RIGHT>             +<? +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>Utente Group</a>\n"; +?> +</TD></TR> + + + + +<? + +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 Utente Gruppo: $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 CAMPAIGN</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 + } + + 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]);} + + $s++; + } + $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>TOTALI</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>\nTempo Esecuzione Script: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? +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 TIEMPO 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>ORE:MINUTI</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>TOTALE </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>\nTempo Esecuzione Script: $RUNtime seconds</font>"; + + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + + + + + diff --git a/LANG_www/vicidial_it/user_group_bulk_change.php b/LANG_www/vicidial_it/user_group_bulk_change.php new file mode 100644 index 00000000..77e836df --- /dev/null +++ b/LANG_www/vicidial_it/user_group_bulk_change.php @@ -0,0 +1,269 @@ +<? +# 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 +# + +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["INVIA"])) {$INVIA=$_GET["INVIA"];} + elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,webroot_writable 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]; + $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 "Utentename/Password non validi: |$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 * 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>VICIDIAL ADMIN: Gruppo Utente Bulk Cambia +<? + +##### 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>   Gruppo Utente Bulk Cambia</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   </TD></TR> + + + + +<? + +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 Gruppo Utente $old_group Utenti changed to the $group Gruppo Utente<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 Utente Group CHANGE', event_sql=\"$SQL_log\", event_notes='Old Gruppo: $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 Utenti changed to the $group Gruppo Utente<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 Utente Group 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 Utenti in this gruppo: <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 gruppo: <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=INVIA></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 Utenti to this gruppo: <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=INVIA></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>\nTempo Esecuzione Script: $RUNtime seconds</font>"; + +echo "|$stage|$group|"; + +?> + + +</TD></TR><TABLE> +</body> +</html> + +<? + +exit; + + + +?> + diff --git a/LANG_www/vicidial_it/user_stats.php b/LANG_www/vicidial_it/user_stats.php index 5a3c99fc..23351009 100644 --- a/LANG_www/vicidial_it/user_stats.php +++ b/LANG_www/vicidial_it/user_stats.php @@ -1,7 +1,7 @@ <? # user_stats.php # -# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -13,6 +13,10 @@ # 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 # header ("Content-type: text/html; charset=utf-8"); @@ -60,7 +64,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -72,6 +76,7 @@ $browser = getenv("HTTP_USER_AGENT"); $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); } @@ -79,6 +84,8 @@ $browser = getenv("HTTP_USER_AGENT"); { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } $stmt="SELECT full_name from vicidial_users where user='$user';"; @@ -94,14 +101,35 @@ $browser = getenv("HTTP_USER_AGENT"); ?> <html> <head> -<title>VICIDIAL ADMIN: User Stats + +VICIDIAL ADMIN: Statistiche utente <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=680 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Statistiche utente for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> @@ -111,28 +139,29 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n" 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=user value=\"$user\">\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10> to \n"; echo "<input type=text name=end_date value=\"$end_date\" size=10 maxsize=10>  \n"; +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\n"; +echo "           $user - $full_name<BR><BR>\n"; -echo " - <a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_status.php?user=$user\">User Status</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; +echo "<center>\n"; +echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; +echo " | <a href=\"./user_status.php?user=$user\">Status Utente</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\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); - $statuses_to_print = mysql_num_rows($rslt); - echo "<br><center>\n"; ##### vicidial agent talk time and status ##### @@ -142,38 +171,61 @@ echo "<B>VICIDIAL TEMPO DI CHIAMATA E ESITO:</B>\n"; echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>ORE:MINUTI</td></tr>\n"; - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours_int = round($call_hours, 2); - $call_hours_int = intval("$call_hours_int"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo "<tr $bgcolor><td><font size=2>$row[1]</td>"; - echo "<td align=right><font size=2> $row[0]</td>\n"; - echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; +$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 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'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; +$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_seconds = $call_sec[$o]; $call_hours = ($call_seconds / 3600); $call_hours_int = round($call_hours, 2); $call_hours_int = intval("$call_hours_int"); @@ -182,6 +234,24 @@ echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td $call_minutes_int = round($call_minutes, 0); if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + 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_int:$call_minutes_int</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + +$call_seconds = $total_sec; +$call_hours = ($call_seconds / 3600); +$call_hours_int = round($call_hours, 2); +$call_hours_int = intval("$call_hours_int"); +$call_minutes = ($call_hours - $call_hours_int); +$call_minutes = ($call_minutes * 60); +$call_minutes_int = round($call_minutes, 0); +if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} + echo "<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n"; echo "</TABLE></center>\n"; @@ -503,6 +573,30 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$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 @@ -525,7 +619,45 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon } -echo "</TABLE></center>\n"; +echo "</TABLE><BR><BR>\n"; + + +##### vicidial agent outbound user manual calls for this time period ##### + +echo "<B>MANUAL OUTBOUND 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"); diff --git a/LANG_www/vicidial_it/user_status.php b/LANG_www/vicidial_it/user_status.php index 43212f77..3bc08511 100644 --- a/LANG_www/vicidial_it/user_status.php +++ b/LANG_www/vicidial_it/user_status.php @@ -1,12 +1,15 @@ <? # user_status.php # -# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# 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 # header ("Content-type: text/html; charset=utf-8"); @@ -76,7 +79,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else @@ -102,6 +105,8 @@ $browser = getenv("HTTP_USER_AGENT"); { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; } } @@ -161,14 +166,35 @@ while ($i < $groups_to_print) ?> <html> <head> -<title>VICIDIAL ADMIN: User Status + +VICIDIAL ADMIN: Status Utente <? -echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; + + +##### 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"); + + + ?> -</head> -<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0> -<CENTER> -<TABLE WIDTH=620 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>   VICIDIAL ADMIN</a>: User Status for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?>   </TD></TR> +<TABLE WIDTH=<? echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Status Utente for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   </TD></TR> @@ -293,7 +319,7 @@ if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($mod $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='Timeclock ID: $timeclock_id|';"; + $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='Orologio ID: $timeclock_id|';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -346,7 +372,7 @@ if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($mod $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='User login time: $last_action_sec|Timeclock ID: $timeclock_id|';"; + $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='Utente login time: $last_action_sec|Orologio ID: $timeclock_id|';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -398,7 +424,7 @@ if ($agents_to_print > 0) $o++; } echo "</SELECT>\n"; - echo "<input type=submit name=submit value=CHANGE><BR></form>\n"; + echo "<input type=submit name=submit value=CHANGE disabled><BR></form>\n"; echo "<form action=$PHP_SELF method=POST>\n"; @@ -418,13 +444,13 @@ echo "\n<BR>"; if ( ($Tstatus == "LOGIN") or ($Tstatus == "START") ) { - echo "User $user($full_name) - is logged in to the timeclock. <BR>Login time: $Tevent_date from $Tip_address<BR>\n"; + echo "Utente $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 "User $user($full_name) - is NOT logged in to the timeclock. <BR>Last logout time: $Tevent_date from $Tip_address<BR>\n"; + echo "Utente $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'; } @@ -441,9 +467,13 @@ if ($modify_timeclock_log > 0) } +$REPORTdate = date("Y-m-d"); +echo "<center>\n"; echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">VICIDIAL Time Sheet</a>\n"; -echo " - <a href=\"./user_stats.php?user=$user\">User Stats</a>\n"; -echo " - <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; +echo " | <a href=\"./user_stats.php?user=$user\">Statistiche utente</a>\n"; +echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; +echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; +echo "</center>\n"; echo "</B></TD></TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; diff --git a/LANG_www/vicidial_it/vdremote.php b/LANG_www/vicidial_it/vdremote.php index 4afc0ba5..cc11a8ce 100644 --- a/LANG_www/vicidial_it/vdremote.php +++ b/LANG_www/vicidial_it/vdremote.php @@ -90,7 +90,7 @@ $browser = getenv("HTTP_USER_AGENT"); { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); - echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else diff --git a/LANG_www/vicidial_it/vicidial_admin_web_logo.gif b/LANG_www/vicidial_it/vicidial_admin_web_logo.gif new file mode 100644 index 00000000..8c5a9d22 Binary files /dev/null and b/LANG_www/vicidial_it/vicidial_admin_web_logo.gif differ diff --git a/LANG_www/vicidial_it/vicidial_admin_web_logo_small.gif b/LANG_www/vicidial_it/vicidial_admin_web_logo_small.gif new file mode 100644 index 00000000..95738d49 Binary files /dev/null and b/LANG_www/vicidial_it/vicidial_admin_web_logo_small.gif differ diff --git a/LANG_www/vicidial_it/vicidial_sales_viewer.php b/LANG_www/vicidial_it/vicidial_sales_viewer.php new file mode 100644 index 00000000..d3fefe33 --- /dev/null +++ b/LANG_www/vicidial_it/vicidial_sales_viewer.php @@ -0,0 +1,236 @@ +<? header("Pragma: no-cache"); +# +# vicidial_sales_viewer.php - VICIDIAL administration page +# +# +# Copyright (C) 2009 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# +# CHANGES +# 80310-1500 - first build +# 90310-2135 - Added admin header +# + +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"];} + +?> +<html> +<head> +<title>VICIDIAL recent sales lookup + + + + + +
"; +?> + + + + + + + + + + + + + + + + + + + + + + + +
Vicidial OUTBOUND recent sales report               Back to Admin +
+ + + + + + + + + + +
Select a VICIDIAL 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)
Campagna 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/LANG_www/vicidial_it/vtiger_search.php b/LANG_www/vicidial_it/vtiger_search.php new file mode 100644 index 00000000..5e9c9761 --- /dev/null +++ b/LANG_www/vicidial_it/vtiger_search.php @@ -0,0 +1,788 @@ + 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 +# +# 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 +# + +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 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]; + } +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; + +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;} + + + + + +########################################################################## +##### 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 + { + 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) + { + 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]; + + 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/LANG_www/vicidial_it/vtiger_user.php b/LANG_www/vicidial_it/vtiger_user.php new file mode 100644 index 00000000..695c1622 --- /dev/null +++ b/LANG_www/vicidial_it/vtiger_user.php @@ -0,0 +1,316 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 81231-1307 - First build +# 90228-2152 - Added Groups support +# + +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_groups_seq to use as groupid + $stmt="SELECT id from vtiger_groups_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_groups_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/LANG_www/vicidial_it/welcome.php b/LANG_www/vicidial_it/welcome.php index cee85355..0ed12cdb 100644 --- a/LANG_www/vicidial_it/welcome.php +++ b/LANG_www/vicidial_it/welcome.php @@ -7,14 +7,14 @@ echo "VICIDIAL Benvenuto\n"; echo "\n"; echo "\n"; -echo "




"; +echo "




"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/LANG_www/vicidial_it/welcome_demo.php b/LANG_www/vicidial_it/welcome_demo.php new file mode 100644 index 00000000..49c0e470 --- /dev/null +++ b/LANG_www/vicidial_it/welcome_demo.php @@ -0,0 +1,79 @@ + LICENSE: GPLv2 +# +header ("Content-type: text/html; charset=utf-8"); + +echo "VICIDIAL Welcome\n"; +echo "\n"; +echo "\n"; +echo "



Benvenuti
 
Agent Login
 
Timeclock
Orologio
 
Administration
 
"; +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 "
"; +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 "
\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/LANG_www/vicidial_it/welcome_languages.php b/LANG_www/vicidial_it/welcome_languages.php new file mode 100644 index 00000000..a89bbfcb --- /dev/null +++ b/LANG_www/vicidial_it/welcome_languages.php @@ -0,0 +1,79 @@ + 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 "
"; +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 "
\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/UPGRADE b/UPGRADE index aae0c4e4..52417f4c 100644 --- a/UPGRADE +++ b/UPGRADE @@ -247,7 +247,7 @@ Nothing yet, this was just branched system to simplify administration for inbound-only call centers 55. Added patch and configuration options to allow VICIDIAL to work with Sangoma - ParaXip CPD(Call Progress Detection) + ParaXip CPD(Call Progress Detection) for Answering Maching and Fax detection 56. Added list_download.php that allows you to download the entire contents of vicidial lists from the admin.php interface. You must set the download_lists diff --git a/bin/build_translation_www_files.pl b/bin/build_translation_www_files.pl index da454e2b..f9a5fe0a 100644 --- a/bin/build_translation_www_files.pl +++ b/bin/build_translation_www_files.pl @@ -4,11 +4,12 @@ # # converts web pages to other language # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # changes: # 60808-1029 - Changed to use /etc/astguiclient.conf for configs # 70402-1305 - Added error log generation for not found phrases +# 90317-0127 - Changed internationalization link for admin # ############################################ @@ -333,7 +334,9 @@ foreach(@lang_list) $lang_list_name = $lang_list_detail[1]; if ($lang_list_abb =~ /$lang_abb/) {$list_bgcolor = ' BGCOLOR=\"#CCFFCC\"';} else {$list_bgcolor = '';} - $file[$LINESct] .= "echo \"
$lang_list_name $lang_list_name
\n"; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; $o=0; diff --git a/www/vicidial/welcome_demo.php b/www/vicidial/welcome_demo.php index b16994c1..49c0e470 100644 --- a/www/vicidial/welcome_demo.php +++ b/www/vicidial/welcome_demo.php @@ -66,6 +66,9 @@ echo "   \n"; echo "\n"; +echo "
SCRIPT IDSCRIPT NAMEFILTER IDFILTER NAMEMODIFY
"; echo "   Greek Administration"; +echo "
"; +echo "   French Administration"; echo "
\n"; echo "
 
\n"; diff --git a/www/vicidial/welcome_languages.php b/www/vicidial/welcome_languages.php index 3c2e38c2..a89bbfcb 100644 --- a/www/vicidial/welcome_languages.php +++ b/www/vicidial/welcome_languages.php @@ -66,6 +66,9 @@ echo "  
"; echo "   Greek Administration"; +echo "
"; +echo "   French Administration"; echo "
\n"; echo "
 
\n";